Skip to content

Commit

Permalink
feat: Add rating vote count filters
Browse files Browse the repository at this point in the history
  • Loading branch information
benscobie authored and ydkmlt84 committed Jan 3, 2025
1 parent 777f206 commit 05617e1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
28 changes: 28 additions & 0 deletions server/src/modules/rules/constants/rules.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,20 +443,41 @@ export class RuleConstants {
mediaType: MediaType.MOVIE,
type: RuleType.NUMBER,
},
{
id: 17,
name: 'rottenTomatoesRatingVotes',
humanName: 'Rotten Tomatoes rating vote count',
mediaType: MediaType.MOVIE,
type: RuleType.NUMBER,
},
{
id: 15,
name: 'traktRating',
humanName: 'Trakt rating (scale 0-10)',
mediaType: MediaType.MOVIE,
type: RuleType.NUMBER,
},
{
id: 18,
name: 'traktRatingVotes',
humanName: 'Trakt rating vote count',
mediaType: MediaType.MOVIE,
type: RuleType.NUMBER,
},
{
id: 16,
name: 'imdbRating',
humanName: 'IMDb rating (scale 0-10)',
mediaType: MediaType.MOVIE,
type: RuleType.NUMBER,
},
{
id: 19,
name: 'imdbRatingVotes',
humanName: 'IMDb rating vote count',
mediaType: MediaType.MOVIE,
type: RuleType.NUMBER,
},
],
},
{
Expand Down Expand Up @@ -620,6 +641,13 @@ export class RuleConstants {
mediaType: MediaType.SHOW,
type: RuleType.NUMBER,
},
{
id: 20,
name: 'ratingVotes',
humanName: 'Show rating (IMDb) vote count',
mediaType: MediaType.SHOW,
type: RuleType.NUMBER,
},
],
},
{
Expand Down
9 changes: 9 additions & 0 deletions server/src/modules/rules/getter/radarr-getter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,21 @@ export class RadarrGetterService {
case 'rottenTomatoesRating': {
return movieResponse.ratings.rottenTomatoes?.value ?? null;
}
case 'rottenTomatoesRatingVotes': {
return movieResponse.ratings.rottenTomatoes?.votes ?? null;
}
case 'traktRating': {
return movieResponse.ratings.trakt?.value ?? null;
}
case 'traktRatingVotes': {
return movieResponse.ratings.trakt?.votes ?? null;
}
case 'imdbRating': {
return movieResponse.ratings.imdb?.value ?? null;
}
case 'imdbRatingVotes': {
return movieResponse.ratings.imdb?.votes ?? null;
}
}
} else {
this.logger.debug(
Expand Down
3 changes: 3 additions & 0 deletions server/src/modules/rules/getter/sonarr-getter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ export class SonarrGetterService {
case 'rating': {
return showResponse.ratings?.value ?? null;
}
case 'ratingVotes': {
return showResponse.ratings?.votes ?? null;
}
}
} else return null;
} else {
Expand Down

0 comments on commit 05617e1

Please sign in to comment.