From 3de88be16c9debff726ae8d7a4668224e958a223 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Wed, 14 Nov 2018 20:48:23 +0000 Subject: [PATCH 01/16] Fixed the issue where we were marking the whole season as wanted in Sonarr rather than the individual episode #2629 --- src/Ombi.Core/Senders/TvSender.cs | 2 +- src/Ombi.Schedule/Processor/ChangeLogProcessor.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Core/Senders/TvSender.cs b/src/Ombi.Core/Senders/TvSender.cs index e48e54c1a..1b3ed9461 100644 --- a/src/Ombi.Core/Senders/TvSender.cs +++ b/src/Ombi.Core/Senders/TvSender.cs @@ -355,7 +355,7 @@ namespace Ombi.Core.Senders var sea = new Season { seasonNumber = i, - monitored = model.SeasonRequests.Any(x => x.SeasonNumber == index && x.SeasonNumber != 0) + monitored = false }; seasonsToUpdate.Add(sea); } diff --git a/src/Ombi.Schedule/Processor/ChangeLogProcessor.cs b/src/Ombi.Schedule/Processor/ChangeLogProcessor.cs index e645097ef..a34bd89e1 100644 --- a/src/Ombi.Schedule/Processor/ChangeLogProcessor.cs +++ b/src/Ombi.Schedule/Processor/ChangeLogProcessor.cs @@ -174,7 +174,7 @@ namespace Ombi.Schedule.Processor var client = new GitHubClient(Octokit.ProductHeaderValue.Parse("OmbiV3")); var releases = await client.Repository.Release.GetAll("tidusjar", "ombi"); - var latest = releases.FirstOrDefault(x => x.TagName == releaseTag); + var latest = releases.FirstOrDefault(x => x.TagName.Equals(releaseTag, StringComparison.InvariantCultureIgnoreCase)); if (latest.Name.Contains("V2", CompareOptions.IgnoreCase)) { latest = null; From 527bc00c09ec0b9f91abbef4a3c392aab1052908 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Wed, 14 Nov 2018 21:40:20 +0000 Subject: [PATCH 02/16] Fixed the issue where we were marking episodes as available with the Emby connection when they have not yet aired #2417 #2623 --- src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs b/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs index f66ff89ab..23ad24268 100644 --- a/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs +++ b/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs @@ -82,6 +82,13 @@ namespace Ombi.Schedule.Jobs.Emby foreach (var ep in allEpisodes.Items) { processed++; + + if (ep.LocationType.Equals("Virtual", StringComparison.InvariantCultureIgnoreCase)) + { + // For some reason Emby is not respecting the `IsVirtualItem` field. + continue; + } + // Let's make sure we have the parent request, stop those pesky forign key errors, // Damn me having data integrity var parent = await _repo.GetByEmbyId(ep.SeriesId); From 417e4085c55a16999a47823459c39cf3c0c8ed93 Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 18 Nov 2018 20:14:47 +0000 Subject: [PATCH 03/16] Fixed the issue where we could sometimes allow the request of a whole series when the user shouldn't be able to --- src/Ombi.Core/Engine/TvRequestEngine.cs | 1 + src/Ombi.Core/Helpers/TvShowRequestBuilder.cs | 7 +- .../Rules/Request/ExistingPlexRequestRule.cs | 82 +++++++++++++++++++ .../Entities/Requests/ChildRequests.cs | 5 +- 4 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 src/Ombi.Core/Rule/Rules/Request/ExistingPlexRequestRule.cs diff --git a/src/Ombi.Core/Engine/TvRequestEngine.cs b/src/Ombi.Core/Engine/TvRequestEngine.cs index f1a5b9880..290bedd6b 100644 --- a/src/Ombi.Core/Engine/TvRequestEngine.cs +++ b/src/Ombi.Core/Engine/TvRequestEngine.cs @@ -116,6 +116,7 @@ namespace Ombi.Core.Engine } // Remove the ID since this is a new child + // This was a TVDBID for the request rules to run tvBuilder.ChildRequest.Id = 0; if (!tvBuilder.ChildRequest.SeasonRequests.Any()) { diff --git a/src/Ombi.Core/Helpers/TvShowRequestBuilder.cs b/src/Ombi.Core/Helpers/TvShowRequestBuilder.cs index e5277e236..334284484 100644 --- a/src/Ombi.Core/Helpers/TvShowRequestBuilder.cs +++ b/src/Ombi.Core/Helpers/TvShowRequestBuilder.cs @@ -41,7 +41,7 @@ namespace Ombi.Core.Helpers ShowInfo = await TvApi.ShowLookupByTheTvDbId(id); Results = await MovieDbApi.SearchTv(ShowInfo.name); foreach (TvSearchResult result in Results) { - if (result.Name == ShowInfo.name) + if (result.Name.Equals(ShowInfo.name, StringComparison.InvariantCultureIgnoreCase)) { var showIds = await MovieDbApi.GetTvExternals(result.Id); ShowInfo.externals.imdb = showIds.imdb_id; @@ -64,14 +64,15 @@ namespace Ombi.Core.Helpers { ChildRequest = new ChildRequests { - Id = model.TvDbId, + Id = model.TvDbId, // This is set to 0 after the request rules have run, the request rules needs it to identify the request RequestType = RequestType.TvShow, RequestedDate = DateTime.UtcNow, Approved = false, RequestedUserId = userId, SeasonRequests = new List(), Title = ShowInfo.name, - SeriesType = ShowInfo.genres.Any( s => s.Equals("Anime", StringComparison.OrdinalIgnoreCase)) ? SeriesType.Anime : SeriesType.Standard + ReleaseYear = FirstAir, + SeriesType = ShowInfo.genres.Any( s => s.Equals("Anime", StringComparison.InvariantCultureIgnoreCase)) ? SeriesType.Anime : SeriesType.Standard }; return this; diff --git a/src/Ombi.Core/Rule/Rules/Request/ExistingPlexRequestRule.cs b/src/Ombi.Core/Rule/Rules/Request/ExistingPlexRequestRule.cs new file mode 100644 index 000000000..5d7658c83 --- /dev/null +++ b/src/Ombi.Core/Rule/Rules/Request/ExistingPlexRequestRule.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Ombi.Core.Rule.Interfaces; +using Ombi.Store.Entities; +using Ombi.Store.Entities.Requests; +using Ombi.Store.Repository; + +namespace Ombi.Core.Rule.Rules.Request +{ + public class ExistingPlexRequestRule : BaseRequestRule, IRules + { + public ExistingPlexRequestRule(IPlexContentRepository rv) + { + _plexContent = rv; + } + + private readonly IPlexContentRepository _plexContent; + + /// + /// We check if the request exists, if it does then we don't want to re-request it. + /// + /// The object. + /// + public async Task Execute(BaseRequest obj) + { + if (obj.RequestType == RequestType.TvShow) + { + var tvRequest = (ChildRequests) obj; + + var tvContent = _plexContent.GetAll().Where(x => x.Type == PlexMediaTypeEntity.Show); + // We need to do a check on the TVDBId + var anyTvDbMatches = await tvContent.Include(x => x.Episodes).FirstOrDefaultAsync(x => x.HasTvDb && x.TvDbId.Equals(tvRequest.Id.ToString())); // the Id on the child is the tvdbid at this point + if (anyTvDbMatches == null) + { + // So we do not have a TVDB Id, that really sucks. + // Let's try and match on the title and year of the show + var titleAndYearMatch = await tvContent.Include(x=> x.Episodes).FirstOrDefaultAsync(x => + x.Title.Equals(tvRequest.Title, StringComparison.InvariantCultureIgnoreCase) + && x.ReleaseYear == tvRequest.ReleaseYear.Year.ToString()); + if (titleAndYearMatch != null) + { + // We have a match! Suprise Motherfucker + return CheckExistingContent(tvRequest, titleAndYearMatch); + } + + // We do not have this + return Success(); + } + // looks like we have a match on the TVDbID + return CheckExistingContent(tvRequest, anyTvDbMatches); + } + return Success(); + } + + + private RuleResult CheckExistingContent(ChildRequests child, PlexServerContent content) + { + foreach (var season in child.SeasonRequests) + { + var currentSeasonRequest = + content.Episodes.Where(x => x.SeasonNumber == season.SeasonNumber).ToList(); + if (!currentSeasonRequest.Any()) + { + continue; + } + foreach (var e in season.Episodes) + { + var hasEpisode = currentSeasonRequest.Any(x => x.EpisodeNumber == e.EpisodeNumber); + if (hasEpisode) + { + return Fail($"We already have episodes requested from series {child.Title}"); + } + } + } + + return Success(); + } + } +} \ No newline at end of file diff --git a/src/Ombi.Store/Entities/Requests/ChildRequests.cs b/src/Ombi.Store/Entities/Requests/ChildRequests.cs index 3b5156ce5..f212aa3e7 100644 --- a/src/Ombi.Store/Entities/Requests/ChildRequests.cs +++ b/src/Ombi.Store/Entities/Requests/ChildRequests.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using Ombi.Store.Repository.Requests; @@ -22,6 +23,8 @@ namespace Ombi.Store.Entities.Requests [NotMapped] public bool ShowSubscribe { get; set; } + [NotMapped] + public DateTime ReleaseYear { get; set; } // Used in the ExistingPlexRequestRule.cs [ForeignKey(nameof(IssueId))] public List Issues { get; set; } From aa487e6ccf3a0f1a6553472ab2ebd0807dc8eba2 Mon Sep 17 00:00:00 2001 From: Jamie Date: Mon, 19 Nov 2018 21:27:25 +0000 Subject: [PATCH 04/16] Fixed the issue with the user overrides #2646 --- src/Ombi.Core/Senders/MovieSender.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Ombi.Core/Senders/MovieSender.cs b/src/Ombi.Core/Senders/MovieSender.cs index 8b89ef7bb..66978f758 100644 --- a/src/Ombi.Core/Senders/MovieSender.cs +++ b/src/Ombi.Core/Senders/MovieSender.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System; +using System.Linq; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; @@ -101,13 +102,17 @@ namespace Ombi.Core.Senders var profiles = await _userProfiles.GetAll().FirstOrDefaultAsync(x => x.UserId == model.RequestedUserId); if (profiles != null) { - if (profiles.SonarrRootPathAnime > 0) - { - rootFolderPath = await RadarrRootPath(profiles.SonarrRootPathAnime, settings); + if (profiles.RadarrRootPath > 0) + { + var tempPath = await RadarrRootPath(profiles.RadarrRootPath, settings); + if (tempPath.HasValue()) + { + rootFolderPath = tempPath; + } } - if (profiles.SonarrQualityProfileAnime > 0) + if (profiles.RadarrQualityProfile > 0) { - qualityToUse = profiles.SonarrQualityProfileAnime; + qualityToUse = profiles.RadarrQualityProfile; } } @@ -163,7 +168,7 @@ namespace Ombi.Core.Senders { var paths = await RadarrApi.GetRootFolders(settings.ApiKey, settings.FullUri); var selectedPath = paths.FirstOrDefault(x => x.id == overrideId); - return selectedPath.path; + return selectedPath?.path ?? String.Empty; } } } \ No newline at end of file From cd43bed26be05ee9f3c74206bcb4df7de2f00c06 Mon Sep 17 00:00:00 2001 From: Jamie Date: Mon, 19 Nov 2018 21:31:38 +0000 Subject: [PATCH 05/16] Fixed #2603 --- src/Ombi/ClientApp/app/requests/request.component.html | 2 +- src/Ombi/ClientApp/app/requests/request.component.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Ombi/ClientApp/app/requests/request.component.html b/src/Ombi/ClientApp/app/requests/request.component.html index d2df3c97a..db72b9d17 100644 --- a/src/Ombi/ClientApp/app/requests/request.component.html +++ b/src/Ombi/ClientApp/app/requests/request.component.html @@ -9,7 +9,7 @@ {{ 'Requests.TvTab' | translate }} -
  • +
  • {{ 'Requests.MusicTab' | translate }}
  • diff --git a/src/Ombi/ClientApp/app/requests/request.component.ts b/src/Ombi/ClientApp/app/requests/request.component.ts index d0fa9d0b1..b318d619b 100644 --- a/src/Ombi/ClientApp/app/requests/request.component.ts +++ b/src/Ombi/ClientApp/app/requests/request.component.ts @@ -15,6 +15,7 @@ export class RequestComponent implements OnInit { public issueCategories: IIssueCategory[]; public issuesEnabled = false; + public musicEnabled: boolean; constructor(private issuesService: IssuesService, private settingsService: SettingsService) { @@ -23,6 +24,7 @@ export class RequestComponent implements OnInit { public ngOnInit(): void { this.issuesService.getCategories().subscribe(x => this.issueCategories = x); + this.settingsService.lidarrEnabled().subscribe(x => this.musicEnabled = x); this.settingsService.getIssueSettings().subscribe(x => this.issuesEnabled = x.enabled); } From fa19ab322cf4ba907b8cecfb6028b869f5b48108 Mon Sep 17 00:00:00 2001 From: Jamie Date: Mon, 19 Nov 2018 21:43:12 +0000 Subject: [PATCH 06/16] Updated the emby api since we no longer need the extra parameters to send to emby to log in a local user #2546 --- src/Ombi.Api.Emby/EmbyApi.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Ombi.Api.Emby/EmbyApi.cs b/src/Ombi.Api.Emby/EmbyApi.cs index fa8414ac9..43a2badb6 100644 --- a/src/Ombi.Api.Emby/EmbyApi.cs +++ b/src/Ombi.Api.Emby/EmbyApi.cs @@ -53,8 +53,6 @@ namespace Ombi.Api.Emby { username, pw = password, - password = password.GetSha1Hash().ToLower(), - passwordMd5 = password.CalcuateMd5Hash() }; request.AddJsonBody(body); From d545dc5823cfccc87a04989e9c2c7342957d8673 Mon Sep 17 00:00:00 2001 From: Jamie Date: Mon, 19 Nov 2018 22:01:48 +0000 Subject: [PATCH 07/16] Made the subscribe/unsubscribe button more obvious on the UI #2309 --- .../app/search/moviesearch.component.html | 118 +++++++++++------- .../app/search/moviesearch.component.ts | 2 +- 2 files changed, 71 insertions(+), 49 deletions(-) diff --git a/src/Ombi/ClientApp/app/search/moviesearch.component.html b/src/Ombi/ClientApp/app/search/moviesearch.component.html index 05dbf15ad..daf77a079 100644 --- a/src/Ombi/ClientApp/app/search/moviesearch.component.html +++ b/src/Ombi/ClientApp/app/search/moviesearch.component.html @@ -2,7 +2,8 @@
    - +

    {{result.title}} ({{result.releaseDate | amLocal | amDateFormat: 'YYYY'}})

    - - {{ 'Search.TheatricalRelease' | translate: {date: result.releaseDate | amLocal | amDateFormat: 'LL'} }} - {{ 'Search.DigitalDate' | translate: {date: result.digitalReleaseDate | amLocal | amDateFormat: 'LL'} }} + + {{ + 'Search.TheatricalRelease' | translate: {date: result.releaseDate | amLocal | + amDateFormat: 'LL'} }} + {{ 'Search.DigitalDate' | translate: {date: result.digitalReleaseDate | + amLocal | amDateFormat: 'LL'} }} - + - - {{result.quality}}p - - - - - + + {{result.quality}}p + + + + + - + -
    +

    {{result.overview}}

    -
    -
    - - - -
    -
    - +
    -
    - - - - - - -
    - - -
    +
    + + + + + + +
    + + + +
    -
    -
    +
    +
    @@ -117,4 +139,4 @@ + [issueCategory]="issueCategorySelected" [id]="issueRequestId" [providerId]="issueProviderId"> \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/search/moviesearch.component.ts b/src/Ombi/ClientApp/app/search/moviesearch.component.ts index f4d19565a..600fc19eb 100644 --- a/src/Ombi/ClientApp/app/search/moviesearch.component.ts +++ b/src/Ombi/ClientApp/app/search/moviesearch.component.ts @@ -172,7 +172,7 @@ export class MovieSearchComponent implements OnInit { r.subscribed = true; this.requestService.subscribeToMovie(r.requestId) .subscribe(x => { - this.notificationService.success("Subscribed To Movie!"); + this.notificationService.success(`Subscribed To Movie ${r.title}!`); }); } From 05a8846104a821375f1b402e75b491c92b2b06dd Mon Sep 17 00:00:00 2001 From: Jamie Date: Fri, 23 Nov 2018 19:53:39 +0000 Subject: [PATCH 08/16] !changelog --- CHANGELOG.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9fdea5a0..5e60b7be3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,43 @@ ## (unreleased) +### **New Features** + +- Updated the emby api since we no longer need the extra parameters to send to emby to log in a local user #2546. [Jamie] + +- Added the ability to get the ombi user via a Plex Token #2591. [Jamie] + +### **Fixes** + +- Made the subscribe/unsubscribe button more obvious on the UI #2309. [Jamie] + +- Fixed #2603. [Jamie] + +- Fixed the issue with the user overrides #2646. [Jamie] + +- Fixed the issue where we could sometimes allow the request of a whole series when the user shouldn't be able to. [Jamie] + +- Fixed the issue where we were marking episodes as available with the Emby connection when they have not yet aired #2417 #2623. [TidusJar] + +- Fixed the issue where we were marking the whole season as wanted in Sonarr rather than the individual episode #2629. [TidusJar] + +- Fixed #2623. [Jamie] + +- Fixed #2633. [TidusJar] + +- Fixed #2639. [Jamie] + +- Show the TV show as available when we have all the episodes but future episodes have not aired. #2585. [Jamie] + + +## v3.0.3945 (2018-10-25) + +### **New Features** + +- Update Readme for Lidarr. [Qstick] + +- Update CHANGELOG.md. [Jamie] + ### **Fixes** - New translations en.json (French) [Jamie] From 185c47b0ee56310bbc386e9fc936a72c8650b47c Mon Sep 17 00:00:00 2001 From: Victor Usoltsev Date: Wed, 28 Nov 2018 10:02:54 +1300 Subject: [PATCH 09/16] Maps alias email variable for welcome emails. --- src/Ombi/Controllers/IdentityController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Ombi/Controllers/IdentityController.cs b/src/Ombi/Controllers/IdentityController.cs index 61b3f06d8..f963db0b8 100644 --- a/src/Ombi/Controllers/IdentityController.cs +++ b/src/Ombi/Controllers/IdentityController.cs @@ -863,6 +863,7 @@ namespace Ombi.Controllers { var ombiUser = new OmbiUser { + Alias = user.Alias, Email = user.EmailAddress, UserName = user.UserName }; From 6c1057ad70d05ba5ed1f923085a6ae88abfc1cf2 Mon Sep 17 00:00:00 2001 From: Jamie Date: Wed, 28 Nov 2018 21:19:35 +0000 Subject: [PATCH 10/16] Increased the logo size on the landing page to match the container below it --- src/Ombi/ClientApp/app/landingpage/landingpage.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ombi/ClientApp/app/landingpage/landingpage.component.html b/src/Ombi/ClientApp/app/landingpage/landingpage.component.html index 27545b64b..03878033f 100644 --- a/src/Ombi/ClientApp/app/landingpage/landingpage.component.html +++ b/src/Ombi/ClientApp/app/landingpage/landingpage.component.html @@ -3,7 +3,7 @@
    -
    +
    From 91fdfa74c19ba876fc0af98ecf5ba5bfeea901dd Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 3 Dec 2018 20:34:21 +0000 Subject: [PATCH 11/16] #2669 Fixed missing translations --- src/Ombi/ClientApp/app/search/moviesearch.component.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ombi/ClientApp/app/search/moviesearch.component.html b/src/Ombi/ClientApp/app/search/moviesearch.component.html index 05dbf15ad..b51dec5a6 100644 --- a/src/Ombi/ClientApp/app/search/moviesearch.component.html +++ b/src/Ombi/ClientApp/app/search/moviesearch.component.html @@ -92,12 +92,12 @@
    \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts b/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts index 4af2c490e..ee2438f1b 100644 --- a/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts +++ b/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from "@angular/core"; import { FormBuilder, FormGroup, Validators } from "@angular/forms"; -import { ISonarrProfile, ISonarrRootFolder } from "../../interfaces"; +import { ILanguageProfiles, ISonarrProfile, ISonarrRootFolder } from "../../interfaces"; import { ISonarrSettings } from "../../interfaces"; import { SonarrService } from "../../services"; @@ -18,10 +18,13 @@ export class SonarrComponent implements OnInit { public qualitiesAnime: ISonarrProfile[]; public rootFolders: ISonarrRootFolder[]; public rootFoldersAnime: ISonarrRootFolder[]; + public languageProfiles: ILanguageProfiles[]; public selectedRootFolder: ISonarrRootFolder; public selectedQuality: ISonarrProfile; + public selectedLanguageProfiles: ILanguageProfiles; public profilesRunning: boolean; public rootFoldersRunning: boolean; + public langRunning: boolean; public form: FormGroup; public advanced = false; @@ -48,6 +51,7 @@ export class SonarrComponent implements OnInit { addOnly: [x.addOnly], seasonFolders: [x.seasonFolders], v3: [x.v3], + langaugeProfile: [x.languageProfile], }); if (x.qualityProfile) { @@ -56,11 +60,16 @@ export class SonarrComponent implements OnInit { if (x.rootPath) { this.getRootFolders(this.form); } + if(x.languageProfile) { + this.getLanguageProfiles(this.form); + } }); this.rootFolders = []; this.qualities = []; + this.languageProfiles = []; this.rootFolders.push({ path: "Please Select", id: -1 }); this.qualities.push({ name: "Please Select", id: -1 }); + this.languageProfiles.push({ name: "Please Select", id: -1 }); } public getProfiles(form: FormGroup) { @@ -89,6 +98,18 @@ export class SonarrComponent implements OnInit { }); } + public getLanguageProfiles(form: FormGroup) { + this.langRunning = true; + this.sonarrService.getV3LanguageProfiles(form.value) + .subscribe(x => { + this.languageProfiles = x; + this.languageProfiles.unshift({ name: "Please Select", id: -1 }); + + this.langRunning = false; + this.notificationService.success("Successfully retrieved the Languge Profiles"); + }); + } + public test(form: FormGroup) { if (form.invalid) { this.notificationService.error("Please check your entered values"); diff --git a/src/Ombi/Controllers/External/SonarrController.cs b/src/Ombi/Controllers/External/SonarrController.cs index c3401736d..bc2534ab8 100644 --- a/src/Ombi/Controllers/External/SonarrController.cs +++ b/src/Ombi/Controllers/External/SonarrController.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Ombi.Api.Sonarr; using Ombi.Api.Sonarr.Models; +using Ombi.Api.Sonarr.Models.V3; using Ombi.Attributes; using Ombi.Core.Settings; using Ombi.Core.Settings.Models.External; @@ -16,14 +17,16 @@ namespace Ombi.Controllers.External [Produces("application/json")] public class SonarrController : Controller { - public SonarrController(ISonarrApi sonarr, ISettingsService settings) + public SonarrController(ISonarrApi sonarr, ISonarrV3Api sonarrv3, ISettingsService settings) { SonarrApi = sonarr; + SonarrV3Api = sonarrv3; SonarrSettings = settings; SonarrSettings.ClearCache(); } private ISonarrApi SonarrApi { get; } + private ISonarrV3Api SonarrV3Api { get; } private ISettingsService SonarrSettings { get; } /// @@ -82,5 +85,36 @@ namespace Ombi.Controllers.External return null; } + + /// + /// Gets the Sonarr V3 language profiles + /// + /// + [HttpGet("v3/LanguageProfiles")] + [PowerUser] + public async Task> GetLanguageProfiles() + { + var settings = await SonarrSettings.GetSettingsAsync(); + if (settings.Enabled) + { + return await SonarrV3Api.LanguageProfiles(settings.ApiKey, settings.FullUri); + } + + return null; + } + + + /// + /// Gets the Sonarr V3 language profiles + /// + /// The settings. + /// + [HttpPost("v3/LanguageProfiles")] + [PowerUser] + public async Task> GetLanguageProfiles([FromBody] SonarrSettings settings) + { + return await SonarrV3Api.LanguageProfiles(settings.ApiKey, settings.FullUri); + } + } } \ No newline at end of file From c1e2cad2528ea1643bf07d985a3294f56bda8a08 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Wed, 5 Dec 2018 09:47:06 +0000 Subject: [PATCH 14/16] Added Sonarr v3 #2359 --- src/Ombi.Api.Sonarr/Models/NewSeries.cs | 3 +++ src/Ombi.Core/Senders/TvSender.cs | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Ombi.Api.Sonarr/Models/NewSeries.cs b/src/Ombi.Api.Sonarr/Models/NewSeries.cs index ef18baddb..d6f721b0b 100644 --- a/src/Ombi.Api.Sonarr/Models/NewSeries.cs +++ b/src/Ombi.Api.Sonarr/Models/NewSeries.cs @@ -27,6 +27,9 @@ namespace Ombi.Api.Sonarr.Models public int id { get; set; } public List images { get; set; } + // V3 Property + public int languageProfileId { get; set; } + /// /// This is for us /// diff --git a/src/Ombi.Core/Senders/TvSender.cs b/src/Ombi.Core/Senders/TvSender.cs index b6c2aa8af..aadb893d0 100644 --- a/src/Ombi.Core/Senders/TvSender.cs +++ b/src/Ombi.Core/Senders/TvSender.cs @@ -180,12 +180,7 @@ namespace Ombi.Core.Senders // Are we using v3 sonarr? var sonarrV3 = s.V3; - var languageProfileId = 0; - if (sonarrV3) - { - languageProfileId = s.LanguageProfile; - } - + var languageProfileId = s.LanguageProfile; try { @@ -216,6 +211,11 @@ namespace Ombi.Core.Senders } }; + if (sonarrV3) + { + newSeries.languageProfileId = languageProfileId; + } + // Montitor the correct seasons, // If we have that season in the model then it's monitored! var seasonsToAdd = GetSeasonsToCreate(model); From d3444059dda456419d5fc7dae32ce807f09aa4af Mon Sep 17 00:00:00 2001 From: Jamie Date: Wed, 5 Dec 2018 20:48:16 +0000 Subject: [PATCH 15/16] Sorted out the sonarr settings UI !wip --- .../app/settings/sonarr/sonarr.component.html | 50 +++++++++++-------- .../app/settings/sonarr/sonarr.component.ts | 5 +- src/Ombi/ClientApp/styles/Styles.scss | 2 +- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.html b/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.html index 91385c353..f016fd56e 100644 --- a/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.html +++ b/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.html @@ -22,34 +22,40 @@
    - +
    - + - The IP/Hostname is required
    - + - The Port is required
    - + - The API Key is required
    @@ -68,9 +74,10 @@
    -
    - +
    - A Default Quality - Profile is required +
    +
    +
    @@ -94,7 +102,10 @@
    - +
    - A Default Root Path - is - required
    @@ -119,17 +127,17 @@
    - +
    - + - A Default - Langauage Profile is required
    diff --git a/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts b/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts index ee2438f1b..11845a06e 100644 --- a/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts +++ b/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts @@ -51,7 +51,7 @@ export class SonarrComponent implements OnInit { addOnly: [x.addOnly], seasonFolders: [x.seasonFolders], v3: [x.v3], - langaugeProfile: [x.languageProfile], + languageProfile: [x.languageProfile], }); if (x.qualityProfile) { @@ -63,6 +63,9 @@ export class SonarrComponent implements OnInit { if(x.languageProfile) { this.getLanguageProfiles(this.form); } + if(x.v3) { + this.form.controls.languageProfile.setValidators([Validators.required]); + } }); this.rootFolders = []; this.qualities = []; diff --git a/src/Ombi/ClientApp/styles/Styles.scss b/src/Ombi/ClientApp/styles/Styles.scss index b41e1c2a7..d98e4cf83 100644 --- a/src/Ombi/ClientApp/styles/Styles.scss +++ b/src/Ombi/ClientApp/styles/Styles.scss @@ -27,4 +27,4 @@ $bg-colour-disabled: #252424; .label { margin: 3px; -} \ No newline at end of file +} From a1c903aa162ed436c33a4290189662eedfe5405f Mon Sep 17 00:00:00 2001 From: Jamie Date: Wed, 5 Dec 2018 21:06:31 +0000 Subject: [PATCH 16/16] Sorted out some of the settings pages, trying to make it consistent --- .../app/settings/lidarr/lidarr.component.html | 39 +++++--- .../app/settings/radarr/radarr.component.html | 96 +++++++++++-------- .../app/settings/settingsmenu.component.html | 2 +- 3 files changed, 82 insertions(+), 55 deletions(-) diff --git a/src/Ombi/ClientApp/app/settings/lidarr/lidarr.component.html b/src/Ombi/ClientApp/app/settings/lidarr/lidarr.component.html index 50938412f..5e898e719 100644 --- a/src/Ombi/ClientApp/app/settings/lidarr/lidarr.component.html +++ b/src/Ombi/ClientApp/app/settings/lidarr/lidarr.component.html @@ -19,25 +19,28 @@
    - + - The IP/Hostname is required
    - + - The Port is required +
    - + - The API Key is required +
    @@ -56,19 +59,22 @@
    - +
    - - A Default Quality Profile is required
    - +
    @@ -89,12 +97,14 @@
    - A Language profile is required
    - +
    - A Metadata profile is required
    diff --git a/src/Ombi/ClientApp/app/settings/radarr/radarr.component.html b/src/Ombi/ClientApp/app/settings/radarr/radarr.component.html index 909a64226..08a8035c2 100644 --- a/src/Ombi/ClientApp/app/settings/radarr/radarr.component.html +++ b/src/Ombi/ClientApp/app/settings/radarr/radarr.component.html @@ -1,5 +1,4 @@ - - +
    Radarr Settings @@ -19,25 +18,34 @@
    - + - - The IP/Hostname is required +
    - + - - The Port is required +
    - - - - The API Key is required + + +
    @@ -49,63 +57,73 @@
    - +
    +
    -
    - -
    -
    -
    - +
    - +
    - A Default Quality Profile is required
    -
    -
    - -
    - -
    - +
    - + -
    - A Default Root Path is required + + +
    + +
    - +
    -
    - - A Default Minimum Availability is required
    - +
    +
    +
    - +
    @@ -118,4 +136,4 @@
    -
    +
    \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/settings/settingsmenu.component.html b/src/Ombi/ClientApp/app/settings/settingsmenu.component.html index 59ce35c32..f77e77501 100644 --- a/src/Ombi/ClientApp/app/settings/settingsmenu.component.html +++ b/src/Ombi/ClientApp/app/settings/settingsmenu.component.html @@ -54,7 +54,7 @@ Music