From 7d97302794e60c030430ddb48877e510eed0079e Mon Sep 17 00:00:00 2001 From: Fazzani Date: Mon, 30 Dec 2024 19:38:35 +0100 Subject: [PATCH] Fix: qualifying when no providers are returned by TMDB --- src/Proxarr.Api/Proxarr.http | 36 +++++++++++------------ src/Proxarr.Api/Services/RadarrService.cs | 2 +- src/Proxarr.Api/Services/SonarrService.cs | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Proxarr.Api/Proxarr.http b/src/Proxarr.Api/Proxarr.http index 91d163f..a120743 100644 --- a/src/Proxarr.Api/Proxarr.http +++ b/src/Proxarr.Api/Proxarr.http @@ -6,44 +6,44 @@ Authorization: basic YWRtaW46YWRtaW4= # admin:admin Accept: application/json { "movie": { - "id": 66, - "title": "Asterix: The Secret of the Magic Potion", - "year": 2018, - "releaseDate": "2019-04-10", - "folderPath": "/Videos/Videos/movies/Asterix - The Secret of the Magic Potion (2018)", - "tmdbId": 620371, - "imdbId": "tt8001346", - "overview": "Following a fall during mistletoe picking, Druid Getafix decides that it is time to secure the future of the village. Accompanied by Asterix and Obelix, he undertakes to travel the Gallic world in search of a talented young druid to transmit the Secret of the Magic Potion.", + "id": 88, + "title": "Moana 2", + "year": 2024, + "releaseDate": "2025-02-19", + "folderPath": "/Videos/Videos/movies/Moana 2 (2024)", + "tmdbId": 1241982, + "imdbId": "tt13622970", + "overview": "After receiving an unexpected call from her wayfinding ancestors, Moana journeys alongside Maui and a new crew to the far seas of Oceania and into dangerous, long-lost waters for an adventure unlike anything she's ever faced.", "genres": [ - "Family", "Animation", - "Comedy", - "Adventure" + "Adventure", + "Family", + "Comedy" ], "images": [ { "coverType": "poster", - "url": "/MediaCover/77/poster.jpg", - "remoteUrl": "https://image.tmdb.org/t/p/original/5OvHpzWXBzOvgZwOoUsqNSouSwy.jpg" + "url": "/MediaCover/88/poster.jpg", + "remoteUrl": "https://image.tmdb.org/t/p/original/m0SbwFNCa9epW1X60deLqTHiP7x.jpg" }, { "coverType": "fanart", - "url": "/MediaCover/77/fanart.jpg", - "remoteUrl": "https://image.tmdb.org/t/p/original/9cPMIuB2tv4IP0LbeNhrK5OyDy5.jpg" + "url": "/MediaCover/88/fanart.jpg", + "remoteUrl": "https://image.tmdb.org/t/p/original/tElnmtQ6yz1PjN1kePNl8yMSb59.jpg" } ], "tags": [ "1 - heni" ], "originalLanguage": { - "id": 2, - "name": "French" + "id": 1, + "name": "English" } }, "addMethod": "manual", "eventType": "MovieAdded", "instanceName": "Radarr", - "applicationUrl": "{{Radarr_ApplicationUrl}}" + "applicationUrl": "https://radarr.synker.ovh" } ### Movie qualify endpoint TEST diff --git a/src/Proxarr.Api/Services/RadarrService.cs b/src/Proxarr.Api/Services/RadarrService.cs index 192e536..3ed88f8 100644 --- a/src/Proxarr.Api/Services/RadarrService.cs +++ b/src/Proxarr.Api/Services/RadarrService.cs @@ -61,7 +61,7 @@ public async Task Qualify(MovieAdded movieAdded, CancellationToken cance .GetMovieAsync(movieAdded.Movie.TmdbId, TMDbLib.Objects.Movies.MovieMethods.WatchProviders, cancellationToken) .ConfigureAwait(false); - if (tmdbItem != null && tmdbItem.WatchProviders.Results?.Count > 0) + if (tmdbItem != null) { _radarrClient.BaseUrl = movieAdded.ApplicationUrl; var movieRadarr = await _radarrClient.MovieGET2Async(movieAdded.Movie.Id, cancellationToken).ConfigureAwait(false); diff --git a/src/Proxarr.Api/Services/SonarrService.cs b/src/Proxarr.Api/Services/SonarrService.cs index 76a1e99..bdba24d 100644 --- a/src/Proxarr.Api/Services/SonarrService.cs +++ b/src/Proxarr.Api/Services/SonarrService.cs @@ -61,7 +61,7 @@ public async Task Qualify(TvAdded tvAdded, CancellationToken cancellatio .GetTvShowAsync(tvAdded.Series.TmdbId, TMDbLib.Objects.TvShows.TvShowMethods.WatchProviders, cancellationToken: cancellationToken) .ConfigureAwait(false); - if (tmdbItem != null && tmdbItem.WatchProviders.Results?.Count > 0) + if (tmdbItem != null) { _sonarrClient.BaseUrl = tvAdded.ApplicationUrl; var seriesSonarr = await _sonarrClient.SeriesGETAsync(tvAdded.Series.Id, false, cancellationToken).ConfigureAwait(false);