diff options
Diffstat (limited to 'import/src/trakt.rs')
| -rw-r--r-- | import/src/trakt.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/import/src/trakt.rs b/import/src/trakt.rs index 1640ca5..4a4beea 100644 --- a/import/src/trakt.rs +++ b/import/src/trakt.rs @@ -6,7 +6,7 @@ use crate::USER_AGENT; use anyhow::Context; use jellycache::{cache_memory, CacheKey}; -use jellycommon::{Appearance, CreditCategory, NodeID}; +use jellycommon::{Appearance, CreditCategory, NodeID, NodeKind}; use log::info; use reqwest::{ header::{HeaderMap, HeaderName, HeaderValue}, @@ -253,7 +253,7 @@ pub enum TraktPeopleGroup { CreatedBy, } impl TraktPeopleGroup { - pub fn a(self) -> CreditCategory { + pub fn as_credit_category(self) -> CreditCategory { match self { TraktPeopleGroup::Production => CreditCategory::Production, TraktPeopleGroup::Art => CreditCategory::Art, @@ -339,6 +339,19 @@ pub enum TraktKind { } impl TraktKind { + pub fn as_node_kind(self) -> NodeKind { + match self { + TraktKind::Movie => NodeKind::Movie, + TraktKind::Show => NodeKind::Show, + TraktKind::Season => NodeKind::Season, + TraktKind::Episode => NodeKind::Episode, + TraktKind::Person => NodeKind::Channel, + TraktKind::User => NodeKind::Channel, + } + } +} + +impl TraktKind { pub fn singular(self) -> &'static str { match self { TraktKind::Movie => "movie", |