mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-27 12:33:00 +02:00
Fixed: (Orpheus) Add remaster title and year to release title
This commit is contained in:
@@ -24,7 +24,7 @@ namespace NzbDrone.Core.Test.IndexerTests.OrpheusTests
|
|||||||
Subject.Definition = new IndexerDefinition()
|
Subject.Definition = new IndexerDefinition()
|
||||||
{
|
{
|
||||||
Name = "Orpheus",
|
Name = "Orpheus",
|
||||||
Settings = new OrpheusSettings() { Apikey = "somekey" }
|
Settings = new OrpheusSettings { Apikey = "somekey" }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,14 +37,14 @@ namespace NzbDrone.Core.Test.IndexerTests.OrpheusTests
|
|||||||
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.Get), Subject.Definition))
|
.Setup(o => o.ExecuteProxiedAsync(It.Is<HttpRequest>(v => v.Method == HttpMethod.Get), Subject.Definition))
|
||||||
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader { { "Content-Type", "application/json" } }, new CookieCollection(), recentFeed)));
|
.Returns<HttpRequest, IndexerDefinition>((r, d) => Task.FromResult(new HttpResponse(r, new HttpHeader { { "Content-Type", "application/json" } }, new CookieCollection(), recentFeed)));
|
||||||
|
|
||||||
var releases = (await Subject.Fetch(new BasicSearchCriteria { Categories = new int[] { 2000 } })).Releases;
|
var releases = (await Subject.Fetch(new BasicSearchCriteria { Categories = new[] { 2000 } })).Releases;
|
||||||
|
|
||||||
releases.Should().HaveCount(65);
|
releases.Should().HaveCount(65);
|
||||||
releases.First().Should().BeOfType<GazelleInfo>();
|
releases.First().Should().BeOfType<GazelleInfo>();
|
||||||
|
|
||||||
var torrentInfo = releases.First() as GazelleInfo;
|
var torrentInfo = releases.First() as GazelleInfo;
|
||||||
|
|
||||||
torrentInfo.Title.Should().Be("The Beatles - Abbey Road (1969) [MP3 V2 (VBR)] [BD]");
|
torrentInfo.Title.Should().Be("The Beatles - Abbey Road (1969) [2.0 Mix 2019] [MP3 V2 (VBR)] [BD]");
|
||||||
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
|
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
|
||||||
torrentInfo.DownloadUrl.Should().Be("https://orpheus.network/ajax.php?action=download&id=1902448");
|
torrentInfo.DownloadUrl.Should().Be("https://orpheus.network/ajax.php?action=download&id=1902448");
|
||||||
torrentInfo.InfoUrl.Should().Be("https://orpheus.network/torrents.php?id=466&torrentid=1902448");
|
torrentInfo.InfoUrl.Should().Be("https://orpheus.network/torrents.php?id=466&torrentid=1902448");
|
||||||
|
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using NLog;
|
using NLog;
|
||||||
@@ -25,7 +24,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
public class Orpheus : TorrentIndexerBase<OrpheusSettings>
|
public class Orpheus : TorrentIndexerBase<OrpheusSettings>
|
||||||
{
|
{
|
||||||
public override string Name => "Orpheus";
|
public override string Name => "Orpheus";
|
||||||
public override string[] IndexerUrls => new string[] { "https://orpheus.network/" };
|
public override string[] IndexerUrls => new[] { "https://orpheus.network/" };
|
||||||
public override string Description => "Orpheus (APOLLO) is a Private Torrent Tracker for MUSIC";
|
public override string Description => "Orpheus (APOLLO) is a Private Torrent Tracker for MUSIC";
|
||||||
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
|
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
|
||||||
public override IndexerPrivacy Privacy => IndexerPrivacy.Private;
|
public override IndexerPrivacy Privacy => IndexerPrivacy.Private;
|
||||||
@@ -39,7 +38,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
|
|
||||||
public override IIndexerRequestGenerator GetRequestGenerator()
|
public override IIndexerRequestGenerator GetRequestGenerator()
|
||||||
{
|
{
|
||||||
return new OrpheusRequestGenerator() { Settings = Settings, Capabilities = Capabilities, HttpClient = _httpClient };
|
return new OrpheusRequestGenerator { Settings = Settings, Capabilities = Capabilities, HttpClient = _httpClient };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IParseIndexerResponse GetParser()
|
public override IParseIndexerResponse GetParser()
|
||||||
@@ -52,13 +51,13 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
var caps = new IndexerCapabilities
|
var caps = new IndexerCapabilities
|
||||||
{
|
{
|
||||||
MusicSearchParams = new List<MusicSearchParam>
|
MusicSearchParams = new List<MusicSearchParam>
|
||||||
{
|
{
|
||||||
MusicSearchParam.Q, MusicSearchParam.Album, MusicSearchParam.Artist, MusicSearchParam.Label, MusicSearchParam.Year
|
MusicSearchParam.Q, MusicSearchParam.Album, MusicSearchParam.Artist, MusicSearchParam.Label, MusicSearchParam.Year
|
||||||
},
|
},
|
||||||
BookSearchParams = new List<BookSearchParam>
|
BookSearchParams = new List<BookSearchParam>
|
||||||
{
|
{
|
||||||
BookSearchParam.Q
|
BookSearchParam.Q
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
caps.Categories.AddCategoryMapping(1, NewznabStandardCategory.Audio, "Music");
|
caps.Categories.AddCategoryMapping(1, NewznabStandardCategory.Audio, "Music");
|
||||||
@@ -121,10 +120,6 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
||||||
public IIndexerHttpClient HttpClient { get; set; }
|
public IIndexerHttpClient HttpClient { get; set; }
|
||||||
|
|
||||||
public OrpheusRequestGenerator()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public IndexerPageableRequestChain GetSearchRequests(MusicSearchCriteria searchCriteria)
|
public IndexerPageableRequestChain GetSearchRequests(MusicSearchCriteria searchCriteria)
|
||||||
{
|
{
|
||||||
var pageableRequests = new IndexerPageableRequestChain();
|
var pageableRequests = new IndexerPageableRequestChain();
|
||||||
@@ -260,24 +255,14 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
foreach (var torrent in result.Torrents)
|
foreach (var torrent in result.Torrents)
|
||||||
{
|
{
|
||||||
var id = torrent.TorrentId;
|
var id = torrent.TorrentId;
|
||||||
var artist = WebUtility.HtmlDecode(result.Artist);
|
|
||||||
var album = WebUtility.HtmlDecode(result.GroupName);
|
|
||||||
|
|
||||||
var title = $"{result.Artist} - {result.GroupName} ({result.GroupYear}) [{torrent.Format} {torrent.Encoding}] [{torrent.Media}]";
|
|
||||||
if (torrent.HasCue)
|
|
||||||
{
|
|
||||||
title += " [Cue]";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var title = GetTitle(result, torrent);
|
||||||
var infoUrl = GetInfoUrl(result.GroupId, id);
|
var infoUrl = GetInfoUrl(result.GroupId, id);
|
||||||
|
|
||||||
GazelleInfo release = new GazelleInfo()
|
var release = new GazelleInfo
|
||||||
{
|
{
|
||||||
Guid = infoUrl,
|
Guid = infoUrl,
|
||||||
|
|
||||||
// Splice Title from info to avoid calling API again for every torrent.
|
|
||||||
Title = WebUtility.HtmlDecode(title),
|
Title = WebUtility.HtmlDecode(title),
|
||||||
|
|
||||||
Container = torrent.Encoding,
|
Container = torrent.Encoding,
|
||||||
Codec = torrent.Format,
|
Codec = torrent.Format,
|
||||||
Size = long.Parse(torrent.Size),
|
Size = long.Parse(torrent.Size),
|
||||||
@@ -314,7 +299,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
var id = result.TorrentId;
|
var id = result.TorrentId;
|
||||||
var infoUrl = GetInfoUrl(result.GroupId, id);
|
var infoUrl = GetInfoUrl(result.GroupId, id);
|
||||||
|
|
||||||
GazelleInfo release = new GazelleInfo()
|
var release = new GazelleInfo
|
||||||
{
|
{
|
||||||
Guid = infoUrl,
|
Guid = infoUrl,
|
||||||
Title = WebUtility.HtmlDecode(result.GroupName),
|
Title = WebUtility.HtmlDecode(result.GroupName),
|
||||||
@@ -352,6 +337,25 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetTitle(GazelleRelease result, GazelleTorrent torrent)
|
||||||
|
{
|
||||||
|
var title = $"{result.Artist} - {result.GroupName} ({result.GroupYear})";
|
||||||
|
|
||||||
|
if (torrent.RemasterTitle.IsNotNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
title += $" [{string.Format("{0} {1}", torrent.RemasterTitle, torrent.RemasterYear).Trim()}]";
|
||||||
|
}
|
||||||
|
|
||||||
|
title += $" [{torrent.Format} {torrent.Encoding}] [{torrent.Media}]";
|
||||||
|
|
||||||
|
if (torrent.HasCue)
|
||||||
|
{
|
||||||
|
title += " [Cue]";
|
||||||
|
}
|
||||||
|
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
private string GetDownloadUrl(int torrentId, bool canUseToken)
|
private string GetDownloadUrl(int torrentId, bool canUseToken)
|
||||||
{
|
{
|
||||||
// AuthKey is required but not checked, just pass in a dummy variable
|
// AuthKey is required but not checked, just pass in a dummy variable
|
||||||
@@ -391,7 +395,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
|
|
||||||
public class OrpheusSettings : NoAuthTorrentBaseSettings
|
public class OrpheusSettings : NoAuthTorrentBaseSettings
|
||||||
{
|
{
|
||||||
private static readonly OrpheusSettingsValidator Validator = new OrpheusSettingsValidator();
|
private static readonly OrpheusSettingsValidator Validator = new ();
|
||||||
|
|
||||||
public OrpheusSettings()
|
public OrpheusSettings()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user