mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -07:00
Fixed: Handling of poorly formed items when parsing results from indexer
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
parent
b7fe4193f3
commit
1eeb1bbf63
1 changed files with 17 additions and 4 deletions
|
@ -259,12 +259,25 @@ namespace NzbDrone.Core.Indexers
|
||||||
protected virtual RssEnclosure[] GetEnclosures(XElement item)
|
protected virtual RssEnclosure[] GetEnclosures(XElement item)
|
||||||
{
|
{
|
||||||
var enclosures = item.Elements("enclosure")
|
var enclosures = item.Elements("enclosure")
|
||||||
.Select(v => new RssEnclosure
|
.Select(v =>
|
||||||
{
|
{
|
||||||
Url = v.Attribute("url").Value,
|
try
|
||||||
Type = v.Attribute("type").Value,
|
{
|
||||||
Length = (long)v.Attribute("length")
|
return new RssEnclosure
|
||||||
|
{
|
||||||
|
Url = v.Attribute("url").Value,
|
||||||
|
Type = v.Attribute("type").Value,
|
||||||
|
Length = (long)v.Attribute("length")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.Warn(e, "Failed to get enclosure for: {0}", item.Title());
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
})
|
})
|
||||||
|
.Where(v => v != null)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
return enclosures;
|
return enclosures;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue