// Your plugin must implement: // exists(path: RsProviderPath) -> bool; // remove(path: RsProviderPath) -> bool; // infos(path: RsProviderPath) -> MediaForUpdate; // get(path: RsProviderPath) -> RsRequest; // add(path: RsProviderAddRequest) -> RsRequest; use serde::{Deserialize, Serialize}; use strum_macros::EnumString; use crate::RsRequest; #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] #[serde(rename_all = "camelCase")] pub struct RsProviderPath { pub root: Option, pub source: String, } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] #[serde(rename_all = "camelCase")] pub struct RsProviderAddRequest { pub root: String, pub name: String, pub overwrite: bool, } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] #[serde(rename_all = "camelCase")] pub struct RsProviderAddResponse { pub request: RsRequest, pub multipart: Option, pub source: Option, pub packets: Option } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, strum_macros::Display,EnumString, Default)] #[strum(serialize_all = "camelCase")] #[serde(rename_all = "camelCase")] pub enum RsProviderEntryType { Directory, File, #[default] Other } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] #[serde(rename_all = "camelCase")] pub struct RsProviderEntry { pub source: String, pub kind: RsProviderEntryType, pub size: Option, pub mimetype: Option, pub hash: Option, pub added: Option, pub modified: Option, pub created: Option, } impl RsProviderEntry { pub fn mime_or_default(&self) -> String { self.mimetype.clone().unwrap_or("application/octet-stream".to_string()) } }