aboutsummaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-12-12 16:44:20 +0100
committermetamuffin <metamuffin@disroot.org>2025-12-12 16:44:20 +0100
commit5664e5df0e2295697363dacd23614143b9d7cadb (patch)
tree4eba27957aadc1ec9389f16f0078e506ed2b7edc /tool
parent3661af07620caad1bfa46fa6902054797433fc0f (diff)
downloadjellything-5664e5df0e2295697363dacd23614143b9d7cadb.tar
jellything-5664e5df0e2295697363dacd23614143b9d7cadb.tar.bz2
jellything-5664e5df0e2295697363dacd23614143b9d7cadb.tar.zst
make jellytool work again; dummy cache driver
Diffstat (limited to 'tool')
-rw-r--r--tool/Cargo.toml1
-rw-r--r--tool/src/add.rs8
2 files changed, 6 insertions, 3 deletions
diff --git a/tool/Cargo.toml b/tool/Cargo.toml
index f8fb0e6..546fdc4 100644
--- a/tool/Cargo.toml
+++ b/tool/Cargo.toml
@@ -6,6 +6,7 @@ edition = "2024"
[dependencies]
jellycommon = { path = "../common" }
jellyimport = { path = "../import" }
+jellycache = { path = "../cache" }
log = { workspace = true }
env_logger = "0.11.8"
diff --git a/tool/src/add.rs b/tool/src/add.rs
index 40b8ce4..8152aad 100644
--- a/tool/src/add.rs
+++ b/tool/src/add.rs
@@ -5,9 +5,11 @@
*/
use crate::cli::Action;
use dialoguer::{Confirm, FuzzySelect, Input, theme::ColorfulTheme};
-use jellyimport::{get_trakt, plugins::trakt::TraktKind};
+use jellycache::init_cache_dummy;
+use jellyimport::plugins::trakt::{Trakt, TraktKind};
use log::warn;
use std::{
+ env::var,
fmt::Display,
fs::{OpenOptions, rename},
io::Write,
@@ -16,6 +18,7 @@ use std::{
use tokio::runtime::Handle;
pub fn add(action: Action, rt: &Handle) -> anyhow::Result<()> {
+ init_cache_dummy()?;
match action {
Action::Add { media } => {
let theme = ColorfulTheme::default();
@@ -33,8 +36,7 @@ pub fn add(action: Action, rt: &Handle) -> anyhow::Result<()> {
.interact_text()
.unwrap();
- let trakt = get_trakt()?;
-
+ let trakt = Trakt::new(&var("TRAKT_API_KEY").unwrap());
let results = trakt.search(search_kinds, &name, rt)?;
if results.is_empty() {