diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-11-29 13:32:52 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-11-29 13:32:52 +0100 |
| commit | 5db15c323d76dca9ae71b0204d63dcb09fbbcbc5 (patch) | |
| tree | 4f69e58c9b6825b7b602712893950673abf9c286 /common/src/impl.rs | |
| parent | bac47e456085ea153ae6ae1b1e28e41868693c9c (diff) | |
| download | jellything-5db15c323d76dca9ae71b0204d63dcb09fbbcbc5.tar jellything-5db15c323d76dca9ae71b0204d63dcb09fbbcbc5.tar.bz2 jellything-5db15c323d76dca9ae71b0204d63dcb09fbbcbc5.tar.zst | |
remove asset token; db json
Diffstat (limited to 'common/src/impl.rs')
| -rw-r--r-- | common/src/impl.rs | 69 |
1 files changed, 1 insertions, 68 deletions
diff --git a/common/src/impl.rs b/common/src/impl.rs index ef1a874..585c778 100644 --- a/common/src/impl.rs +++ b/common/src/impl.rs @@ -3,10 +3,7 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2025 metamuffin <metamuffin.org> */ -use crate::{ - IdentifierType, Identifiers, Node, NodeID, NodeIDOrSlug, SourceTrack, SourceTrackKind, - TmdbKind, TraktKind, -}; +use crate::{Node, NodeID, NodeIDOrSlug, SourceTrack, SourceTrackKind}; use serde::{Deserialize, Serialize}; use std::{fmt::Display, str::FromStr}; @@ -44,70 +41,6 @@ impl Display for SourceTrack { } } -impl Display for TmdbKind { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_str(match self { - TmdbKind::Tv => "tv", - TmdbKind::Movie => "movie", - }) - } -} - -impl TraktKind { - pub fn singular(self) -> &'static str { - match self { - TraktKind::Movie => "movie", - TraktKind::Show => "show", - TraktKind::Season => "season", - TraktKind::Episode => "episode", - TraktKind::Person => "person", - TraktKind::User => "user", - } - } - pub fn plural(self) -> &'static str { - match self { - TraktKind::Movie => "movies", - TraktKind::Show => "shows", - TraktKind::Season => "seasons", - TraktKind::Episode => "episodes", - TraktKind::Person => "people", - TraktKind::User => "users", // //! not used in API - } - } -} -impl Display for TraktKind { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_str(match self { - TraktKind::Movie => "Movie", - TraktKind::Show => "Show", - TraktKind::Season => "Season", - TraktKind::Episode => "Episode", - TraktKind::Person => "Person", - TraktKind::User => "User", - }) - } -} -impl Display for Identifiers { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - if let Some(id) = self.0.get(&IdentifierType::Trakt) { - f.write_fmt(format_args!("trakt={}", id))?; - } - if let Some(id) = &self.0.get(&IdentifierType::Tmdb) { - f.write_fmt(format_args!(",tmdb={}", id))?; - } - if let Some(_id) = &self.0.get(&IdentifierType::Imdb) { - f.write_str(",imdb")?; - } - if let Some(_id) = &self.0.get(&IdentifierType::Tvdb) { - f.write_str(",tvdb")?; - } - if let Some(_id) = &self.0.get(&IdentifierType::Omdb) { - f.write_str(",omdb")?; - } - Ok(()) - } -} - impl NodeID { pub fn from_slug(slug: &str) -> Self { let mut h = blake3::Hasher::new(); |