diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-01-06 02:44:35 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-01-06 02:44:35 +0100 |
| commit | ce5ed3f54e873fff9135313a4ed9fa6656caf741 (patch) | |
| tree | 80e94a83d636308cb8f3758b18b96c3ded0edcf8 /common/src/lib.rs | |
| parent | d543f6fe11a32dcead2310f1fb4c2abd303f5f8c (diff) | |
| download | jellything-ce5ed3f54e873fff9135313a4ed9fa6656caf741.tar jellything-ce5ed3f54e873fff9135313a4ed9fa6656caf741.tar.bz2 jellything-ce5ed3f54e873fff9135313a4ed9fa6656caf741.tar.zst | |
draft object serialization
Diffstat (limited to 'common/src/lib.rs')
| -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, |