diff options
author | metamuffin <metamuffin@disroot.org> | 2023-01-11 18:14:24 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-01-11 18:14:24 +0100 |
commit | 0737008c5c649f0ce33719fb9126b284d76c9807 (patch) | |
tree | 55f3bfe31079269cdec2c00b7be0c29c62c792dd /common/src/lib.rs | |
parent | 948700d35f0eddbc2e0fd29548991e687362983d (diff) | |
download | jellything-0737008c5c649f0ce33719fb9126b284d76c9807.tar jellything-0737008c5c649f0ce33719fb9126b284d76c9807.tar.bz2 jellything-0737008c5c649f0ce33719fb9126b284d76c9807.tar.zst |
modularize!
Diffstat (limited to 'common/src/lib.rs')
-rw-r--r-- | common/src/lib.rs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/common/src/lib.rs b/common/src/lib.rs new file mode 100644 index 0000000..6c8bceb --- /dev/null +++ b/common/src/lib.rs @@ -0,0 +1,39 @@ +use std::{collections::BTreeMap, path::PathBuf}; + +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Deserialize, Serialize)] +pub struct DirectoryInfo { + pub name: String, +} + +#[derive(Debug, Clone, Deserialize, Serialize)] +pub struct ItemInfo { + pub title: String, + pub source: Vec<Source>, +} + +#[derive(Debug, Clone, Deserialize, Serialize)] +pub struct Source { + file: PathBuf, + tracks: BTreeMap<u64, SourceTrack>, +} + +#[derive(Debug, Clone, Deserialize, Serialize)] +pub enum SourceTrack { + Video { + name: String, + codec: String, + width: usize, + height: usize, + }, + Audio { + channels: usize, + codec: String, + sample_rate: f64, + language: String, + }, + Subtitles { + language: String, + }, +} |