From 2648f2c639cbb4744b174b8abc82d9b2e142370e Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 6 Jan 2025 12:50:55 +0200 Subject: [PATCH] Fixed: (BTN) Improve M2TS and ISO titles for BR-DISK detection --- .../BroadcastheNet/BroadcastheNetParser.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/BroadcastheNet/BroadcastheNetParser.cs b/src/NzbDrone.Core/Indexers/Definitions/BroadcastheNet/BroadcastheNetParser.cs index 394fed9ad..60c2c0a58 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/BroadcastheNet/BroadcastheNetParser.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/BroadcastheNet/BroadcastheNetParser.cs @@ -88,7 +88,7 @@ public IList ParseResponse(IndexerResponse indexerResponse) Guid = $"BTN-{torrent.TorrentID}", InfoUrl = $"{protocol}//broadcasthe.net/torrents.php?id={torrent.GroupID}&torrentid={torrent.TorrentID}", DownloadUrl = RegexProtocol.Replace(torrent.DownloadURL, protocol), - Title = CleanReleaseName(torrent.ReleaseName), + Title = GetTitle(torrent), Categories = _categories.MapTrackerCatToNewznab(torrent.Resolution), InfoHash = torrent.InfoHash, Size = torrent.Size, @@ -136,9 +136,17 @@ public IList ParseResponse(IndexerResponse indexerResponse) return releaseInfos; } - private string CleanReleaseName(string releaseName) + private static string GetTitle(BroadcastheNetTorrent torrent) { - return releaseName.Replace("\\", ""); + var releaseName = torrent.ReleaseName.Replace("\\", ""); + + if (torrent.Container.ToUpperInvariant() is "M2TS" or "ISO") + { + releaseName = Regex.Replace(releaseName, @"\b(H\.?265)\b", "HEVC", RegexOptions.Compiled); + releaseName = Regex.Replace(releaseName, @"\b(H\.?264)\b", "AVC", RegexOptions.Compiled); + } + + return releaseName; } } }