Skip to content

Commit

Permalink
Merge pull request #4 from Fazzani/bugfix/fix-qualify-missed-providers
Browse files Browse the repository at this point in the history
Fix: qualifying when no providers are returned by TMDB
  • Loading branch information
Fazzani authored Dec 30, 2024
2 parents 69e99ef + 7d97302 commit c735f76
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
36 changes: 18 additions & 18 deletions src/Proxarr.Api/Proxarr.http
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Proxarr.Api/Services/RadarrService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public async Task<string> 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);
Expand Down
2 changes: 1 addition & 1 deletion src/Proxarr.Api/Services/SonarrService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public async Task<string> 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);
Expand Down

0 comments on commit c735f76

Please sign in to comment.