mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
Fixed up some errors and do the guid cache fix on the module instead of backend coz that would cause other issues.
This commit is contained in:
parent
3383cc1744
commit
54bd3c0b49
2 changed files with 12 additions and 9 deletions
|
@ -53,7 +53,7 @@ namespace Lidarr.Api.V3.Indexers
|
||||||
|
|
||||||
private Response DownloadRelease(ReleaseResource release)
|
private Response DownloadRelease(ReleaseResource release)
|
||||||
{
|
{
|
||||||
var remoteAlbum = _remoteAlbumCache.Find(release.Guid);
|
var remoteAlbum = _remoteAlbumCache.Find(GetCacheKey(release));
|
||||||
|
|
||||||
if (remoteAlbum == null)
|
if (remoteAlbum == null)
|
||||||
{
|
{
|
||||||
|
@ -68,7 +68,7 @@ namespace Lidarr.Api.V3.Indexers
|
||||||
}
|
}
|
||||||
catch (ReleaseDownloadException ex)
|
catch (ReleaseDownloadException ex)
|
||||||
{
|
{
|
||||||
_logger.ErrorException(ex.Message, ex);
|
_logger.Error(ex, ex.Message);
|
||||||
throw new NzbDroneClientException(HttpStatusCode.Conflict, "Getting release from indexer failed");
|
throw new NzbDroneClientException(HttpStatusCode.Conflict, "Getting release from indexer failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ namespace Lidarr.Api.V3.Indexers
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.ErrorException("Album search failed: " + ex.Message, ex);
|
_logger.Error(ex, "Album search failed: " + ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new List<ReleaseResource>();
|
return new List<ReleaseResource>();
|
||||||
|
@ -113,8 +113,14 @@ namespace Lidarr.Api.V3.Indexers
|
||||||
|
|
||||||
protected override ReleaseResource MapDecision(DownloadDecision decision, int initialWeight)
|
protected override ReleaseResource MapDecision(DownloadDecision decision, int initialWeight)
|
||||||
{
|
{
|
||||||
_remoteAlbumCache.Set(decision.RemoteAlbum.Release.Guid, decision.RemoteAlbum, TimeSpan.FromMinutes(30));
|
var resource = base.MapDecision(decision, initialWeight);
|
||||||
return base.MapDecision(decision, initialWeight);
|
_remoteAlbumCache.Set(GetCacheKey(resource), decision.RemoteAlbum, TimeSpan.FromMinutes(30));
|
||||||
|
return resource;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetCacheKey(ReleaseResource resource)
|
||||||
|
{
|
||||||
|
return string.Concat(resource.IndexerId, "_", resource.Guid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using Moq;
|
using Moq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using NzbDrone.Common.Http;
|
using NzbDrone.Common.Http;
|
||||||
|
@ -253,12 +253,9 @@ namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase("BitMeTv/BitMeTv.xml")]
|
|
||||||
[TestCase("Fanzub/fanzub.xml")]
|
|
||||||
[TestCase("IPTorrents/IPTorrents.xml")]
|
[TestCase("IPTorrents/IPTorrents.xml")]
|
||||||
[TestCase("Newznab/newznab_nzb_su.xml")]
|
[TestCase("Newznab/newznab_nzb_su.xml")]
|
||||||
[TestCase("Nyaa/Nyaa.xml")]
|
[TestCase("Nyaa/Nyaa.xml")]
|
||||||
[TestCase("Omgwtfnzbs/Omgwtfnzbs.xml")]
|
|
||||||
[TestCase("Torznab/torznab_hdaccess_net.xml")]
|
[TestCase("Torznab/torznab_hdaccess_net.xml")]
|
||||||
[TestCase("Torznab/torznab_tpb.xml")]
|
[TestCase("Torznab/torznab_tpb.xml")]
|
||||||
public void should_detect_recent_feed(string rssXmlFile)
|
public void should_detect_recent_feed(string rssXmlFile)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue