New: (AvistaZ) Parse Languages and Subs, pass in response

#694
pull/1056/head
Qstick 2 years ago
parent 09ed132fe6
commit 4dee1d65d1

@ -60,6 +60,10 @@ namespace NzbDrone.Core.Test.IndexerTests.AvistazTests
torrentInfo.ImdbId.Should().Be(15569106);
torrentInfo.TmdbId.Should().Be(135144);
torrentInfo.TvdbId.Should().Be(410548);
torrentInfo.Languages.Should().HaveCount(1);
torrentInfo.Languages.First().Should().Be("Japanese");
torrentInfo.Subs.Should().HaveCount(27);
torrentInfo.Subs.First().Should().Be("Arabic");
}
}
}

@ -90,8 +90,8 @@ namespace NzbDrone.Core.IndexerSearch
new XAttribute("type", protocol == DownloadProtocol.Torrent ? "application/x-bittorrent" : "application/x-nzb")),
r.Categories == null ? null : from c in r.Categories select GetNabElement("category", c.Id, protocol),
r.IndexerFlags == null ? null : from f in r.IndexerFlags select GetNabElement("tag", f.Name, protocol),
r.Languages == null ? null : from c in r.Languages select GetNabElement("language", c.Id, protocol),
r.Subs == null ? null : from c in r.Subs select GetNabElement("subs", c.Id, protocol),
r.Languages == null ? null : from c in r.Languages select GetNabElement("language", c, protocol),
r.Subs == null ? null : from c in r.Subs select GetNabElement("subs", c, protocol),
r.Genres == null ? null : GetNabElement("genre", string.Join(", ", r.Genres), protocol),
GetNabElement("rageid", r.TvRageId, protocol),
GetNabElement("tvdbid", r.TvdbId, protocol),

@ -40,6 +40,14 @@ namespace NzbDrone.Core.Indexers.Definitions.Avistaz
[JsonProperty(PropertyName = "video_quality")]
public string VideoQuality { get; set; }
public string Type { get; set; }
public List<AvistazLanguage> Audio { get; set; }
public List<AvistazLanguage> Subtitle { get; set; }
}
public class AvistazLanguage
{
public int Id { get; set; }
public string Language { get; set; }
}
public class AvistazResponse

@ -66,6 +66,8 @@ namespace NzbDrone.Core.Indexers.Definitions.Avistaz
UploadVolumeFactor = row.UploadMultiply,
MinimumRatio = 1,
MinimumSeedTime = 172800, // 48 hours
Languages = row.Audio?.Select(x => x.Language).ToList() ?? new List<string>(),
Subs = row.Subtitle?.Select(x => x.Language).ToList() ?? new List<string>()
};
if (row.MovieTvinfo != null)

@ -13,6 +13,8 @@ namespace NzbDrone.Core.Parser.Model
{
IndexerFlags = new List<IndexerFlag>();
Categories = new List<IndexerCategory>();
Languages = new List<string>();
Subs = new List<string>();
}
public string Guid { get; set; }
@ -49,8 +51,8 @@ namespace NzbDrone.Core.Parser.Model
public string Codec { get; set; }
public string Resolution { get; set; }
public ICollection<string> Genres { get; set; }
public ICollection<Language> Languages { get; set; }
public ICollection<Language> Subs { get; set; }
public ICollection<string> Languages { get; set; }
public ICollection<string> Subs { get; set; }
public ICollection<IndexerCategory> Categories { get; set; }
public ICollection<IndexerFlag> IndexerFlags { get; set; }

Loading…
Cancel
Save