Fixed: Importing Plex RSS lists with invalid items (#6374)
This commit is contained in:
parent
8dd3b45c90
commit
bfd24da2d9
|
@ -3,18 +3,19 @@ using System.Xml.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.Indexers;
|
using NzbDrone.Core.Indexers;
|
||||||
using NzbDrone.Core.Indexers.Exceptions;
|
|
||||||
using NzbDrone.Core.Parser.Model;
|
using NzbDrone.Core.Parser.Model;
|
||||||
|
|
||||||
namespace NzbDrone.Core.ImportLists.Rss.Plex
|
namespace NzbDrone.Core.ImportLists.Rss.Plex
|
||||||
{
|
{
|
||||||
public class PlexRssImportParser : RssImportBaseParser
|
public class PlexRssImportParser : RssImportBaseParser
|
||||||
{
|
{
|
||||||
|
private readonly Logger _logger;
|
||||||
private static readonly Regex ImdbIdRegex = new (@"(tt\d{7,8})", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
private static readonly Regex ImdbIdRegex = new (@"(tt\d{7,8})", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||||
|
|
||||||
public PlexRssImportParser(Logger logger)
|
public PlexRssImportParser(Logger logger)
|
||||||
: base(logger)
|
: base(logger)
|
||||||
{
|
{
|
||||||
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override ImportListItemInfo ProcessItem(XElement item)
|
protected override ImportListItemInfo ProcessItem(XElement item)
|
||||||
|
@ -53,7 +54,9 @@ namespace NzbDrone.Core.ImportLists.Rss.Plex
|
||||||
|
|
||||||
if (info.ImdbId.IsNullOrWhiteSpace() && info.TvdbId == 0 && info.TmdbId == 0)
|
if (info.ImdbId.IsNullOrWhiteSpace() && info.TvdbId == 0 && info.TmdbId == 0)
|
||||||
{
|
{
|
||||||
throw new UnsupportedFeedException("Each item in the RSS feed must have a guid element with a IMDB ID, TVDB ID or TMDB ID");
|
_logger.Warn("Each item in the RSS feed must have a guid element with a IMDB ID, TVDB ID or TMDB ID: '{0}'", info.Title);
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
|
|
Loading…
Reference in New Issue