From 2fcbac49c74eecfa140227be4064da816f3966e6 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 19 Sep 2023 19:10:20 +0300 Subject: [PATCH] Fixed: Add support for TMDb in Plex Watchlist RSS Fixes #9208 --- .../ImportLists/Rss/Plex/PlexRssImportParser.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImportParser.cs b/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImportParser.cs index 3efa2e5ef..8b74d4b2c 100644 --- a/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImportParser.cs +++ b/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImportParser.cs @@ -30,14 +30,22 @@ protected override ImportListMovie ProcessItem(XElement item) var guid = item.TryGetValue("guid", string.Empty); - if (guid.IsNotNullOrWhiteSpace() && guid.StartsWith("imdb://")) + if (guid.IsNotNullOrWhiteSpace()) { - info.ImdbId = Parser.Parser.ParseImdbId(guid.Replace("imdb://", "")); + if (guid.StartsWith("imdb://")) + { + info.ImdbId = Parser.Parser.ParseImdbId(guid.Replace("imdb://", "")); + } + + if (int.TryParse(guid.Replace("tmdb://", ""), out var tmdbId)) + { + info.TmdbId = tmdbId; + } } - if (info.ImdbId.IsNullOrWhiteSpace()) + if (info.ImdbId.IsNullOrWhiteSpace() && info.TmdbId == 0) { - throw new UnsupportedFeedException("Each item in the RSS feed must have a guid element with a IMDB ID"); + throw new UnsupportedFeedException("Each item in the RSS feed must have a guid element with a IMDB ID or TMDB ID"); } return info;