From 1b83459927d4174a7cddba7100a34d53ab5352b1 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 16 Apr 2022 12:33:34 -0500 Subject: [PATCH] Fixed: (BeyondHD) Use TryCoerceInt for tmdbId Fixes #960 --- src/NzbDrone.Core/Indexers/Definitions/BeyondHD.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/BeyondHD.cs b/src/NzbDrone.Core/Indexers/Definitions/BeyondHD.cs index f1d708b46..dd602d155 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/BeyondHD.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/BeyondHD.cs @@ -205,6 +205,10 @@ namespace NzbDrone.Core.Indexers.Definitions var details = row.InfoUrl; var link = row.DownloadLink; + // BHD can return crazy values for tmdb + var tmdbId = row.TmdbId.IsNullOrWhiteSpace() ? 0 : ParseUtil.TryCoerceInt(row.TmdbId.Split("/")[1], out var tmdbResult) ? tmdbResult : 0; + var imdbId = ParseUtil.GetImdbID(row.ImdbId).GetValueOrDefault(); + var release = new TorrentInfo { Title = row.Name, @@ -217,8 +221,8 @@ namespace NzbDrone.Core.Indexers.Definitions Size = row.Size, Grabs = row.Grabs, Seeders = row.Seeders, - ImdbId = ParseUtil.GetImdbID(row.ImdbId).GetValueOrDefault(), - TmdbId = row.TmdbId.IsNullOrWhiteSpace() ? 0 : (int)ParseUtil.CoerceLong(row.TmdbId.Split("/")[1]), + ImdbId = imdbId, + TmdbId = tmdbId, Peers = row.Leechers + row.Seeders, DownloadVolumeFactor = row.Freeleech || row.Limited ? 0 : row.Promo75 ? 0.25 : row.Promo50 ? 0.5 : row.Promo25 ? 0.75 : 1, UploadVolumeFactor = 1,