Remove unnecessary sanity check

This commit is contained in:
Balázs Váradi 2021-02-23 06:34:46 +01:00
parent 7ba53548a2
commit a015caba3f

View File

@ -86,21 +86,13 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{ {
reader.MoveToContent(); reader.MoveToContent();
if (reader.ReadToDescendant("episode")) if (reader.ReadToDescendant("episode") && int.TryParse(reader.ReadElementContentAsString(), out var num))
{
var number = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(number))
{
if (int.TryParse(number, out var num))
{ {
item.Item.IndexNumberEnd = Math.Max(num, item.Item.IndexNumberEnd ?? num); item.Item.IndexNumberEnd = Math.Max(num, item.Item.IndexNumberEnd ?? num);
} }
} }
} }
} }
}
}
catch (XmlException) catch (XmlException)
{ {
} }