Fixed: (BTN) Improve M2TS and ISO titles for BR-DISK detection

This commit is contained in:
Bogdan 2025-01-06 12:50:55 +02:00
parent f4d621063b
commit 2648f2c639

View file

@ -88,7 +88,7 @@ public IList<ReleaseInfo> 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<ReleaseInfo> 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;
}
}
}