diff --git a/src/NzbDrone.Core/ImportLists/ImportListSyncService.cs b/src/NzbDrone.Core/ImportLists/ImportListSyncService.cs index e85e95730..ef735e75f 100644 --- a/src/NzbDrone.Core/ImportLists/ImportListSyncService.cs +++ b/src/NzbDrone.Core/ImportLists/ImportListSyncService.cs @@ -90,7 +90,7 @@ namespace NzbDrone.Core.ImportLists 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()) { 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) { var mappedSeries = _seriesSearchService.SearchForNewSeriesByAniListId(item.AniListId) diff --git a/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImportParser.cs b/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImportParser.cs index efd26708e..c1b7307fe 100644 --- a/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImportParser.cs +++ b/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImportParser.cs @@ -44,6 +44,11 @@ namespace NzbDrone.Core.ImportLists.Rss.Plex { info.TvdbId = tvdbId; } + + if (int.TryParse(guid.Replace("tmdb://", ""), out var tmdbId)) + { + info.TmdbId = tvdbId; + } } if (info.ImdbId.IsNullOrWhiteSpace() && info.TvdbId == 0) diff --git a/src/NzbDrone.Core/MetadataSource/ISearchForNewSeries.cs b/src/NzbDrone.Core/MetadataSource/ISearchForNewSeries.cs index 94d30f166..f8aef8654 100644 --- a/src/NzbDrone.Core/MetadataSource/ISearchForNewSeries.cs +++ b/src/NzbDrone.Core/MetadataSource/ISearchForNewSeries.cs @@ -8,5 +8,6 @@ namespace NzbDrone.Core.MetadataSource List SearchForNewSeries(string title); List SearchForNewSeriesByImdbId(string imdbId); List SearchForNewSeriesByAniListId(int aniListId); + List SearchForNewSeriesByTmdbId(int tmdbId); } } diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs index b067c3dd8..76efea07d 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs @@ -90,6 +90,13 @@ namespace NzbDrone.Core.MetadataSource.SkyHook return results; } + public List SearchForNewSeriesByTmdbId(int tmdbId) + { + var results = SearchForNewSeries($"tmdb:{tmdbId}"); + + return results; + } + public List SearchForNewSeries(string title) { try