aboutsummaryrefslogtreecommitdiff
path: root/tool/src/add.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tool/src/add.rs')
-rw-r--r--tool/src/add.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/tool/src/add.rs b/tool/src/add.rs
index 2179a40..04328b2 100644
--- a/tool/src/add.rs
+++ b/tool/src/add.rs
@@ -4,11 +4,9 @@
Copyright (C) 2025 metamuffin <metamuffin.org>
*/
use crate::cli::Action;
-use anyhow::anyhow;
use dialoguer::{theme::ColorfulTheme, Confirm, FuzzySelect, Input};
-use jellybase::SECRETS;
use jellycommon::TraktKind;
-use jellyimport::trakt::Trakt;
+use jellyimport::get_trakt;
use log::warn;
use std::{
fmt::Display,
@@ -37,13 +35,7 @@ pub async fn add(action: Action) -> anyhow::Result<()> {
.interact_text()
.unwrap();
- let trakt = Trakt::new(
- SECRETS
- .api
- .trakt
- .as_ref()
- .ok_or(anyhow!("no trakt api key configured"))?,
- );
+ let trakt = get_trakt()?;
let results = trakt.search(search_kinds, &name).await?;