Fixed: Grab ImdbId and TmdbId from Rarbg results

pull/5870/head
Qstick 4 years ago
parent 70e4324a7c
commit 8831fd7b50

@ -27,13 +27,9 @@ namespace NzbDrone.Api.Indexers
public string ReleaseHash { get; set; }
public string Edition { get; set; }
public string Title { get; set; }
public bool FullSeason { get; set; }
public int SeasonNumber { get; set; }
public List<Language> Languages { get; set; }
public int Year { get; set; }
public string MovieTitle { get; set; }
public int[] EpisodeNumbers { get; set; }
public int[] AbsoluteEpisodeNumbers { get; set; }
public bool Approved { get; set; }
public bool TemporarilyRejected { get; set; }
public bool Rejected { get; set; }
@ -111,8 +107,6 @@ namespace NzbDrone.Api.Indexers
Approved = model.Approved,
TemporarilyRejected = model.TemporarilyRejected,
Rejected = model.Rejected,
TvdbId = releaseInfo.TvdbId,
TvRageId = releaseInfo.TvRageId,
Rejections = model.Rejections.Select(r => r.Reason).ToList(),
PublishDate = releaseInfo.PublishDate,
CommentUrl = releaseInfo.CommentUrl,
@ -163,8 +157,6 @@ namespace NzbDrone.Api.Indexers
model.IndexerId = resource.IndexerId;
model.Indexer = resource.Indexer;
model.DownloadProtocol = resource.DownloadProtocol;
model.TvdbId = resource.TvdbId;
model.TvRageId = resource.TvRageId;
model.PublishDate = resource.PublishDate;
return model;

@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using FluentAssertions;
using Moq;
@ -119,8 +119,7 @@ namespace NzbDrone.Core.Test.IndexerTests.TorznabTests
releaseInfo.Indexer.Should().Be(Subject.Definition.Name);
releaseInfo.PublishDate.Should().Be(DateTime.Parse("Wed, 17 May 2017 20:36:06 +0000").ToUniversalTime());
releaseInfo.Size.Should().Be(316477946);
releaseInfo.TvdbId.Should().Be(0);
releaseInfo.TvRageId.Should().Be(0);
releaseInfo.TmdbId.Should().Be(0);
releaseInfo.InfoHash.Should().Be("2d69a861bef5a9f2cdf791b7328e37b7953205e1");
releaseInfo.Seeders.Should().BeNull();
releaseInfo.Peers.Should().BeNull();

@ -150,8 +150,7 @@ namespace NzbDrone.Core.History
history.Data.Add("Size", message.Movie.Release.Size.ToString());
history.Data.Add("DownloadUrl", message.Movie.Release.DownloadUrl);
history.Data.Add("Guid", message.Movie.Release.Guid);
history.Data.Add("TvdbId", message.Movie.Release.TvdbId.ToString());
history.Data.Add("TvRageId", message.Movie.Release.TvRageId.ToString());
history.Data.Add("TmdbId", message.Movie.Release.TmdbId.ToString());
history.Data.Add("Protocol", ((int)message.Movie.Release.DownloadProtocol).ToString());
history.Data.Add("IndexerFlags", message.Movie.Release.IndexerFlags.ToString());
history.Data.Add("IndexerId", message.Movie.Release.IndexerId.ToString());

@ -59,16 +59,16 @@ namespace NzbDrone.Core.Indexers.Rarbg
torrentInfo.Seeders = torrent.seeders;
torrentInfo.Peers = torrent.leechers + torrent.seeders;
if (torrent.movie_info != null)
if (torrent.episode_info != null)
{
if (torrent.movie_info.tvdb != null)
if (torrent.episode_info.imdb != null)
{
torrentInfo.TvdbId = torrent.movie_info.tvdb.Value;
torrentInfo.ImdbId = int.Parse(torrent.episode_info.imdb.Substring(2));
}
if (torrent.movie_info.tvrage != null)
if (torrent.episode_info.themoviedb != null)
{
torrentInfo.TvRageId = torrent.movie_info.tvrage.Value;
torrentInfo.TmdbId = torrent.episode_info.themoviedb.Value;
}
}

@ -19,7 +19,9 @@ namespace NzbDrone.Core.Indexers.Rarbg
public int? leechers { get; set; }
public long size { get; set; }
public DateTime pubdate { get; set; }
public RarbgTorrentInfo movie_info { get; set; }
//This is named episode_info for movies as well as shows
public RarbgTorrentInfo episode_info { get; set; }
public int? ranked { get; set; }
public string info_page { get; set; }
}
@ -29,5 +31,6 @@ namespace NzbDrone.Core.Indexers.Rarbg
public string imdb { get; set; }
public int? tvrage { get; set; }
public int? tvdb { get; set; }
public int? themoviedb { get; set; }
}
}

@ -1,4 +1,4 @@
using System;
using System;
using System.Text;
using NzbDrone.Core.Indexers;
@ -16,8 +16,7 @@ namespace NzbDrone.Core.Parser.Model
public string Indexer { get; set; }
public int IndexerPriority { get; set; }
public DownloadProtocol DownloadProtocol { get; set; }
public int TvdbId { get; set; }
public int TvRageId { get; set; }
public int TmdbId { get; set; }
public int ImdbId { get; set; }
public DateTime PublishDate { get; set; }
@ -75,8 +74,7 @@ namespace NzbDrone.Core.Parser.Model
stringBuilder.AppendLine("Indexer: " + Indexer ?? "Empty");
stringBuilder.AppendLine("CommentUrl: " + CommentUrl ?? "Empty");
stringBuilder.AppendLine("DownloadProtocol: " + DownloadProtocol ?? "Empty");
stringBuilder.AppendLine("TvdbId: " + TvdbId ?? "Empty");
stringBuilder.AppendLine("TvRageId: " + TvRageId ?? "Empty");
stringBuilder.AppendLine("TmdbId: " + TmdbId ?? "Empty");
stringBuilder.AppendLine("ImdbId: " + ImdbId ?? "Empty");
stringBuilder.AppendLine("PublishDate: " + PublishDate ?? "Empty");
return stringBuilder.ToString();

@ -35,6 +35,7 @@ namespace Radarr.Api.V3.Indexers
public bool Approved { get; set; }
public bool TemporarilyRejected { get; set; }
public bool Rejected { get; set; }
public int TmdbId { get; set; }
public int ImdbId { get; set; }
public IEnumerable<string> Rejections { get; set; }
public DateTime PublishDate { get; set; }
@ -90,6 +91,7 @@ namespace Radarr.Api.V3.Indexers
Approved = model.Approved,
TemporarilyRejected = model.TemporarilyRejected,
Rejected = model.Rejected,
TmdbId = releaseInfo.TmdbId,
ImdbId = releaseInfo.ImdbId,
Rejections = model.Rejections.Select(r => r.Reason).ToList(),
PublishDate = releaseInfo.PublishDate,
@ -137,6 +139,7 @@ namespace Radarr.Api.V3.Indexers
model.IndexerId = resource.IndexerId;
model.Indexer = resource.Indexer;
model.DownloadProtocol = resource.Protocol;
model.TmdbId = resource.TmdbId;
model.ImdbId = resource.ImdbId;
model.PublishDate = resource.PublishDate.ToUniversalTime();

Loading…
Cancel
Save