mirror of
https://github.com/Radarr/Radarr
synced 2026-01-26 09:23:39 +01:00
Fix remaining technical debt bugs
- Bug-001: Add null check for SingleOrDefault() in TorrentRssParser - Bug-006: Replace generic Exception with PathCombinationException in OsPath - Bug-006: Replace generic Exception with NotSupportedException in IMDbListRequestGenerator
This commit is contained in:
parent
d82f07e872
commit
f435f38a27
4 changed files with 23 additions and 3 deletions
|
|
@ -421,7 +421,7 @@ public bool Equals(OsPath other, bool ignoreTrailingSlash)
|
|||
{
|
||||
if (left.Kind != right.Kind && right.Kind != OsPathKind.Unknown)
|
||||
{
|
||||
throw new Exception(string.Format("Cannot combine OsPaths of different platforms ('{0}' + '{1}')", left, right));
|
||||
throw new PathCombinationException("Cannot combine OsPaths of different platforms ('{0}' + '{1}')", left, right);
|
||||
}
|
||||
|
||||
if (right.IsEmpty)
|
||||
|
|
|
|||
17
src/NzbDrone.Common/Disk/PathCombinationException.cs
Normal file
17
src/NzbDrone.Common/Disk/PathCombinationException.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using NzbDrone.Common.Exceptions;
|
||||
|
||||
namespace NzbDrone.Common.Disk
|
||||
{
|
||||
public class PathCombinationException : NzbDroneException
|
||||
{
|
||||
public PathCombinationException(string message, params object[] args)
|
||||
: base(message, args)
|
||||
{
|
||||
}
|
||||
|
||||
public PathCombinationException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@ protected override HttpRequest GetHttpRequest()
|
|||
// Use IMDb list Export for user lists to bypass RadarrAPI caching
|
||||
if (Settings.ListId.StartsWith("ls", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
throw new Exception("IMDb lists of the form 'ls12345678' are no longer supported. Feel free to remove this list after you review your Clean Library Level.");
|
||||
throw new NotSupportedException("IMDb lists of the form 'ls12345678' are no longer supported. Feel free to remove this list after you review your Clean Library Level.");
|
||||
}
|
||||
|
||||
var request = RequestBuilder.Create()
|
||||
|
|
|
|||
|
|
@ -168,7 +168,10 @@ protected virtual string GetMagnetUrl(XElement item)
|
|||
if (PeersElementName.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
var itempeers = item.FindDecendants(PeersElementName).SingleOrDefault();
|
||||
return int.Parse(itempeers.Value);
|
||||
if (itempeers != null)
|
||||
{
|
||||
return int.Parse(itempeers.Value);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue