New: Support import list lookup by TMDb ID
This commit is contained in:
parent
71fd09f162
commit
c028222617
|
@ -90,7 +90,7 @@ namespace NzbDrone.Core.ImportLists
|
||||||
|
|
||||||
var importList = importLists.Single(x => x.Id == item.ImportListId);
|
var importList = importLists.Single(x => x.Id == item.ImportListId);
|
||||||
|
|
||||||
// Map by IMDbId if we have it
|
// Map by IMDb ID if we have it
|
||||||
if (item.TvdbId <= 0 && item.ImdbId.IsNotNullOrWhiteSpace())
|
if (item.TvdbId <= 0 && item.ImdbId.IsNotNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
var mappedSeries = _seriesSearchService.SearchForNewSeriesByImdbId(item.ImdbId)
|
var mappedSeries = _seriesSearchService.SearchForNewSeriesByImdbId(item.ImdbId)
|
||||||
|
@ -103,7 +103,20 @@ namespace NzbDrone.Core.ImportLists
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map by AniListId if we have it
|
// Map by TMDb ID if we have it
|
||||||
|
if (item.TvdbId <= 0 && item.TmdbId > 0)
|
||||||
|
{
|
||||||
|
var mappedSeries = _seriesSearchService.SearchForNewSeriesByTmdbId(item.TmdbId)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
if (mappedSeries != null)
|
||||||
|
{
|
||||||
|
item.TvdbId = mappedSeries.TvdbId;
|
||||||
|
item.Title = mappedSeries?.Title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Map by AniList ID if we have it
|
||||||
if (item.TvdbId <= 0 && item.AniListId > 0)
|
if (item.TvdbId <= 0 && item.AniListId > 0)
|
||||||
{
|
{
|
||||||
var mappedSeries = _seriesSearchService.SearchForNewSeriesByAniListId(item.AniListId)
|
var mappedSeries = _seriesSearchService.SearchForNewSeriesByAniListId(item.AniListId)
|
||||||
|
|
|
@ -44,6 +44,11 @@ namespace NzbDrone.Core.ImportLists.Rss.Plex
|
||||||
{
|
{
|
||||||
info.TvdbId = tvdbId;
|
info.TvdbId = tvdbId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (int.TryParse(guid.Replace("tmdb://", ""), out var tmdbId))
|
||||||
|
{
|
||||||
|
info.TmdbId = tvdbId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.ImdbId.IsNullOrWhiteSpace() && info.TvdbId == 0)
|
if (info.ImdbId.IsNullOrWhiteSpace() && info.TvdbId == 0)
|
||||||
|
|
|
@ -8,5 +8,6 @@ namespace NzbDrone.Core.MetadataSource
|
||||||
List<Series> SearchForNewSeries(string title);
|
List<Series> SearchForNewSeries(string title);
|
||||||
List<Series> SearchForNewSeriesByImdbId(string imdbId);
|
List<Series> SearchForNewSeriesByImdbId(string imdbId);
|
||||||
List<Series> SearchForNewSeriesByAniListId(int aniListId);
|
List<Series> SearchForNewSeriesByAniListId(int aniListId);
|
||||||
|
List<Series> SearchForNewSeriesByTmdbId(int tmdbId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,13 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Series> SearchForNewSeriesByTmdbId(int tmdbId)
|
||||||
|
{
|
||||||
|
var results = SearchForNewSeries($"tmdb:{tmdbId}");
|
||||||
|
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Series> SearchForNewSeries(string title)
|
public List<Series> SearchForNewSeries(string title)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue