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/trakt.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/trakt.rs')
| -rw-r--r-- | import/src/plugins/trakt.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/import/src/plugins/trakt.rs b/import/src/plugins/trakt.rs index 5a1aa8e..6d5b007 100644 --- a/import/src/plugins/trakt.rs +++ b/import/src/plugins/trakt.rs @@ -5,7 +5,7 @@ */ use crate::{ USER_AGENT, - plugins::{ImportContext, ImportPlugin}, + plugins::{ImportContext, ImportPlugin, PluginInfo}, }; use anyhow::{Context, Result, bail}; use jellycache::{HashKey, cache_memory}; @@ -383,7 +383,14 @@ impl Display for TraktKind { } impl ImportPlugin for Trakt { - fn import_instruction(&self, ct: &ImportContext, node: NodeID, line: &str) -> Result<()> { + fn info(&self) -> PluginInfo { + PluginInfo { + name: "takt", + handle_instruction: true, + ..Default::default() + } + } + fn instruction(&self, ct: &ImportContext, node: NodeID, line: &str) -> Result<()> { if let Some(value) = line.strip_prefix("trakt-").or(line.strip_prefix("trakt=")) { let (ty, id) = value.split_once(":").unwrap_or(("movie", value)); let ty = match ty { |