mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
broadcasthenet: improve M2TS and ISO titles for BR-DISK detection
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Jackett.Common.Extensions;
|
using Jackett.Common.Extensions;
|
||||||
using Jackett.Common.Models;
|
using Jackett.Common.Models;
|
||||||
@@ -307,7 +308,7 @@ namespace Jackett.Common.Indexers.Definitions
|
|||||||
Guid = link,
|
Guid = link,
|
||||||
Details = details,
|
Details = details,
|
||||||
Link = link,
|
Link = link,
|
||||||
Title = btnResult.ReleaseName,
|
Title = GetTitle(btnResult),
|
||||||
Description = string.Join("<br />\n", descriptions),
|
Description = string.Join("<br />\n", descriptions),
|
||||||
Category = _categories.MapTrackerCatToNewznab(btnResult.Resolution),
|
Category = _categories.MapTrackerCatToNewznab(btnResult.Resolution),
|
||||||
InfoHash = btnResult.InfoHash,
|
InfoHash = btnResult.InfoHash,
|
||||||
@@ -347,6 +348,19 @@ namespace Jackett.Common.Indexers.Definitions
|
|||||||
|
|
||||||
return releases;
|
return releases;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string GetTitle(BroadcastheNetTorrent torrent)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BroadcastheNetSearchQuery
|
public class BroadcastheNetSearchQuery
|
||||||
|
Reference in New Issue
Block a user