Skip to content

Commit ae9d02d

Browse files
authored
Get Jellyfin Sink working with TVDB (#1767)
* Get Jellyfin Sink working with TVDB Fixes #1766 * ci: Run CI * fix: update TVDB ID retrieval logic in sink_progress function * feat: implement centralized JSON response handling for IGDB API calls * ci: Run CI * refactor: remove json_response function and use reqwest's json method directly * fix: replace or_else with or for TVDB ID retrieval in sink_progress function * Revert "feat: implement centralized JSON response handling for IGDB API calls" This reverts commit 46657b6.
1 parent 86e3597 commit ae9d02d

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

crates/providers/tvdb/src/base.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,8 @@ impl TvdbService {
121121
"{URL}/{entity_type}/{identifier}/translations/{target_language}",
122122
))
123123
.send()
124-
.await?
125-
.json::<TvdbItemTranslationResponse>()
126124
.await?;
125+
let response: TvdbItemTranslationResponse = response.json().await?;
127126

128127
if response.status != "success" {
129128
bail!("Translation not found");

crates/services/integration/src/sink/jellyfin.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,10 @@ pub async fn sink_progress(
6767
let (identifier, source) = match use_tvdb {
6868
true => {
6969
let id = payload
70-
.item
71-
.provider_ids
72-
.tvdb
70+
.series
7371
.as_ref()
74-
.or_else(|| {
75-
payload
76-
.series
77-
.as_ref()
78-
.and_then(|s| s.provider_ids.tvdb.as_ref())
79-
})
72+
.and_then(|s| s.provider_ids.tvdb.as_ref())
73+
.or(payload.item.provider_ids.tvdb.as_ref())
8074
.ok_or_else(|| anyhow!("No TVDB ID associated with this media"))?
8175
.clone();
8276
(id, MediaSource::Tvdb)

0 commit comments

Comments
 (0)