1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 10:32:35 +01:00

New: Newznab will show indexer name and logo when possible.

This commit is contained in:
Mark McDowall 2012-05-08 14:29:24 -07:00
parent ba3b034a3c
commit f26ef627df
6 changed files with 14 additions and 3 deletions

View File

@ -199,7 +199,7 @@ private List<EpisodeParseResult> Fetch(IEnumerable<string> urls)
{
parsedEpisode.NzbUrl = NzbDownloadUrl(item);
parsedEpisode.NzbInfoUrl = NzbInfoUrl(item);
parsedEpisode.Indexer = Name;
parsedEpisode.Indexer = String.IsNullOrWhiteSpace(parsedEpisode.Indexer) ? Name : parsedEpisode.Indexer;
result.Add(parsedEpisode);
}
}

View File

@ -85,6 +85,8 @@ protected override EpisodeParseResult CustomParser(SyndicationItem item, Episode
{
if (item.Links.Count > 1)
currentResult.Size = item.Links[1].Length;
currentResult.Indexer = GetName(item);
}
return currentResult;
@ -107,5 +109,11 @@ private string[] GetUrls()
return urls.ToArray();
}
private string GetName(SyndicationItem item)
{
var hostname = item.Links[0].Uri.DnsSafeHost.ToLower();
return String.Format("{0}_{1}", Name, hostname);
}
}
}

View File

Before

Width:  |  Height:  |  Size: 198 B

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

View File

@ -166,7 +166,7 @@
<Content Include="Content\Images\Indexers\Newznab.png" />
<Content Include="Content\Images\Indexers\NzbClub.png" />
<Content Include="Content\Images\Indexers\NzbIndex.png" />
<Content Include="Content\Images\Indexers\Nzbs.org.png" />
<Content Include="Content\Images\Indexers\Newznab_Nzbs.org.png" />
<Content Include="Content\Images\Indexers\WomblesIndex.png" />
<Content Include="Content\Images\logo.png" />
<Content Include="Content\Images\logo_small.png" />

View File

@ -62,6 +62,9 @@
sWidth: '20px', "bSortable": false, "mDataProp": function (source, type, val) {
// 'display' and 'filter' use the image
if (type === 'display' || type === 'filter') {
if (source['Indexer'].indexOf("Newznab") === 0)
return "<img src='/Content/Images/Indexers/" + source['Indexer'] + ".png' alt='" + source["Indexer"].replace('_', ' - ') + "' title='" + source["Indexer"].replace('_', ' - ') + "' onerror='this.src=\"/Content/Images/Indexers/Newznab.png\"'>";
return "<img src='/Content/Images/Indexers/" + source['Indexer'] + ".png' alt='" + source["Indexer"] + "' title='" + source["Indexer"] + "'>";
}
// 'sort' and 'type' both just use the raw data
@ -105,7 +108,7 @@
var result = "<b>Overview: </b>" + row.aData["EpisodeOverview"] + "<br/>" +
"<b>NZB Title: </b>" + row.aData["NzbTitle"] + "<br/>" +
"<b>Proper: </b>" + row.aData["IsProper"] + "<br/>" +
"<b>Indexer: </b>" + row.aData["Indexer"];
"<b>Indexer: </b>" + row.aData["Indexer"].replace('_', ' - ');
if (row.aData["NzbInfoUrl"] != null && row.aData["NzbInfoUrl"] != "")
result += "<br/><b>Nzb Details: </b> <a href=\"" + row.aData["NzbInfoUrl"] + "\" target=\"_blank\">Details</a>";