From e12cd68772c488bc269f524ec0feb70be34164c2 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 29 Nov 2023 08:18:24 +0200 Subject: [PATCH] Fixed: (RED/OPS) Add log score to release titles --- .../IndexerTests/OrpheusTests/OrpheusFixture.cs | 2 +- .../IndexerTests/RedactedTests/RedactedFixture.cs | 2 +- src/NzbDrone.Core/Indexers/Definitions/Orpheus.cs | 15 ++++++++++++--- .../Indexers/Definitions/Redacted.cs | 15 ++++++++++++--- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/NzbDrone.Core.Test/IndexerTests/OrpheusTests/OrpheusFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/OrpheusTests/OrpheusFixture.cs index 1ba9c0af1..e324ced6b 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/OrpheusTests/OrpheusFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/OrpheusTests/OrpheusFixture.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Core.Test.IndexerTests.OrpheusTests var torrentInfo = releases.First() as TorrentInfo; - torrentInfo.Title.Should().Be("The Beatles - Abbey Road [1969] [Album] [2.0 Mix 2019] [MP3 V2 (VBR)] [BD]"); + torrentInfo.Title.Should().Be("The Beatles - Abbey Road [1969] [Album] [2.0 Mix 2019] [MP3 V2 (VBR) / BD]"); torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent); 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"); diff --git a/src/NzbDrone.Core.Test/IndexerTests/RedactedTests/RedactedFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/RedactedTests/RedactedFixture.cs index 7a7cc836f..0b1b79563 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/RedactedTests/RedactedFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/RedactedTests/RedactedFixture.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Core.Test.IndexerTests.RedactedTests var torrentInfo = releases.First() as TorrentInfo; - torrentInfo.Title.Should().Be("Red Hot Chili Peppers - Californication [1999] [Album] [US / Reissue 2020] [FLAC 24bit Lossless] [Vinyl]"); + torrentInfo.Title.Should().Be("Red Hot Chili Peppers - Californication [1999] [Album] [US / Reissue 2020] [FLAC 24bit Lossless / Vinyl]"); torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent); torrentInfo.DownloadUrl.Should().Be("https://redacted.ch/ajax.php?action=download&id=3892313"); torrentInfo.InfoUrl.Should().Be("https://redacted.ch/torrents.php?id=16720&torrentid=3892313"); diff --git a/src/NzbDrone.Core/Indexers/Definitions/Orpheus.cs b/src/NzbDrone.Core/Indexers/Definitions/Orpheus.cs index c8513296e..7fd1b94b7 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Orpheus.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Orpheus.cs @@ -374,14 +374,23 @@ namespace NzbDrone.Core.Indexers.Definitions title += $" [{$"{torrent.RemasterTitle} {torrent.RemasterYear}".Trim()}]"; } - title += $" [{torrent.Format} {torrent.Encoding}] [{torrent.Media}]"; + var flags = new List + { + $"{torrent.Format} {torrent.Encoding}", + $"{torrent.Media}" + }; + + if (torrent.HasLog) + { + flags.Add("Log (" + torrent.LogScore + "%)"); + } if (torrent.HasCue) { - title += " [Cue]"; + flags.Add("Cue"); } - return title; + return $"{title} [{string.Join(" / ", flags)}]"; } private string GetDownloadUrl(int torrentId, bool canUseToken) diff --git a/src/NzbDrone.Core/Indexers/Definitions/Redacted.cs b/src/NzbDrone.Core/Indexers/Definitions/Redacted.cs index a3c5356cb..e73e1ead6 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Redacted.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Redacted.cs @@ -357,14 +357,23 @@ namespace NzbDrone.Core.Indexers.Definitions title += $" [{$"{torrent.RemasterTitle} {torrent.RemasterYear}".Trim()}]"; } - title += $" [{torrent.Format} {torrent.Encoding}] [{torrent.Media}]"; + var flags = new List + { + $"{torrent.Format} {torrent.Encoding}", + $"{torrent.Media}" + }; + + if (torrent.HasLog) + { + flags.Add("Log (" + torrent.LogScore + "%)"); + } if (torrent.HasCue) { - title += " [Cue]"; + flags.Add("Cue"); } - return title; + return $"{title} [{string.Join(" / ", flags)}]"; } private string GetDownloadUrl(int torrentId, bool canUseToken)