From fe35d450f093e0b29960ac579751ed5f16fe80fe Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sat, 6 Apr 2024 21:36:58 +0300 Subject: [PATCH] Use info urls as guid and add remaster name to title for SecretCinema --- .../Indexers/Definitions/SecretCinema.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/SecretCinema.cs b/src/NzbDrone.Core/Indexers/Definitions/SecretCinema.cs index 1daa4b4f8..1950974c0 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/SecretCinema.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/SecretCinema.cs @@ -104,6 +104,7 @@ public class SecretCinemaParser : IParseIndexerResponse foreach (var torrent in result.Torrents) { var id = torrent.TorrentId; + var infoUrl = GetInfoUrl(result.GroupId, id); // in SC movies, artist=director and GroupName=title var artist = WebUtility.HtmlDecode(result.Artist); @@ -112,8 +113,8 @@ public class SecretCinemaParser : IParseIndexerResponse var release = new TorrentInfo { - Guid = $"SecretCinema-{id}", - InfoUrl = GetInfoUrl(result.GroupId, id), + Guid = infoUrl, + InfoUrl = infoUrl, DownloadUrl = GetDownloadUrl(id), Title = title, Container = torrent.Encoding, @@ -143,7 +144,12 @@ public class SecretCinemaParser : IParseIndexerResponse { // Remove director from title // SC API returns no more useful information than this - release.Title = $"{title} ({result.GroupYear}) {torrent.Media}"; + release.Title = $"{title} ({result.GroupYear}) {torrent.Media}".Trim(); + + if (torrent.RemasterTitle.IsNotNullOrWhiteSpace()) + { + release.Title += $" [{torrent.RemasterTitle.Trim()}]"; + } // Replace media formats with standards release.Title = Regex.Replace(release.Title, @"\bBDMV\b", "COMPLETE BLURAY", RegexOptions.IgnoreCase); @@ -168,12 +174,13 @@ public class SecretCinemaParser : IParseIndexerResponse else { var id = result.TorrentId; + var infoUrl = GetInfoUrl(result.GroupId, id); var groupName = WebUtility.HtmlDecode(result.GroupName); var release = new TorrentInfo { - Guid = $"SecretCinema-{id}", - InfoUrl = GetInfoUrl(result.GroupId, id), + Guid = infoUrl, + InfoUrl = infoUrl, DownloadUrl = GetDownloadUrl(id), Title = groupName, Size = long.Parse(result.Size), @@ -209,7 +216,7 @@ public class SecretCinemaParser : IParseIndexerResponse private bool IsAnyMovieCategory(ICollection category) { - return category.Contains(NewznabStandardCategory.Movies) || NewznabStandardCategory.Movies.SubCategories.Any(subCat => category.Contains(subCat)); + return category.Contains(NewznabStandardCategory.Movies) || NewznabStandardCategory.Movies.SubCategories.Any(category.Contains); } private string GetDownloadUrl(int torrentId)