diff --git a/src/Ombi.Api.RottenTomatoes/IRottenTomatoesApi.cs b/src/Ombi.Api.RottenTomatoes/IRottenTomatoesApi.cs new file mode 100644 index 000000000..4466832b1 --- /dev/null +++ b/src/Ombi.Api.RottenTomatoes/IRottenTomatoesApi.cs @@ -0,0 +1,14 @@ +using Ombi.Api.RottenTomatoes.Models; +using System; +using System.Linq; +using System.Net.Http; +using System.Threading.Tasks; + +namespace Ombi.Api.RottenTomatoes +{ + public interface IRottenTomatoesApi + { + Task GetMovieRatings(string movieName, int movieYear); + Task GetTvRatings(string showName, int showYear); + } +} diff --git a/src/Ombi.Api.RottenTomatoes/Models/RottenTomatoesMovieResponse.cs b/src/Ombi.Api.RottenTomatoes/Models/RottenTomatoesMovieResponse.cs new file mode 100644 index 000000000..ceea5000b --- /dev/null +++ b/src/Ombi.Api.RottenTomatoes/Models/RottenTomatoesMovieResponse.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; + +namespace Ombi.Api.RottenTomatoes.Models +{ + public class RottenTomatoesMovieResponse + { + public int total { get; set; } + public List movies { get; set; } + } + + public class Movie + { + public string id { get; set; } + public string title { get; set; } + public int year { get; set; } + public string mpaa_rating { get; set; } + public object runtime { get; set; } + public string critics_consensus { get; set; } + public MovieRatings ratings { get; set; } + public Links links { get; set; } + } + + public class MovieRatings + { + public string critics_rating { get; set; } + public int critics_score { get; set; } + public string audience_rating { get; set; } + public int audience_score { get; set; } + } + + public class Links + { + public string alternate { get; set; } + } +} diff --git a/src/Ombi.Api.RottenTomatoes/Models/RottenTomatoesTvResponse.cs b/src/Ombi.Api.RottenTomatoes/Models/RottenTomatoesTvResponse.cs new file mode 100644 index 000000000..234e958be --- /dev/null +++ b/src/Ombi.Api.RottenTomatoes/Models/RottenTomatoesTvResponse.cs @@ -0,0 +1,20 @@ +namespace Ombi.Api.RottenTomatoes.Models +{ + public class RottenTomatoesTvResponse + { + public int tvCount { get; set; } + public TvSeries[] tvSeries { get; set; } + } + + public class TvSeries + { + public string title { get; set; } + public int startYear { get; set; } + public int endYear { get; set; } + public string url { get; set; } + public string meterClass { get; set; } + public int meterScore { get; set; } + public string image { get; set; } + } + +} diff --git a/src/Ombi.Api.RottenTomatoes/Models/TvRatings.cs b/src/Ombi.Api.RottenTomatoes/Models/TvRatings.cs new file mode 100644 index 000000000..902d532d7 --- /dev/null +++ b/src/Ombi.Api.RottenTomatoes/Models/TvRatings.cs @@ -0,0 +1,8 @@ +namespace Ombi.Api.RottenTomatoes.Models +{ + public class TvRatings + { + public string Class { get; set; } + public int Score { get; set; } + } +} diff --git a/src/Ombi.Api.RottenTomatoes/Ombi.Api.RottenTomatoes.csproj b/src/Ombi.Api.RottenTomatoes/Ombi.Api.RottenTomatoes.csproj new file mode 100644 index 000000000..8cb4799bc --- /dev/null +++ b/src/Ombi.Api.RottenTomatoes/Ombi.Api.RottenTomatoes.csproj @@ -0,0 +1,12 @@ + + + + net5.0 + 8.0 + + + + + + + diff --git a/src/Ombi.Api.RottenTomatoes/RottenTomatoesApi.cs b/src/Ombi.Api.RottenTomatoes/RottenTomatoesApi.cs new file mode 100644 index 000000000..88dfa2f79 --- /dev/null +++ b/src/Ombi.Api.RottenTomatoes/RottenTomatoesApi.cs @@ -0,0 +1,56 @@ +using Ombi.Api.RottenTomatoes.Models; +using System; +using System.Linq; +using System.Net.Http; +using System.Threading.Tasks; + +namespace Ombi.Api.RottenTomatoes +{ + public class RottenTomatoesApi : IRottenTomatoesApi + { + public RottenTomatoesApi(IApi api) + { + _api = api; + } + + private string Endpoint => "https://www.rottentomatoes.com/api/private"; + private IApi _api { get; } + + public async Task GetMovieRatings(string movieName, int movieYear) + { + var request = new Request("/v1.0/movies", Endpoint, HttpMethod.Get); + request.AddHeader("Accept", "application/json"); + request.AddQueryString("q", movieName); + var result = await _api.Request(request); + + var movieFound = result.movies.FirstOrDefault(x => x.year == movieYear); + if (movieFound == null) + { + return null; + } + + return movieFound.ratings; + } + + public async Task GetTvRatings(string showName, int showYear) + { + var request = new Request("/v2.0/search/", Endpoint, HttpMethod.Get); + request.AddHeader("Accept", "application/json"); + request.AddQueryString("q", showName); + request.AddQueryString("limit", 10.ToString()); + var result = await _api.Request(request); + + var showFound = result.tvSeries.FirstOrDefault(x => x.startYear == showYear); + if (showFound == null) + { + return null; + } + + return new TvRatings + { + Class = showFound.meterClass, + Score = showFound.meterScore + }; + } + } +} diff --git a/src/Ombi.DependencyInjection/IocExtensions.cs b/src/Ombi.DependencyInjection/IocExtensions.cs index 7571cdca4..d5e577d84 100644 --- a/src/Ombi.DependencyInjection/IocExtensions.cs +++ b/src/Ombi.DependencyInjection/IocExtensions.cs @@ -67,6 +67,7 @@ using Quartz.Spi; using Ombi.Api.MusicBrainz; using Ombi.Api.Twilio; using Ombi.Api.CloudService; +using Ombi.Api.RottenTomatoes; namespace Ombi.DependencyInjection { @@ -158,6 +159,7 @@ namespace Ombi.DependencyInjection services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); } public static void RegisterStore(this IServiceCollection services) { diff --git a/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj b/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj index bbfe532eb..ed1e9e4a2 100644 --- a/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj +++ b/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj @@ -32,6 +32,7 @@ + diff --git a/src/Ombi.sln b/src/Ombi.sln index 658d37c3b..70324f967 100644 --- a/src/Ombi.sln +++ b/src/Ombi.sln @@ -121,6 +121,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Webhook", "Ombi.Ap EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.CloudService", "Ombi.Api.CloudService\Ombi.Api.CloudService.csproj", "{5DE40A66-B369-469E-8626-ECE23D9D8034}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ombi.Api.RottenTomatoes", "Ombi.Api.RottenTomatoes\Ombi.Api.RottenTomatoes.csproj", "{8F19C701-7881-4BC7-8BBA-B068A6B954AD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -323,6 +325,10 @@ Global {5DE40A66-B369-469E-8626-ECE23D9D8034}.Debug|Any CPU.Build.0 = Debug|Any CPU {5DE40A66-B369-469E-8626-ECE23D9D8034}.Release|Any CPU.ActiveCfg = Release|Any CPU {5DE40A66-B369-469E-8626-ECE23D9D8034}.Release|Any CPU.Build.0 = Release|Any CPU + {8F19C701-7881-4BC7-8BBA-B068A6B954AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8F19C701-7881-4BC7-8BBA-B068A6B954AD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8F19C701-7881-4BC7-8BBA-B068A6B954AD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8F19C701-7881-4BC7-8BBA-B068A6B954AD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -334,6 +340,7 @@ Global {63E63511-1C7F-4162-8F92-8F7391B3C8A3} = {025FB189-2FFB-4F43-A64B-6F1B5A0D2065} {2E1A7B91-F29B-42BC-8F1E-1CF2DCC389BA} = {9293CA11-360A-4C20-A674-B9E794431BF5} {08FF107D-31E1-470D-AF86-E09B015CEE06} = {9293CA11-360A-4C20-A674-B9E794431BF5} + {F03757C7-5145-45C9-AFFF-B4E946755779} = {9293CA11-360A-4C20-A674-B9E794431BF5} {CFB5E008-D0D0-43C0-AA06-89E49D17F384} = {9293CA11-360A-4C20-A674-B9E794431BF5} {0E8EF835-E4F0-4EE5-A2B6-678DEE973721} = {9293CA11-360A-4C20-A674-B9E794431BF5} {E6EE2830-E4AC-4F2E-AD93-2C9305605761} = {EA30DD15-6280-4687-B370-2956EC2E54E5} @@ -369,6 +376,7 @@ Global {59D19538-0496-44EE-936E-EBBC22CF7B27} = {410F36CF-9C60-428A-B191-6FD90610991A} {E2186FDA-D827-4781-8663-130AC382F12C} = {9293CA11-360A-4C20-A674-B9E794431BF5} {5DE40A66-B369-469E-8626-ECE23D9D8034} = {9293CA11-360A-4C20-A674-B9E794431BF5} + {8F19C701-7881-4BC7-8BBA-B068A6B954AD} = {9293CA11-360A-4C20-A674-B9E794431BF5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {192E9BF8-00B4-45E4-BCCC-4C215725C869} diff --git a/src/Ombi/ClientApp/src/app/interfaces/IRatings.ts b/src/Ombi/ClientApp/src/app/interfaces/IRatings.ts new file mode 100644 index 000000000..fe7a86614 --- /dev/null +++ b/src/Ombi/ClientApp/src/app/interfaces/IRatings.ts @@ -0,0 +1,11 @@ +export interface IMovieRatings { + critics_rating: string; + critics_score: number; + audience_rating: string; + audience_score: number; +} + +export interface ITvRatings { + class: string; + score: number; +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts index 56b9d3ffe..7ffb79eee 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts @@ -1,4 +1,4 @@ -import { Component, ViewEncapsulation } from "@angular/core"; +import { Component, Inject, OnInit, ViewEncapsulation } from "@angular/core"; import { ImageService, SearchV2Service, RequestService, MessageService, RadarrService } from "../../../services"; import { ActivatedRoute } from "@angular/router"; import { DomSanitizer } from "@angular/platform-browser"; @@ -13,13 +13,15 @@ import { StorageService } from "../../../shared/storage/storage-service"; import { MovieAdvancedOptionsComponent } from "./panels/movie-advanced-options/movie-advanced-options.component"; import { RequestServiceV2 } from "../../../services/requestV2.service"; import { RequestBehalfComponent } from "../shared/request-behalf/request-behalf.component"; +import { IMovieRatings } from "../../../interfaces/IRatings"; +import { APP_BASE_HREF } from "@angular/common"; @Component({ templateUrl: "./movie-details.component.html", styleUrls: ["../../media-details.component.scss"], encapsulation: ViewEncapsulation.None }) -export class MovieDetailsComponent { +export class MovieDetailsComponent implements OnInit { public movie: ISearchMovieResultV2; public hasRequest: boolean; public movieRequest: IMovieRequests; @@ -43,10 +45,13 @@ export class MovieDetailsComponent { } } this.theMovidDbId = params.movieDbId; - this.load(); }); } + public async ngOnInit() { + await this.load(); + } + public async load() { this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser"); diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html index 3f838d9ee..62a458c19 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html @@ -1,16 +1,26 @@
+ + {{movie.voteAverage | number:'1.0-1'}}/10 + + + {{ratings.critics_score}}% + + + {{ratings.audience_score}}% + +
{{'MediaDetails.Status' | translate }}: -
{{movie.status}}
+ {{movie.status}}
- {{'MediaDetails.Availability' | translate }} -
{{'Common.Available' | translate}}
-
{{'Common.NotAvailable' | translate}}
+ {{'MediaDetails.Availability' | translate }}: + {{'Common.Available' | translate}} + {{'Common.NotAvailable' | translate}}
-
-
+ +
{{'MediaDetails.RequestStatus' | translate }}
{{'Common.ProcessingRequest' | translate}}
{{'Common.PendingApproval' | translate}} @@ -20,13 +30,13 @@
- {{'Requests.RequestedBy' | translate }} -
{{request.requestedUser.userAlias}}
+ {{'Requests.RequestedBy' | translate }}: + {{request.requestedUser.userAlias}}
- {{'Requests.RequestDate' | translate }} -
{{request.requestedDate | date}}
+ {{'Requests.RequestDate' | translate }}: + {{request.requestedDate | date}}
@@ -43,56 +53,49 @@ {{'MediaDetails.QualityOverride' | translate }}
{{request.qualityOverrideTitle}}
-
-
- {{'MediaDetails.Genres' | translate }}: -
- - - {{genre.name}} - - -
-
-
+ + + +
{{'MediaDetails.TheatricalRelease' | translate }}: -
- {{movie.releaseDate | date: 'mediumDate'}} +
{{'MediaDetails.DigitalRelease' | translate }}: -
{{movie.digitalReleaseDate | date: 'mediumDate'}} -
-
-
- {{'MediaDetails.UserScore' | translate }}: -
- {{movie.voteAverage | number:'1.0-1'}} / 10 -
+
{{'MediaDetails.Votes' | translate }}: -
{{movie.voteCount | thousandShort: 1}} -
{{'MediaDetails.Runtime' | translate }}: -
{{'MediaDetails.Minutes' | translate:{runtime: movie.runtime} }}
+ {{'MediaDetails.Minutes' | translate:{runtime: movie.runtime} }}
{{'MediaDetails.Revenue' | translate }}: -
{{movie.revenue | currency: 'USD'}}
+ {{movie.revenue | currency: 'USD'}}
{{'MediaDetails.Budget' | translate }}: -
{{movie.budget | currency: 'USD'}}
+ {{movie.budget | currency: 'USD'}}
+
+
+ {{'MediaDetails.Genres' | translate }}: +
+ + + {{genre.name}} + + +
+
-
+
{{'MediaDetails.Keywords' | translate }}: @@ -100,5 +103,4 @@ {{keyword.name}} -
-
\ No newline at end of file +
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.ts index 3bfb68f56..1df97372c 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.ts @@ -1,15 +1,27 @@ -import { Component, ViewEncapsulation, Input } from "@angular/core"; +import { Component, ViewEncapsulation, Input, OnInit, Inject } from "@angular/core"; import { ISearchMovieResultV2 } from "../../../../interfaces/ISearchMovieResultV2"; -import { IAdvancedData, IMovieRequests } from "../../../../interfaces"; - +import { IMovieRequests } from "../../../../interfaces"; +import { SearchV2Service } from "../../../../services/searchV2.service"; +import { IMovieRatings } from "../../../../interfaces/IRatings"; +import { APP_BASE_HREF } from "@angular/common"; @Component({ templateUrl: "./movie-information-panel.component.html", styleUrls: ["../../../media-details.component.scss"], selector: "movie-information-panel", encapsulation: ViewEncapsulation.None }) -export class MovieInformationPanelComponent { +export class MovieInformationPanelComponent implements OnInit { + + constructor(private searchService: SearchV2Service, @Inject(APP_BASE_HREF) public baseUrl: string) { } + @Input() public movie: ISearchMovieResultV2; @Input() public request: IMovieRequests; @Input() public advancedOptions: boolean; + + public ratings: IMovieRatings; + + public ngOnInit() { + this.searchService.getRottenMovieRatings(this.movie.title, +this.movie.releaseDate.toString().substring(0,4)) + .subscribe(x => this.ratings = x); + } } diff --git a/src/Ombi/ClientApp/src/app/media-details/components/shared/social-icons/social-icons.component.html b/src/Ombi/ClientApp/src/app/media-details/components/shared/social-icons/social-icons.component.html index de923204a..68fff403d 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/shared/social-icons/social-icons.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/shared/social-icons/social-icons.component.html @@ -10,10 +10,10 @@ - - diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html index d9d2b3a83..b7d8f6872 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html @@ -1,42 +1,46 @@
+ + {{tv.rating}}/10 + + + {{ratings.score}}% + + +
{{'MediaDetails.Status' | translate }}: -
{{tv.status}} -
First Aired: -
{{tv.firstAired | date: 'mediumDate'}} -
+
+ +
+ Seasons: + {{seasonCount}} +
+
+ Episodes: + {{totalEpisodes}}
- {{'MediaDetails.RootFolderOverride' | translate }} + {{'MediaDetails.RootFolderOverride' | translate }}:
{{request.rootPathOverrideTitle}}
- {{'MediaDetails.QualityOverride' | translate }} + {{'MediaDetails.QualityOverride' | translate }}:
{{request.qualityOverrideTitle}}
{{'MediaDetails.Runtime' | translate }}: -
{{'MediaDetails.Minutes' | translate:{ runtime: tv.runtime} }} -
-
- Rating: -
- {{tv.rating}} / 10 -
-
+
Network: -
{{tv.network.name}} -
@@ -48,16 +52,3 @@
-
-
- Seasons: -
- {{seasonCount}} -
-
-
- Episodes: -
- {{totalEpisodes}} -
-
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.ts index 3d3f77e75..5217586f5 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.ts @@ -1,6 +1,8 @@ import { Component, ViewEncapsulation, Input, OnInit } from "@angular/core"; import { ITvRequests } from "../../../../../interfaces"; +import { ITvRatings } from "../../../../../interfaces/IRatings"; import { ISearchTvResultV2 } from "../../../../../interfaces/ISearchTvResultV2"; +import { SearchV2Service } from "../../../../../services"; @Component({ templateUrl: "./tv-information-panel.component.html", @@ -9,15 +11,21 @@ import { ISearchTvResultV2 } from "../../../../../interfaces/ISearchTvResultV2"; encapsulation: ViewEncapsulation.None }) export class TvInformationPanelComponent implements OnInit { + + constructor(private searchService: SearchV2Service) { } + @Input() public tv: ISearchTvResultV2; @Input() public request: ITvRequests; @Input() public advancedOptions: boolean; + public ratings: ITvRatings; public seasonCount: number; public totalEpisodes: number = 0; public nextEpisode: any; public ngOnInit(): void { + this.searchService.getRottenTvRatings(this.tv.title, +this.tv.firstAired.toString().substring(0,4)) + .subscribe(x => this.ratings = x); this.tv.seasonRequests.forEach(season => { this.totalEpisodes = this.totalEpisodes + season.episodes.length; }); diff --git a/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss b/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss index c9fc9f522..7466e26ca 100644 --- a/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss +++ b/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss @@ -226,4 +226,8 @@ .content-end { text-align: end; +} + +.rating-small { + width: 1.3em; } \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/services/searchV2.service.ts b/src/Ombi/ClientApp/src/app/services/searchV2.service.ts index 6536e3cf6..07a846185 100644 --- a/src/Ombi/ClientApp/src/app/services/searchV2.service.ts +++ b/src/Ombi/ClientApp/src/app/services/searchV2.service.ts @@ -11,6 +11,7 @@ import { ISearchMovieResultV2 } from "../interfaces/ISearchMovieResultV2"; import { ISearchTvResultV2, IMovieCollectionsViewModel, IActorCredits } from "../interfaces/ISearchTvResultV2"; import { IArtistSearchResult, IAlbumArt } from "../interfaces/IMusicSearchResultV2"; import { SearchFilter } from "../my-nav/SearchFilter"; +import { IMovieRatings, ITvRatings } from "../interfaces/IRatings"; @Injectable() export class SearchV2Service extends ServiceHelpers { @@ -121,4 +122,13 @@ export class SearchV2Service extends ServiceHelpers { public getReleaseGroupArt(mbid: string): Observable { return this.http.get(`${this.url}/releasegroupart/${mbid}`); } + + public getRottenMovieRatings(name: string, year: number): Observable { + return this.http.get(`${this.url}/ratings/movie/${name}/${year}`); + } + + public getRottenTvRatings(name: string, year: number): Observable { + return this.http.get(`${this.url}/ratings/tv/${name}/${year}`); + } + } diff --git a/src/Ombi/Controllers/V2/SearchController.cs b/src/Ombi/Controllers/V2/SearchController.cs index 652ff15eb..af1378ee5 100644 --- a/src/Ombi/Controllers/V2/SearchController.cs +++ b/src/Ombi/Controllers/V2/SearchController.cs @@ -14,13 +14,15 @@ using Ombi.Core.Models.Search; using Ombi.Core.Models.Search.V2; using Ombi.Core.Models.Search.V2.Music; using Ombi.Models; +using Ombi.Api.RottenTomatoes.Models; +using Ombi.Api.RottenTomatoes; namespace Ombi.Controllers.V2 { public class SearchController : V2Controller { public SearchController(IMultiSearchEngine multiSearchEngine, ITvSearchEngine tvSearchEngine, - IMovieEngineV2 v2Movie, ITVSearchEngineV2 v2Tv, IMusicSearchEngineV2 musicEngine) + IMovieEngineV2 v2Movie, ITVSearchEngineV2 v2Tv, IMusicSearchEngineV2 musicEngine, IRottenTomatoesApi rottenTomatoesApi) { _multiSearchEngine = multiSearchEngine; _tvSearchEngine = tvSearchEngine; @@ -29,6 +31,7 @@ namespace Ombi.Controllers.V2 _movieEngineV2.ResultLimit = 12; _tvEngineV2 = v2Tv; _musicEngine = musicEngine; + _rottenTomatoesApi = rottenTomatoesApi; } private readonly IMultiSearchEngine _multiSearchEngine; @@ -36,6 +39,7 @@ namespace Ombi.Controllers.V2 private readonly ITVSearchEngineV2 _tvEngineV2; private readonly ITvSearchEngine _tvSearchEngine; private readonly IMusicSearchEngineV2 _musicEngine; + private readonly IRottenTomatoesApi _rottenTomatoesApi; /// /// Returns search results for both TV and Movies @@ -399,5 +403,22 @@ namespace Ombi.Controllers.V2 { return await _musicEngine.GetReleaseGroupArt(musicBrainzId, CancellationToken); } + + [HttpGet("ratings/movie/{name}/{year}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesDefaultResponseType] + public Task GetRottenMovieRatings(string name, int year) + { + return _rottenTomatoesApi.GetMovieRatings(name, year); + } + + [HttpGet("ratings/tv/{name}/{year}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesDefaultResponseType] + public Task GetRottenTvRatings(string name, int year) + { + return _rottenTomatoesApi.GetTvRatings(name, year); + } + } } \ No newline at end of file diff --git a/src/Ombi/wwwroot/images/rotten-audience-fresh.svg b/src/Ombi/wwwroot/images/rotten-audience-fresh.svg new file mode 100644 index 000000000..ecc9b5b0e --- /dev/null +++ b/src/Ombi/wwwroot/images/rotten-audience-fresh.svg @@ -0,0 +1 @@ + diff --git a/src/Ombi/wwwroot/images/rotten-audience-rotten.svg b/src/Ombi/wwwroot/images/rotten-audience-rotten.svg new file mode 100644 index 000000000..c97f1f65a --- /dev/null +++ b/src/Ombi/wwwroot/images/rotten-audience-rotten.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/Ombi/wwwroot/images/rotten-fresh.svg b/src/Ombi/wwwroot/images/rotten-fresh.svg new file mode 100644 index 000000000..ff792bcf5 --- /dev/null +++ b/src/Ombi/wwwroot/images/rotten-fresh.svg @@ -0,0 +1 @@ + diff --git a/src/Ombi/wwwroot/images/rotten-rotten.svg b/src/Ombi/wwwroot/images/rotten-rotten.svg new file mode 100644 index 000000000..283ea5b60 --- /dev/null +++ b/src/Ombi/wwwroot/images/rotten-rotten.svg @@ -0,0 +1 @@ + diff --git a/src/Ombi/wwwroot/images/tmdb-logo.svg b/src/Ombi/wwwroot/images/tmdb-logo.svg new file mode 100644 index 000000000..e98e4ab29 --- /dev/null +++ b/src/Ombi/wwwroot/images/tmdb-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/Ombi/wwwroot/images/tvm-logo.png b/src/Ombi/wwwroot/images/tvm-logo.png new file mode 100644 index 000000000..a4912fdaf Binary files /dev/null and b/src/Ombi/wwwroot/images/tvm-logo.png differ diff --git a/src/Ombi/wwwroot/translations/bg.json b/src/Ombi/wwwroot/translations/bg.json index 13d352ae5..13e69e626 100644 --- a/src/Ombi/wwwroot/translations/bg.json +++ b/src/Ombi/wwwroot/translations/bg.json @@ -257,7 +257,6 @@ "Genres": "Genres", "TheatricalRelease": "Кинопремиера", "DigitalRelease": "Digital Release", - "UserScore": "User Score", "Votes": "Votes", "Runtime": "Runtime", "Minutes": "{{runtime}} Minutes", diff --git a/src/Ombi/wwwroot/translations/da.json b/src/Ombi/wwwroot/translations/da.json index 917882e24..a8948554a 100644 --- a/src/Ombi/wwwroot/translations/da.json +++ b/src/Ombi/wwwroot/translations/da.json @@ -257,7 +257,6 @@ "Genres": "Genres", "TheatricalRelease": "Biografudgivelse", "DigitalRelease": "Digital Release", - "UserScore": "User Score", "Votes": "Votes", "Runtime": "Runtime", "Minutes": "{{runtime}} Minutes", diff --git a/src/Ombi/wwwroot/translations/de.json b/src/Ombi/wwwroot/translations/de.json index b661f874d..e2678ff67 100644 --- a/src/Ombi/wwwroot/translations/de.json +++ b/src/Ombi/wwwroot/translations/de.json @@ -257,7 +257,6 @@ "Genres": "Genres", "TheatricalRelease": "Kinostart", "DigitalRelease": "Digital Release", - "UserScore": "User Score", "Votes": "Votes", "Runtime": "Runtime", "Minutes": "{{runtime}} Minutes", diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index a8f44ec5f..ff1985637 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -256,9 +256,8 @@ "RootFolderOverride":"Root Folder Override", "QualityOverride":"Quality Override", "Genres":"Genres", - "TheatricalRelease":"Theatrical Release", + "TheatricalRelease":"Release", "DigitalRelease":"Digital Release", - "UserScore":"User Score", "Votes":"Votes", "Runtime":"Runtime", "Minutes": "{{runtime}} Minutes", diff --git a/src/Ombi/wwwroot/translations/es.json b/src/Ombi/wwwroot/translations/es.json index f0684f01e..b7e7c62e6 100644 --- a/src/Ombi/wwwroot/translations/es.json +++ b/src/Ombi/wwwroot/translations/es.json @@ -257,7 +257,6 @@ "Genres": "Géneros", "TheatricalRelease": "En cines", "DigitalRelease": "Estreno Digital", - "UserScore": "Puntuación de Usuarios", "Votes": "Votos", "Runtime": "Duración", "Minutes": "{{runtime}} Minutos", diff --git a/src/Ombi/wwwroot/translations/fr.json b/src/Ombi/wwwroot/translations/fr.json index 86ee34fbd..39020a38d 100644 --- a/src/Ombi/wwwroot/translations/fr.json +++ b/src/Ombi/wwwroot/translations/fr.json @@ -257,7 +257,6 @@ "Genres": "Genres", "TheatricalRelease": "Sortie en salle", "DigitalRelease": "Sorti en Numérique", - "UserScore": "Note des Spectateurs", "Votes": "Votes", "Runtime": "Durée de visionnage", "Minutes": "{{runtime}} Minutes", diff --git a/src/Ombi/wwwroot/translations/hu.json b/src/Ombi/wwwroot/translations/hu.json index 8c1c3f3e5..fb6829ab4 100644 --- a/src/Ombi/wwwroot/translations/hu.json +++ b/src/Ombi/wwwroot/translations/hu.json @@ -257,7 +257,6 @@ "Genres": "Genres", "TheatricalRelease": "Mozis kiadás", "DigitalRelease": "Digital Release", - "UserScore": "User Score", "Votes": "Votes", "Runtime": "Runtime", "Minutes": "{{runtime}} Minutes", diff --git a/src/Ombi/wwwroot/translations/it.json b/src/Ombi/wwwroot/translations/it.json index 2f168bc23..3fb41154c 100644 --- a/src/Ombi/wwwroot/translations/it.json +++ b/src/Ombi/wwwroot/translations/it.json @@ -257,7 +257,6 @@ "Genres": "Generi", "TheatricalRelease": "Rilascio Teatrale", "DigitalRelease": "Rilascio Digitale", - "UserScore": "Punteggio Utente", "Votes": "Voti", "Runtime": "Durata", "Minutes": "{{runtime}} Minuti", diff --git a/src/Ombi/wwwroot/translations/nl.json b/src/Ombi/wwwroot/translations/nl.json index 0490be1e5..17ef0d1bb 100644 --- a/src/Ombi/wwwroot/translations/nl.json +++ b/src/Ombi/wwwroot/translations/nl.json @@ -257,7 +257,6 @@ "Genres": "Genres", "TheatricalRelease": "Bioscoop Uitgave", "DigitalRelease": "Digital Release", - "UserScore": "User Score", "Votes": "Votes", "Runtime": "Runtime", "Minutes": "{{runtime}} Minutes", diff --git a/src/Ombi/wwwroot/translations/no.json b/src/Ombi/wwwroot/translations/no.json index f74766883..80d32f716 100644 --- a/src/Ombi/wwwroot/translations/no.json +++ b/src/Ombi/wwwroot/translations/no.json @@ -257,7 +257,6 @@ "Genres": "Genres", "TheatricalRelease": "Kinopremiere", "DigitalRelease": "Digital Release", - "UserScore": "User Score", "Votes": "Votes", "Runtime": "Runtime", "Minutes": "{{runtime}} Minutes", diff --git a/src/Ombi/wwwroot/translations/pl.json b/src/Ombi/wwwroot/translations/pl.json index ca8ed5410..32e82515d 100644 --- a/src/Ombi/wwwroot/translations/pl.json +++ b/src/Ombi/wwwroot/translations/pl.json @@ -257,7 +257,6 @@ "Genres": "Genres", "TheatricalRelease": "Premiera kinowa", "DigitalRelease": "Digital Release", - "UserScore": "User Score", "Votes": "Votes", "Runtime": "Runtime", "Minutes": "{{runtime}} Minutes", diff --git a/src/Ombi/wwwroot/translations/pt.json b/src/Ombi/wwwroot/translations/pt.json index ddef26615..dbfb1f9bd 100644 --- a/src/Ombi/wwwroot/translations/pt.json +++ b/src/Ombi/wwwroot/translations/pt.json @@ -257,7 +257,6 @@ "Genres": "Genres", "TheatricalRelease": "Theatrical Release", "DigitalRelease": "Digital Release", - "UserScore": "User Score", "Votes": "Votes", "Runtime": "Runtime", "Minutes": "{{runtime}} Minutes", diff --git a/src/Ombi/wwwroot/translations/ru.json b/src/Ombi/wwwroot/translations/ru.json index 0d31783ee..789038220 100644 --- a/src/Ombi/wwwroot/translations/ru.json +++ b/src/Ombi/wwwroot/translations/ru.json @@ -257,7 +257,6 @@ "Genres": "Genres", "TheatricalRelease": "Релиз в кинотеатрах", "DigitalRelease": "Digital Release", - "UserScore": "User Score", "Votes": "Votes", "Runtime": "Runtime", "Minutes": "{{runtime}} Minutes", diff --git a/src/Ombi/wwwroot/translations/sk.json b/src/Ombi/wwwroot/translations/sk.json index 3ab7f6257..4cc9b96b6 100644 --- a/src/Ombi/wwwroot/translations/sk.json +++ b/src/Ombi/wwwroot/translations/sk.json @@ -257,7 +257,6 @@ "Genres": "Genres", "TheatricalRelease": "Kino vydanie", "DigitalRelease": "Digital Release", - "UserScore": "User Score", "Votes": "Votes", "Runtime": "Runtime", "Minutes": "{{runtime}} Minutes", diff --git a/src/Ombi/wwwroot/translations/sv.json b/src/Ombi/wwwroot/translations/sv.json index 4984b658d..63c92b817 100644 --- a/src/Ombi/wwwroot/translations/sv.json +++ b/src/Ombi/wwwroot/translations/sv.json @@ -257,7 +257,6 @@ "Genres": "Genrer", "TheatricalRelease": "Biopremiär", "DigitalRelease": "Digital release", - "UserScore": "Användarbetyg", "Votes": "Röster", "Runtime": "Speltid", "Minutes": "{{runtime}} minuter",