mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-18 21:55:12 -04:00
Fixed: (PassThePopcorn) Generate titles for full discs
This commit is contained in:
@@ -37,6 +37,7 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn
|
|||||||
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 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn
|
|||||||
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 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn
|
|||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user