Use info urls as guid and add remaster name to title for SecretCinema

pull/2098/head
Bogdan 1 month ago
parent 6a9e27bc06
commit fe35d450f0

@ -104,6 +104,7 @@ public class SecretCinemaParser : IParseIndexerResponse
foreach (var torrent in result.Torrents) foreach (var torrent in result.Torrents)
{ {
var id = torrent.TorrentId; var id = torrent.TorrentId;
var infoUrl = GetInfoUrl(result.GroupId, id);
// in SC movies, artist=director and GroupName=title // in SC movies, artist=director and GroupName=title
var artist = WebUtility.HtmlDecode(result.Artist); var artist = WebUtility.HtmlDecode(result.Artist);
@ -112,8 +113,8 @@ public class SecretCinemaParser : IParseIndexerResponse
var release = new TorrentInfo var release = new TorrentInfo
{ {
Guid = $"SecretCinema-{id}", Guid = infoUrl,
InfoUrl = GetInfoUrl(result.GroupId, id), InfoUrl = infoUrl,
DownloadUrl = GetDownloadUrl(id), DownloadUrl = GetDownloadUrl(id),
Title = title, Title = title,
Container = torrent.Encoding, Container = torrent.Encoding,
@ -143,7 +144,12 @@ public class SecretCinemaParser : IParseIndexerResponse
{ {
// Remove director from title // Remove director from title
// SC API returns no more useful information than this // 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 // Replace media formats with standards
release.Title = Regex.Replace(release.Title, @"\bBDMV\b", "COMPLETE BLURAY", RegexOptions.IgnoreCase); release.Title = Regex.Replace(release.Title, @"\bBDMV\b", "COMPLETE BLURAY", RegexOptions.IgnoreCase);
@ -168,12 +174,13 @@ public class SecretCinemaParser : IParseIndexerResponse
else else
{ {
var id = result.TorrentId; var id = result.TorrentId;
var infoUrl = GetInfoUrl(result.GroupId, id);
var groupName = WebUtility.HtmlDecode(result.GroupName); var groupName = WebUtility.HtmlDecode(result.GroupName);
var release = new TorrentInfo var release = new TorrentInfo
{ {
Guid = $"SecretCinema-{id}", Guid = infoUrl,
InfoUrl = GetInfoUrl(result.GroupId, id), InfoUrl = infoUrl,
DownloadUrl = GetDownloadUrl(id), DownloadUrl = GetDownloadUrl(id),
Title = groupName, Title = groupName,
Size = long.Parse(result.Size), Size = long.Parse(result.Size),
@ -209,7 +216,7 @@ public class SecretCinemaParser : IParseIndexerResponse
private bool IsAnyMovieCategory(ICollection<IndexerCategory> category) private bool IsAnyMovieCategory(ICollection<IndexerCategory> 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) private string GetDownloadUrl(int torrentId)

Loading…
Cancel
Save