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

pull/2/head
Mark McDowall 13 years ago
parent ba3b034a3c
commit f26ef627df

@ -199,7 +199,7 @@ namespace NzbDrone.Core.Providers.Indexer
{
parsedEpisode.NzbUrl = NzbDownloadUrl(item);
parsedEpisode.NzbInfoUrl = NzbInfoUrl(item);
parsedEpisode.Indexer = Name;
parsedEpisode.Indexer = String.IsNullOrWhiteSpace(parsedEpisode.Indexer) ? Name : parsedEpisode.Indexer;
result.Add(parsedEpisode);
}
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

@ -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" />

@ -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>";

Loading…
Cancel
Save