Skip to content

Commit

Permalink
Add rageid, tvdbid, tvmazeid, and imdb(id) to base newzsnab indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
Celsiusss committed Apr 15, 2024
1 parent 829b986 commit ef72f26
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
13 changes: 11 additions & 2 deletions src/Jackett.Common/Indexers/Feeds/BaseNewznabIndexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ protected virtual ReleaseInfo ResultFromFeedItem(XElement item)
categoryids = new List<int> { int.Parse(categories.Last(e => !string.IsNullOrEmpty(e.Value)).Value) };
else
categoryids = new List<int> { int.Parse(attributes.First(e => e.Attribute("name").Value == "category").Attribute("value").Value) };
var imdbId = long.TryParse(ReadAttribute(attributes, "imdb"), out longVal) ? (long?)longVal : null;
var imdb = long.TryParse(ReadAttribute(attributes, "imdb"), out longVal) ? (long?)longVal : null;
var imdbId = ReadAttribute(attributes, "imdbid");
if (imdb == null && imdbId.StartsWith("tt"))
imdb = long.TryParse(imdbId.Substring(2), out longVal) ? (long?)longVal : null;
var rageId = long.TryParse(ReadAttribute(attributes, "rageid"), out longVal) ? (long?)longVal : null;
var tvdbId = long.TryParse(ReadAttribute(attributes, "tvdbid"), out longVal) ? (long?)longVal : null;
var tvMazeid = long.TryParse(ReadAttribute(attributes, "tvmazeid"), out longVal) ? (long?)longVal : null;

var release = new ReleaseInfo
{
Expand All @@ -84,7 +90,10 @@ protected virtual ReleaseInfo ResultFromFeedItem(XElement item)
InfoHash = attributes.First(e => e.Attribute("name").Value == "infohash").Attribute("value").Value,
DownloadVolumeFactor = downloadvolumefactor,
UploadVolumeFactor = uploadvolumefactor,
Imdb = imdbId
Imdb = imdb,
RageID = rageId,
TVDBId = tvdbId,
TVMazeId = tvMazeid
};
if (magneturi != null)
release.MagnetUri = magneturi;
Expand Down
5 changes: 0 additions & 5 deletions src/Jackett.Common/Indexers/Feeds/MoreThanTVAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,6 @@ protected override ReleaseInfo ResultFromFeedItem(XElement item)
var enclosureUrl = enclosure.Attribute("url").Value;
release.Link = new Uri(enclosureUrl);
}
// custom provider IDs
var attributes = item.Descendants().Where(e => e.Name.LocalName == "attr");
release.TVDBId = long.TryParse(ReadAttribute(attributes, "tvdbid"), out var longVal) ? (long?)longVal : null;
release.TVMazeId = long.TryParse(ReadAttribute(attributes, "tvmazeid"), out longVal) ? (long?)longVal : null;

// add some default values if none returned by feed
release.Seeders = release.Seeders > 0 ? release.Seeders : 0;
release.Peers = release.Peers > 0 ? release.Peers : 0;
Expand Down

0 comments on commit ef72f26

Please sign in to comment.