mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-02 00:34:37 +02:00
Anime!
New: Anime support New: pull alternate names from thexem.de New: Search using all alternate names (if rage ID is unavailable) New: Show scene mapping information when hovering over episode number New: Full season searching for anime (searches for each episode) New: animezb.com anime indexer New: Treat BD as bluray Fixed: Parsing of 2 digit absolute episode numbers Fixed: Loading series details page for series that start with period Fixed: Return 0 results when manual search fails, instead of an error Fixed: animezb URL
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.Instrumentation;
|
||||
|
||||
namespace NzbDrone.Core.Indexers
|
||||
@@ -89,5 +90,30 @@ namespace NzbDrone.Core.Indexers
|
||||
|
||||
return element != null ? element.Value : defaultValue;
|
||||
}
|
||||
|
||||
public static T TryGetValue<T>(this XElement item, string elementName, T defaultValue)
|
||||
{
|
||||
var element = item.Element(elementName);
|
||||
|
||||
if (element == null)
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
if (element.Value.IsNullOrWhiteSpace())
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return (T)Convert.ChangeType(element.Value, typeof(T));
|
||||
}
|
||||
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user