From f8cda54002a33f5e37a3a902b14b4e25f4aa8bd5 Mon Sep 17 00:00:00 2001 From: Victor Usoltsev Date: Sat, 6 Oct 2018 23:30:32 +1300 Subject: [PATCH 1/4] Hides Radarr options on movie requests page if only 1 option available. --- src/Ombi/ClientApp/app/requests/movierequests.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.html b/src/Ombi/ClientApp/app/requests/movierequests.component.html index 6167fbac0..05d0ca14f 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.html +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.html @@ -129,7 +129,7 @@ -
+
@@ -145,7 +145,7 @@
-
+
From dcab7773be13fcb78b168666d76087ec3840ed44 Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 7 Oct 2018 20:51:30 +0100 Subject: [PATCH 2/4] New translations en.json (Danish) --- src/Ombi/wwwroot/translations/da.json | 70 +++++++++++++-------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/Ombi/wwwroot/translations/da.json b/src/Ombi/wwwroot/translations/da.json index 0229b3603..b60fb6c7e 100644 --- a/src/Ombi/wwwroot/translations/da.json +++ b/src/Ombi/wwwroot/translations/da.json @@ -12,8 +12,8 @@ "Common": { "ContinueButton": "Fortsæt", "Available": "Tilgængelig", - "PartiallyAvailable": "Partially Available", - "Monitored": "Monitored", + "PartiallyAvailable": "Delvist tilgængelig", + "Monitored": "Overvåget", "NotAvailable": "Ikke tilgængelig", "ProcessingRequest": "Behandler anmodning", "PendingApproval": "Afventer godkendelse", @@ -48,7 +48,7 @@ "Requests": "Anmodninger", "UserManagement": "Brugeradministration", "Issues": "Problemer", - "Vote": "Vote", + "Vote": "Stem", "Donate": "Donér!", "DonateLibraryMaintainer": "Donér til vedligeholder af bibliotek", "DonateTooltip": "Sådan overbeviser jeg min kone om, at jeg skal bruge min fritid på at udvikle Ombi :)", @@ -66,27 +66,27 @@ "Danish": "Dansk", "Dutch": "Hollandsk", "Norwegian": "Norsk", - "BrazillianPortuguese": "Brazillian Portuguese", - "Polish": "Polish", - "Swedish": "Swedish" + "BrazillianPortuguese": "Brasiliansk portugisisk", + "Polish": "Polsk", + "Swedish": "Svensk" }, "OpenMobileApp": "Åbn mobilapp", - "RecentlyAdded": "Recently Added" + "RecentlyAdded": "Senest tilføjet" }, "Search": { "Title": "Søg", "Paragraph": "Ønsker du at se noget, som er utilgængeligt? intet problem, bare søg efter det nedenfor og anmod om det!", "MoviesTab": "Film", "TvTab": "Tv-serier", - "MusicTab": "Music", + "MusicTab": "Musik", "Suggestions": "Forslag", "NoResults": "Beklager, vi fandt ingen resultater!", - "DigitalDate": "Digital Release: {{date}}", - "TheatricalRelease": "Theatrical Release: {{date}}", + "DigitalDate": "Digital udgivelse: {{date}}", + "TheatricalRelease": "Biografudgivelse: {{date}}", "ViewOnPlex": "Se på Plex", "ViewOnEmby": "Se på Emby", "RequestAdded": "{{title}} er anmodet med succes", - "Similar": "Similar", + "Similar": "Lignende", "Movies": { "PopularMovies": "Populære film", "UpcomingMovies": "Kommende film", @@ -116,15 +116,15 @@ "Paragraph": "Herunder kan du se dine og alle andre anmodninger, samt status for download og godkendelse.", "MoviesTab": "Film", "TvTab": "Tv-serier", - "MusicTab": "Music", + "MusicTab": "Musik", "RequestedBy": "Anmodet af:", "Status": "Status:", "RequestStatus": "Status for anmodning:", "Denied": " Afvist:", - "TheatricalRelease": "Theatrical Release: {{date}}", - "ReleaseDate": "Released: {{date}}", - "TheatricalReleaseSort": "Theatrical Release", - "DigitalRelease": "Digital Release: {{date}}", + "TheatricalRelease": "Biografudgivelse: {{date}}", + "ReleaseDate": "Udgivet: {{date}}", + "TheatricalReleaseSort": "Biografudgivelse", + "DigitalRelease": "Digital udgivelse: {{date}}", "RequestDate": "Dato for anmodning:", "QualityOverride": "Tilsidesæt kvalitet:", "RootFolderOverride": "Tilsidesæt rodmappe:", @@ -140,20 +140,20 @@ "GridStatus": "Status", "ReportIssue": "Rapportér problem", "Filter": "Filter", - "Sort": "Sort", + "Sort": "Sorter", "SeasonNumberHeading": "Sæson: {seasonNumber}", - "SortTitleAsc": "Title ▲", - "SortTitleDesc": "Title ▼", - "SortRequestDateAsc": "Request Date ▲", - "SortRequestDateDesc": "Request Date ▼", + "SortTitleAsc": "Titel ▲", + "SortTitleDesc": "Titel ▼", + "SortRequestDateAsc": "Dato for anmodning ▲", + "SortRequestDateDesc": "Dato for anmodning ▼", "SortStatusAsc": "Status ▲", "SortStatusDesc": "Status ▼", "Remaining": { - "Quota": "{{remaining}}/{{total}} requests remaining", - "NextDays": "Another request will be added in {{time}} days", - "NextHours": "Another request will be added in {{time}} hours", - "NextMinutes": "Another request will be added in {{time}} minutes", - "NextMinute": "Another request will be added in {{time}} minute" + "Quota": "{{remaining}}/{{total}} anmodninger, der er tilbage", + "NextDays": "En anden anmodning vil blive tilføjet i {{time}} Dage", + "NextHours": "En anden anmodning vil blive tilføjet i {{time}} Timer", + "NextMinutes": "En anden anmodning vil blive tilføjet i {{time}} Minutter", + "NextMinute": "En anden anmodning vil blive tilføjet i {{time}} Minut" } }, "Issues": { @@ -180,18 +180,18 @@ "FilterHeaderAvailability": "Tilgængelighed", "FilterHeaderRequestStatus": "Status", "Approved": "Godkendt", - "PendingApproval": "Pending Approval" + "PendingApproval": "Afventer godkendelse" }, "UserManagment": { - "TvRemaining": "TV: {{remaining}}/{{total}} remaining", - "MovieRemaining": "Movies: {{remaining}}/{{total}} remaining", - "MusicRemaining": "Music: {{remaining}}/{{total}} remaining", - "TvDue": "TV: {{date}}", - "MovieDue": "Movie: {{date}}", - "MusicDue": "Music: {{date}}" + "TvRemaining": "Tv: {{remaining}}/{{total}} Resterende", + "MovieRemaining": "Film: {{remaining}}/{{total}} Resterende", + "MusicRemaining": "Musik: {{remaining}}/{{total}} Resterende", + "TvDue": "Tv: {{date}}", + "MovieDue": "Film: {{date}}", + "MusicDue": "Musik: {{date}}" }, "Votes": { - "CompletedVotesTab": "Voted", - "VotesTab": "Votes Needed" + "CompletedVotesTab": "Stemt", + "VotesTab": "Nødvendige stemmer" } } \ No newline at end of file From 12d37511eef4c7c30e4d6358cad7ee116c2e67d7 Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 7 Oct 2018 20:55:38 +0100 Subject: [PATCH 3/4] Potentially fix the user profiles issue --- .../Controllers/External/RadarrController.cs | 34 ++++++++----------- .../Controllers/External/SonarrController.cs | 1 + 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/Ombi/Controllers/External/RadarrController.cs b/src/Ombi/Controllers/External/RadarrController.cs index 128b1a9e2..882f55283 100644 --- a/src/Ombi/Controllers/External/RadarrController.cs +++ b/src/Ombi/Controllers/External/RadarrController.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; using Ombi.Api.Radarr; using Ombi.Api.Radarr.Models; using Ombi.Attributes; @@ -13,9 +12,9 @@ using Ombi.Settings.Settings.Models.External; namespace Ombi.Controllers.External { - [Authorize] - [ApiV1] - [Produces("application/json")] + [Authorize] + [ApiV1] + [Produces("application/json")] public class RadarrController : Controller { public RadarrController(IRadarrApi radarr, ISettingsService settings, @@ -24,6 +23,7 @@ namespace Ombi.Controllers.External RadarrApi = radarr; RadarrSettings = settings; Cache = mem; + RadarrSettings.ClearCache(); } private IRadarrApi RadarrApi { get; } @@ -61,15 +61,12 @@ namespace Ombi.Controllers.External [HttpGet("Profiles")] public async Task> GetProfiles() { - return await Cache.GetOrAdd(CacheKeys.RadarrQualityProfiles, async () => + var settings = await RadarrSettings.GetSettingsAsync(); + if (settings.Enabled) { - var settings = await RadarrSettings.GetSettingsAsync(); - if (settings.Enabled) - { - return await RadarrApi.GetProfiles(settings.ApiKey, settings.FullUri); - } - return null; - }, DateTime.Now.AddHours(1)); + return await RadarrApi.GetProfiles(settings.ApiKey, settings.FullUri); + } + return null; } /// @@ -80,15 +77,12 @@ namespace Ombi.Controllers.External [HttpGet("RootFolders")] public async Task> GetRootFolders() { - return await Cache.GetOrAdd(CacheKeys.RadarrRootProfiles, async () => + var settings = await RadarrSettings.GetSettingsAsync(); + if (settings.Enabled) { - var settings = await RadarrSettings.GetSettingsAsync(); - if (settings.Enabled) - { - return await RadarrApi.GetRootFolders(settings.ApiKey, settings.FullUri); - } - return null; - }, DateTime.Now.AddHours(1)); + return await RadarrApi.GetRootFolders(settings.ApiKey, settings.FullUri); + } + return null; } } } \ No newline at end of file diff --git a/src/Ombi/Controllers/External/SonarrController.cs b/src/Ombi/Controllers/External/SonarrController.cs index 94d1e3edf..a1e90e96f 100644 --- a/src/Ombi/Controllers/External/SonarrController.cs +++ b/src/Ombi/Controllers/External/SonarrController.cs @@ -20,6 +20,7 @@ namespace Ombi.Controllers.External { SonarrApi = sonarr; SonarrSettings = settings; + SonarrSettings.ClearCache(); } private ISonarrApi SonarrApi { get; } From 8bb3b1888d2b8a6f98f0f6e797c33b18267c50db Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 7 Oct 2018 20:57:03 +0100 Subject: [PATCH 4/4] !wip poweruser --- src/Ombi/Controllers/External/RadarrController.cs | 2 ++ src/Ombi/Controllers/External/SonarrController.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Ombi/Controllers/External/RadarrController.cs b/src/Ombi/Controllers/External/RadarrController.cs index 882f55283..623322704 100644 --- a/src/Ombi/Controllers/External/RadarrController.cs +++ b/src/Ombi/Controllers/External/RadarrController.cs @@ -59,6 +59,7 @@ namespace Ombi.Controllers.External /// /// [HttpGet("Profiles")] + [PowerUser] public async Task> GetProfiles() { var settings = await RadarrSettings.GetSettingsAsync(); @@ -75,6 +76,7 @@ namespace Ombi.Controllers.External /// /// [HttpGet("RootFolders")] + [PowerUser] public async Task> GetRootFolders() { var settings = await RadarrSettings.GetSettingsAsync(); diff --git a/src/Ombi/Controllers/External/SonarrController.cs b/src/Ombi/Controllers/External/SonarrController.cs index a1e90e96f..c3401736d 100644 --- a/src/Ombi/Controllers/External/SonarrController.cs +++ b/src/Ombi/Controllers/External/SonarrController.cs @@ -55,6 +55,7 @@ namespace Ombi.Controllers.External /// /// [HttpGet("Profiles")] + [PowerUser] public async Task> GetProfiles() { var settings = await SonarrSettings.GetSettingsAsync(); @@ -70,6 +71,7 @@ namespace Ombi.Controllers.External /// /// [HttpGet("RootFolders")] + [PowerUser] public async Task> GetRootFolders() { var settings = await SonarrSettings.GetSettingsAsync();