Skip to content

Commit

Permalink
fix: add back TvDB IDs for series links in APIv2
Browse files Browse the repository at this point in the history
- Added back the TvDB IDs for the series links endpoint in APIv2 because Shoko Metadata may be using them for theme videos. But this time it's sourced from the TMDB data, since the TvDB data is gone.
  • Loading branch information
revam committed Oct 13, 2024
1 parent d3df135 commit 1ddec53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Shoko.Server/API/v2/Modules/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3239,7 +3239,11 @@ public static Dictionary<string, object> GetLinks(int id)

var serie = RepoFactory.AnimeSeries.GetByID(id);
var trakt = serie?.TraktShow;
if (trakt != null) links.Add("trakt", trakt.Where(a => !string.IsNullOrEmpty(a.URL)).Select(x => x.URL).ToArray());
if (trakt != null)
links.Add("trakt", trakt.Where(a => !string.IsNullOrEmpty(a.URL)).Select(x => x.URL).ToArray());

if (serie?.TmdbShows is { Count: > 0 } tmdbShows)
links.Add("tvdb", tmdbShows.Select(x => x.TvdbShowID).WhereNotNull().ToArray());

if (serie?.TmdbMovieCrossReferences is { Count: > 0 } tmdbMovieXrefs)
links.Add("tmdb", tmdbMovieXrefs[0].TmdbMovieID);
Expand Down

0 comments on commit 1ddec53

Please sign in to comment.