mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-06 08:34:28 +01:00
Fixed: (PassThePopcorn) Generate titles for full discs
This commit is contained in:
parent
98ee9c1703
commit
fbf4ff6777
2 changed files with 51 additions and 1 deletions
|
|
@ -37,6 +37,7 @@ public class PassThePopcornTorrent
|
||||||
public string Seeders { get; set; }
|
public string Seeders { get; set; }
|
||||||
public string Leechers { get; set; }
|
public string Leechers { get; set; }
|
||||||
public string ReleaseName { get; set; }
|
public string ReleaseName { get; set; }
|
||||||
|
public string ReleaseGroup { get; set; }
|
||||||
public bool Checked { get; set; }
|
public bool Checked { get; set; }
|
||||||
public bool GoldenPopcorn { get; set; }
|
public bool GoldenPopcorn { get; set; }
|
||||||
public string FreeleechType { get; set; }
|
public string FreeleechType { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
||||||
torrentInfos.Add(new TorrentInfo
|
torrentInfos.Add(new TorrentInfo
|
||||||
{
|
{
|
||||||
Guid = $"PassThePopcorn-{id}",
|
Guid = $"PassThePopcorn-{id}",
|
||||||
Title = title,
|
Title = GetTitle(torrent, result),
|
||||||
Year = int.Parse(result.Year),
|
Year = int.Parse(result.Year),
|
||||||
InfoUrl = GetInfoUrl(result.GroupId, id),
|
InfoUrl = GetInfoUrl(result.GroupId, id),
|
||||||
DownloadUrl = GetDownloadUrl(id),
|
DownloadUrl = GetDownloadUrl(id),
|
||||||
|
|
@ -119,6 +119,55 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
||||||
return torrentInfos;
|
return torrentInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string GetTitle(PassThePopcornTorrent torrent, PassThePopcornMovie result)
|
||||||
|
{
|
||||||
|
var title = torrent.ReleaseName;
|
||||||
|
|
||||||
|
if (torrent.Container.ToUpperInvariant() is "M2TS" or "ISO" or "VOB IFO" || !torrent.ReleaseName.Contains(result.Year))
|
||||||
|
{
|
||||||
|
title = $"{result.Title} ({result.Year})";
|
||||||
|
|
||||||
|
var titleTags = new List<string>();
|
||||||
|
|
||||||
|
if (torrent.Resolution.IsNotNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
titleTags.Add(torrent.Resolution);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (torrent.Source.IsNotNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
titleTags.Add(torrent.Source);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (torrent.Codec.IsNotNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
titleTags.Add(torrent.Codec);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (torrent.Container.IsNotNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
titleTags.Add(torrent.Container.ToUpperInvariant());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (torrent.RemasterTitle.IsNotNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
titleTags.Add(torrent.RemasterTitle);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (titleTags.Any())
|
||||||
|
{
|
||||||
|
title += $" {string.Join(" / ", titleTags)}";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (torrent.ReleaseGroup.IsNotNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
title += $" -{torrent.ReleaseGroup}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
||||||
|
|
||||||
private string GetDownloadUrl(int torrentId)
|
private string GetDownloadUrl(int torrentId)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue