Added: More logging for strange PTP errors. Please report them immediately when you see them.

This commit is contained in:
Leonardo Galli 2018-04-17 01:21:14 +02:00
parent c592fbf6c8
commit 2782d19191
3 changed files with 58 additions and 28 deletions

View File

@ -1035,6 +1035,7 @@
<e p="HttpUriConverter.cs" t="Include" />
<e p="IntConverter.cs" t="Include" />
<e p="JSON.cs" t="Include" />
<e p="UnderscoreStringEnumConverter.cs" t="Include" />
</e>
<e p="ServiceFactory.cs" t="Include" />
<e p="ServiceProvider.cs" t="Include" />
@ -1330,6 +1331,8 @@
<e p="142_movie_extras.cs" t="Include" />
<e p="143_clean_core_tv.cs" t="Include" />
<e p="144_add_cookies_to_indexer_status.cs" t="Include" />
<e p="145_banner_to_fanart.cs" t="Include" />
<e p="146_naming_config_colon_replacement_format.cs" t="Include" />
<e p="Framework" t="Include">
<e p="MigrationContext.cs" t="Include" />
<e p="MigrationController.cs" t="Include" />
@ -1656,6 +1659,7 @@
<e p="Xbmc" t="Include">
<e p="XbmcMetadata.cs" t="Include" />
<e p="XbmcMetadataSettings.cs" t="Include" />
<e p="XbmcNfoDetector.cs" t="Include" />
</e>
</e>
<e p="ExistingMetadataImporter.cs" t="Include" />
@ -1678,6 +1682,7 @@
<e p="Others" t="Include">
<e p="ExistingOtherExtraImporter.cs" t="Include" />
<e p="OtherExtraFile.cs" t="Include" />
<e p="OtherExtraFileRenamer.cs" t="Include" />
<e p="OtherExtraFileRepository.cs" t="Include" />
<e p="OtherExtraFileService.cs" t="Include" />
<e p="OtherExtraService.cs" t="Include" />
@ -2597,6 +2602,7 @@
</e>
<e p="DownloadClientFixtureBase.cs" t="Include" />
<e p="DownloadStationTests" t="Include">
<e p="DownloadStationsTaskStatusJsonConverterFixture.cs" t="Include" />
<e p="SerialNumberProviderFixture.cs" t="Include" />
<e p="SharedFolderResolverFixture.cs" t="Include" />
<e p="TorrentDownloadStationFixture.cs" t="Include" />
@ -2650,6 +2656,21 @@
<e p="TrackedDownloadServiceFixture.cs" t="Include" />
</e>
</e>
<e p="Extras" t="Include">
<e p="Metadata" t="Include">
<e p="Consumers" t="Include">
<e p="Roksbox" t="Include">
<e p="FindMetadataFileFixture.cs" t="Include" />
</e>
<e p="Wdtv" t="Include">
<e p="FindMetadataFileFixture.cs" t="Include" />
</e>
<e p="Xbmc" t="Include">
<e p="FindMetadataFileFixture.cs" t="Include" />
</e>
</e>
</e>
</e>
<e p="Files" t="Include">
<e p="ArabicRomanNumeralDictionary.JSON" t="Include" />
<e p="couchpotato_movie_list.json" t="Include" />
@ -2895,16 +2916,6 @@
<e p="EventAggregatorFixture.cs" t="Include" />
</e>
</e>
<e p="Metadata" t="Include">
<e p="Consumers" t="Include">
<e p="Roksbox" t="Include">
<e p="FindMetadataFileFixture.cs" t="Include" />
</e>
<e p="Wdtv" t="Include">
<e p="FindMetadataFileFixture.cs" t="Include" />
</e>
</e>
</e>
<e p="MetadataSource" t="Include">
<e p="SearchMovieComparerFixture.cs" t="Include" />
<e p="SkyHook" t="Include">

View File

@ -40,7 +40,7 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
public override IParseIndexerResponse GetParser()
{
return new PassThePopcornParser(Settings);
return new PassThePopcornParser(Settings, _logger);
}
/*protected override IndexerResponse FetchIndexerResponse(IndexerRequest request)

View File

@ -6,6 +6,7 @@ using NzbDrone.Common.Http;
using NzbDrone.Core.Indexers.Exceptions;
using NzbDrone.Core.Parser.Model;
using System.Linq;
using NLog;
using NzbDrone.Common.Cache;
using NzbDrone.Common.Extensions;
@ -14,9 +15,11 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
public class PassThePopcornParser : IParseIndexerResponse
{
private readonly PassThePopcornSettings _settings;
public PassThePopcornParser(PassThePopcornSettings settings)
private readonly Logger _logger;
public PassThePopcornParser(PassThePopcornSettings settings, Logger logger)
{
_settings = settings;
_logger = logger;
}
public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
@ -79,23 +82,39 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
}
// Only add approved torrents
try
{
torrentInfos.Add(new PassThePopcornInfo()
{
Guid = string.Format("PassThePopcorn-{0}", id),
Title = title,
Size = long.Parse(torrent.Size),
DownloadUrl = GetDownloadUrl(id, jsonResponse.AuthKey, jsonResponse.PassKey),
InfoUrl = GetInfoUrl(result.GroupId, id),
Seeders = int.Parse(torrent.Seeders),
Peers = int.Parse(torrent.Leechers) + int.Parse(torrent.Seeders),
PublishDate = torrent.UploadTime.ToUniversalTime(),
Golden = torrent.GoldenPopcorn,
Scene = torrent.Scene,
Approved = torrent.Checked,
ImdbId = (result.ImdbId.IsNotNullOrWhiteSpace() ? int.Parse(result.ImdbId) : 0),
IndexerFlags = flags
});
}
catch (Exception e)
{
_logger.Error(e, "Encountered exception parsing PTP torrent: {" +
$"Size: {torrent.Size}" +
$"UploadTime: {torrent.UploadTime}" +
$"Seeders: {torrent.Seeders}" +
$"Leechers: {torrent.Leechers}" +
$"ReleaseName: {torrent.ReleaseName}" +
$"ID: {torrent.Id}" +
"}. Please immediately report this info on https://github.com/Radarr/Radarr/issues/1584.");
throw;
}
torrentInfos.Add(new PassThePopcornInfo()
{
Guid = string.Format("PassThePopcorn-{0}", id),
Title = title,
Size = long.Parse(torrent.Size),
DownloadUrl = GetDownloadUrl(id, jsonResponse.AuthKey, jsonResponse.PassKey),
InfoUrl = GetInfoUrl(result.GroupId, id),
Seeders = int.Parse(torrent.Seeders),
Peers = int.Parse(torrent.Leechers) + int.Parse(torrent.Seeders),
PublishDate = torrent.UploadTime.ToUniversalTime(),
Golden = torrent.GoldenPopcorn,
Scene = torrent.Scene,
Approved = torrent.Checked,
ImdbId = (result.ImdbId.IsNotNullOrWhiteSpace() ? int.Parse(result.ImdbId) : 0),
IndexerFlags = flags
});
}
}
return