morethantv: try to provide default quality #5334

This commit is contained in:
Garfield69
2019-05-26 19:28:52 +12:00
parent c15d6468d2
commit f7fcc614f7

View File

@@ -158,10 +158,23 @@ namespace Jackett.Common.Indexers
// Parse required data
var downloadAnchor = groupItem.QuerySelectorAll("td a").Last();
var qualityData = downloadAnchor.InnerHtml.Split('/');
if (qualityData.Length < 2)
throw new Exception($"We expected 2 or more quality datas, instead we have {qualityData.Length} for {season}.");
switch (qualityData.Length)
{
case 0:
Array.Resize(ref qualityData, 2);
qualityData[0] = " ";
qualityData[1] = " ";
break;
case 1:
Array.Resize(ref qualityData, 2);
qualityData[1] = " ";
break;
default:
break;
}
// Build title
var title = string.Join(".", new List<string>
{