diff options
Diffstat (limited to 'common/src')
| -rw-r--r-- | common/src/lib.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/common/src/lib.rs b/common/src/lib.rs index 81d6d15..769cfe2 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -53,6 +53,35 @@ pub enum NodeIDOrSlug { Slug(String), } +macro_rules! keys { + ($($id:ident = $tag:literal $name:literal;)*) => { + $(const $id: Tag = Tag($tag);)* + }; +} + +keys! { + N_KIND = 1 "kind"; + N_TITLE = 2 "title"; + N_PARENT = 3 "parent"; + N_TAGLINE = 4 "tagline"; + N_DESCRIPTION = 5 "description"; + N_RELEASEDATE = 6 "releasedate"; + N_INDEX = 7 "index"; + N_SEASON_INDEX = 8 "season_index"; + N_MEDIA = 9 "media"; + N_TAG = 10 "tag"; + N_RATINGS = 11 "ratings"; + N_PICTURES = 12 "pictures"; + N_IDENTIFIERS = 13 "identifiers"; + N_VISIBILITY = 14 "visibility"; + N_STORAGE_SIZE = 15 "storage_size"; + + LANG_NATIVE = 0xa001 "native"; + LANG_ENG = 0xa002 "eng"; + LANG_DEU = 0xa003 "deu"; + LANG_JPN = 0xa003 "jpn"; +} + #[derive(Debug, Clone, Deserialize, Serialize, Default)] pub struct Node { pub slug: String, |