diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-12-10 17:52:41 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-12-10 17:52:41 +0100 |
| commit | e4f865e9da9d6660399e22a6fbeb5b84a749b07a (patch) | |
| tree | 4af69589e8850d8a2b0c88a10e43efe8c79cb8dc /import/src/plugins/tmdb.rs | |
| parent | a0cfd77b4d19c43a28c4d82072e6ff136e336af3 (diff) | |
| download | jellything-e4f865e9da9d6660399e22a6fbeb5b84a749b07a.tar jellything-e4f865e9da9d6660399e22a6fbeb5b84a749b07a.tar.bz2 jellything-e4f865e9da9d6660399e22a6fbeb5b84a749b07a.tar.zst | |
refactor import plugins part 2
Diffstat (limited to 'import/src/plugins/tmdb.rs')
| -rw-r--r-- | import/src/plugins/tmdb.rs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/import/src/plugins/tmdb.rs b/import/src/plugins/tmdb.rs index 3d6e832..5980d53 100644 --- a/import/src/plugins/tmdb.rs +++ b/import/src/plugins/tmdb.rs @@ -3,17 +3,20 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2025 metamuffin <metamuffin.org> */ -use crate::USER_AGENT; -use anyhow::{anyhow, bail, Context, Result}; -use jellycache::{cache_memory, cache_store, EscapeKey, HashKey}; +use crate::{ + USER_AGENT, + plugins::{ImportPlugin, PluginInfo}, +}; +use anyhow::{Context, Result, anyhow, bail}; +use jellycache::{EscapeKey, HashKey, cache_memory, cache_store}; use jellycommon::{ - chrono::{format::Parsed, Utc}, Asset, + chrono::{Utc, format::Parsed}, }; use log::info; use reqwest::{ - header::{HeaderMap, HeaderName, HeaderValue}, Client, ClientBuilder, + header::{HeaderMap, HeaderName, HeaderValue}, }; use serde::{Deserialize, Serialize}; use std::{fmt::Display, sync::Arc}; @@ -153,6 +156,15 @@ impl Tmdb { } } +impl ImportPlugin for Tmdb { + fn info(&self) -> PluginInfo { + PluginInfo { + name: "tmdb", + ..Default::default() + } + } +} + pub fn parse_release_date(d: &str) -> Result<Option<i64>> { if d.is_empty() { return Ok(None); |