core: add missing torznab attributes. resolves #10118 (#10122)

* add coverurl
* rename tvdb and tmdb
This commit is contained in:
Diego Heras 2020-11-06 22:03:25 +01:00 committed by GitHub
parent 9378cf84ad
commit 2cf78fe4fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -99,20 +99,22 @@ namespace Jackett.Common.Models
new XAttribute("type", "application/x-bittorrent")
),
r.Category == null ? null : from c in r.Category select GetTorznabElement("category", c),
GetTorznabElement("magneturl", r.MagnetUri?.AbsoluteUri),
GetTorznabElement("rageid", r.RageID),
GetTorznabElement("thetvdb", r.TVDBId),
GetTorznabElement("imdb", r.Imdb?.ToString("D7")),
GetTorznabElement("tmdb", r.TMDb),
GetTorznabElement("imdbid", r.Imdb != null ? "tt" + r.Imdb?.ToString("D7") : null),
GetTorznabElement("rageid", r.RageID),
GetTorznabElement("tvdbid", r.TVDBId),
GetTorznabElement("tmdbid", r.TMDb),
GetTorznabElement("author", RemoveInvalidXMLChars(r.Author)),
GetTorznabElement("booktitle", RemoveInvalidXMLChars(r.BookTitle)),
GetTorznabElement("seeders", r.Seeders),
GetTorznabElement("peers", r.Peers),
GetTorznabElement("magneturl", r.MagnetUri?.AbsoluteUri),
GetTorznabElement("infohash", RemoveInvalidXMLChars(r.InfoHash)),
GetTorznabElement("minimumratio", r.MinimumRatio),
GetTorznabElement("minimumseedtime", r.MinimumSeedTime),
GetTorznabElement("downloadvolumefactor", r.DownloadVolumeFactor),
GetTorznabElement("uploadvolumefactor", r.UploadVolumeFactor)
GetTorznabElement("uploadvolumefactor", r.UploadVolumeFactor),
GetTorznabElement("coverurl", r.BannerUrl?.AbsoluteUri)
)
)
)

View File

@ -74,7 +74,7 @@ namespace Jackett.Test.Common.Models
var xml = resultPage.ToXml(link);
Assert.AreEqual(5, Regex.Matches(xml, validText).Count);
Assert.AreEqual(9, Regex.Matches(xml, validLink).Count);
Assert.AreEqual(10, Regex.Matches(xml, validLink).Count);
// this should be in another test but it's here to avoid creating the whole object again
Assert.True(xml.Contains("Tue, 22 Sep 2020 00:00:00 "));