From 293aa8823457c6acd79c07aca659fa647a73699d Mon Sep 17 00:00:00 2001 From: Victor Usoltsev Date: Sat, 6 Oct 2018 23:09:02 +1300 Subject: [PATCH 1/9] Hides Sonarr options on tv requests page if only 1 option available. --- src/Ombi/ClientApp/app/requests/tvrequests.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi/ClientApp/app/requests/tvrequests.component.html b/src/Ombi/ClientApp/app/requests/tvrequests.component.html index e4d10d72e..801998c71 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequests.component.html +++ b/src/Ombi/ClientApp/app/requests/tvrequests.component.html @@ -50,7 +50,7 @@ View
-
+
@@ -66,7 +66,7 @@
-
+
From f8cda54002a33f5e37a3a902b14b4e25f4aa8bd5 Mon Sep 17 00:00:00 2001 From: Victor Usoltsev Date: Sat, 6 Oct 2018 23:30:32 +1300 Subject: [PATCH 2/9] 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 42eb5ca9117bc801575fddafea0f4028d560648b Mon Sep 17 00:00:00 2001 From: Victor Usoltsev Date: Sun, 7 Oct 2018 02:06:30 +1300 Subject: [PATCH 3/9] Changes language selector to always show native language name. --- src/Ombi/ClientApp/app/app.component.html | 22 +++++++++++----------- src/Ombi/wwwroot/translations/da.json | 13 ------------- src/Ombi/wwwroot/translations/de.json | 13 ------------- src/Ombi/wwwroot/translations/en.json | 13 ------------- src/Ombi/wwwroot/translations/es.json | 13 ------------- src/Ombi/wwwroot/translations/fr.json | 13 ------------- src/Ombi/wwwroot/translations/it.json | 13 ------------- src/Ombi/wwwroot/translations/nl.json | 13 ------------- src/Ombi/wwwroot/translations/no.json | 13 ------------- src/Ombi/wwwroot/translations/pl.json | 13 ------------- src/Ombi/wwwroot/translations/pt.json | 13 ------------- src/Ombi/wwwroot/translations/sv.json | 13 ------------- 12 files changed, 11 insertions(+), 154 deletions(-) diff --git a/src/Ombi/ClientApp/app/app.component.html b/src/Ombi/ClientApp/app/app.component.html index 953e2a9a2..d695ac61c 100644 --- a/src/Ombi/ClientApp/app/app.component.html +++ b/src/Ombi/ClientApp/app/app.component.html @@ -117,37 +117,37 @@ diff --git a/src/Ombi/wwwroot/translations/da.json b/src/Ombi/wwwroot/translations/da.json index 0229b3603..7786d69ad 100644 --- a/src/Ombi/wwwroot/translations/da.json +++ b/src/Ombi/wwwroot/translations/da.json @@ -57,19 +57,6 @@ "Welcome": "Velkommen til {{username}}", "UpdateDetails": "Opdater loginoplysninger", "Logout": "Log af", - "Language": { - "English": "Engelsk", - "French": "Fransk", - "Spanish": "Spansk", - "German": "Tysk", - "Italian": "Italiensk", - "Danish": "Dansk", - "Dutch": "Hollandsk", - "Norwegian": "Norsk", - "BrazillianPortuguese": "Brazillian Portuguese", - "Polish": "Polish", - "Swedish": "Swedish" - }, "OpenMobileApp": "Åbn mobilapp", "RecentlyAdded": "Recently Added" }, diff --git a/src/Ombi/wwwroot/translations/de.json b/src/Ombi/wwwroot/translations/de.json index c3646221d..2dccedb1f 100644 --- a/src/Ombi/wwwroot/translations/de.json +++ b/src/Ombi/wwwroot/translations/de.json @@ -57,19 +57,6 @@ "Welcome": "Willkommen {{username}}", "UpdateDetails": "Update-Details", "Logout": "Ausloggen", - "Language": { - "English": "Englisch", - "French": "Französisch", - "Spanish": "Spanisch", - "German": "Deutsch", - "Italian": "Italienisch", - "Danish": "Dänisch", - "Dutch": "Niederländisch", - "Norwegian": "Norwegisch", - "BrazillianPortuguese": "Portugiesisch (Brasilien)", - "Polish": "Polnisch", - "Swedish": "Schwedisch" - }, "OpenMobileApp": "Mobile App", "RecentlyAdded": "Kürzlich hinzugefügt" }, diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index 93f6c39f0..2d6d81e94 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -60,19 +60,6 @@ "Welcome": "Welcome {{username}}", "UpdateDetails": "Update Details", "Logout": "Logout", - "Language": { - "English": "English", - "French": "French", - "Spanish": "Spanish", - "German": "German", - "Italian": "Italian", - "Danish": "Danish", - "Dutch": "Dutch", - "Norwegian":"Norwegian", - "BrazillianPortuguese": "Brazillian Portuguese", - "Polish":"Polish", - "Swedish":"Swedish" - }, "OpenMobileApp":"Open Mobile App", "RecentlyAdded":"Recently Added" }, diff --git a/src/Ombi/wwwroot/translations/es.json b/src/Ombi/wwwroot/translations/es.json index dc7637e79..a9f8c2b5e 100644 --- a/src/Ombi/wwwroot/translations/es.json +++ b/src/Ombi/wwwroot/translations/es.json @@ -57,19 +57,6 @@ "Welcome": "Bienvenido {{username}}", "UpdateDetails": "Detalles de la actualización", "Logout": "Cerrar sesión", - "Language": { - "English": "Inglés", - "French": "Francés", - "Spanish": "Español", - "German": "Alemán", - "Italian": "Italiano", - "Danish": "Danés", - "Dutch": "Holandés", - "Norwegian": "Norwegian", - "BrazillianPortuguese": "Brazillian Portuguese", - "Polish": "Polish", - "Swedish": "Swedish" - }, "OpenMobileApp": "Open Mobile App", "RecentlyAdded": "Recently Added" }, diff --git a/src/Ombi/wwwroot/translations/fr.json b/src/Ombi/wwwroot/translations/fr.json index c20dffdb0..bf6e26a93 100644 --- a/src/Ombi/wwwroot/translations/fr.json +++ b/src/Ombi/wwwroot/translations/fr.json @@ -57,19 +57,6 @@ "Welcome": "Bienvenue {{username}}", "UpdateDetails": "Détails de la mise à jour", "Logout": "Déconnexion", - "Language": { - "English": "Anglais", - "French": "Français", - "Spanish": "Espagnol", - "German": "Allemand", - "Italian": "Italien", - "Danish": "Danois", - "Dutch": "Néerlandais", - "Norwegian": "Norvégien", - "BrazillianPortuguese": "Portuguais brésilien", - "Polish": "Polonais", - "Swedish": "Swedish" - }, "OpenMobileApp": "Ouvrir l'application mobile", "RecentlyAdded": "Ajouts récents" }, diff --git a/src/Ombi/wwwroot/translations/it.json b/src/Ombi/wwwroot/translations/it.json index 0ade93919..bfa026be0 100644 --- a/src/Ombi/wwwroot/translations/it.json +++ b/src/Ombi/wwwroot/translations/it.json @@ -57,19 +57,6 @@ "Welcome": "Benvenuto {{username}}", "UpdateDetails": "Aggiorna i tuoi dati", "Logout": "Logout", - "Language": { - "English": "Inglese", - "French": "Francese", - "Spanish": "Spagnolo", - "German": "Tedesco", - "Italian": "Italiano", - "Danish": "Danese", - "Dutch": "Olandese", - "Norwegian": "Norvegese", - "BrazillianPortuguese": "Brazillian Portuguese", - "Polish": "Polish", - "Swedish": "Swedish" - }, "OpenMobileApp": "Apri l'applicazione mobile", "RecentlyAdded": "Recently Added" }, diff --git a/src/Ombi/wwwroot/translations/nl.json b/src/Ombi/wwwroot/translations/nl.json index 18a1d319d..24ce67966 100644 --- a/src/Ombi/wwwroot/translations/nl.json +++ b/src/Ombi/wwwroot/translations/nl.json @@ -57,19 +57,6 @@ "Welcome": "Welkom {{username}}", "UpdateDetails": "Update gegevens", "Logout": "Logout", - "Language": { - "English": "Engels", - "French": "Frans", - "Spanish": "Spaans", - "German": "Duits", - "Italian": "Italiaans", - "Danish": "Deens", - "Dutch": "Nederlands", - "Norwegian": "Noors", - "BrazillianPortuguese": "Brazillian Portuguese", - "Polish": "Polish", - "Swedish": "Swedish" - }, "OpenMobileApp": "Open Mobiele App", "RecentlyAdded": "Recently Added" }, diff --git a/src/Ombi/wwwroot/translations/no.json b/src/Ombi/wwwroot/translations/no.json index 80cd9e31a..6f84943a8 100644 --- a/src/Ombi/wwwroot/translations/no.json +++ b/src/Ombi/wwwroot/translations/no.json @@ -57,19 +57,6 @@ "Welcome": "Velkommen {{username}}", "UpdateDetails": "Oppdater detaljer", "Logout": "Logg av", - "Language": { - "English": "Engelsk", - "French": "Fransk", - "Spanish": "Spansk", - "German": "Tysk", - "Italian": "Italiensk", - "Danish": "Dansk", - "Dutch": "Nederlandsk", - "Norwegian": "Norsk", - "BrazillianPortuguese": "Brazillian Portuguese", - "Polish": "Polish", - "Swedish": "Swedish" - }, "OpenMobileApp": "Åpne mobilapp", "RecentlyAdded": "Recently Added" }, diff --git a/src/Ombi/wwwroot/translations/pl.json b/src/Ombi/wwwroot/translations/pl.json index 3aba4da41..b53f7f1c1 100644 --- a/src/Ombi/wwwroot/translations/pl.json +++ b/src/Ombi/wwwroot/translations/pl.json @@ -57,19 +57,6 @@ "Welcome": "Witaj {{username}}", "UpdateDetails": "Podaj szczegóły", "Logout": "Wyloguj", - "Language": { - "English": "Angielski", - "French": "Francuski", - "Spanish": "Hiszpański", - "German": "Niemiecki", - "Italian": "Włoski", - "Danish": "Duński", - "Dutch": "Holenderski", - "Norwegian": "Norweski", - "BrazillianPortuguese": "Brazylijski portugalski", - "Polish": "Polski", - "Swedish": "Swedish" - }, "OpenMobileApp": "Otwórz aplikację mobilną", "RecentlyAdded": "Ostatnio dodane" }, diff --git a/src/Ombi/wwwroot/translations/pt.json b/src/Ombi/wwwroot/translations/pt.json index eaf45cac9..199f06593 100644 --- a/src/Ombi/wwwroot/translations/pt.json +++ b/src/Ombi/wwwroot/translations/pt.json @@ -57,19 +57,6 @@ "Welcome": "Bem-vindo, {{username}}", "UpdateDetails": "Detalhes da Atualização", "Logout": "Sair", - "Language": { - "English": "Inglês", - "French": "Francês", - "Spanish": "Espanhol", - "German": "Alemão", - "Italian": "Italiano", - "Danish": "Dinamarquês", - "Dutch": "Holandês", - "Norwegian": "Norueguês", - "BrazillianPortuguese": "Português (Brasil)", - "Polish": "Polonês", - "Swedish": "Swedish" - }, "OpenMobileApp": "Abrir aplicativo do celular", "RecentlyAdded": "Recentemente adicionado" }, diff --git a/src/Ombi/wwwroot/translations/sv.json b/src/Ombi/wwwroot/translations/sv.json index 8d2e8374a..6da35d413 100644 --- a/src/Ombi/wwwroot/translations/sv.json +++ b/src/Ombi/wwwroot/translations/sv.json @@ -57,19 +57,6 @@ "Welcome": "Välkommen {{username}}", "UpdateDetails": "Uppdatera information", "Logout": "Logga ut", - "Language": { - "English": "Engelska", - "French": "Franska", - "Spanish": "Spanska", - "German": "Tyska", - "Italian": "Italienska", - "Danish": "Danska", - "Dutch": "Holländska", - "Norwegian": "Norska", - "BrazillianPortuguese": "Brazillian portugisiska", - "Polish": "Polska", - "Swedish": "Swedish" - }, "OpenMobileApp": "Öppna Mobil App", "RecentlyAdded": "Nyligen tillagda" }, From dcab7773be13fcb78b168666d76087ec3840ed44 Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 7 Oct 2018 20:51:30 +0100 Subject: [PATCH 4/9] 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 5/9] 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 6/9] !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(); From 7763ecca4f844cffc7bd840754c22570cf6b059c Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 7 Oct 2018 21:01:24 +0100 Subject: [PATCH 7/9] Fixed lidarr newsletter bug --- src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs b/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs index 9f5e58482..88125b7c6 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs @@ -98,7 +98,7 @@ namespace Ombi.Schedule.Jobs.Ombi // Get the Content var plexContent = _plex.GetAll().Include(x => x.Episodes).AsNoTracking(); var embyContent = _emby.GetAll().Include(x => x.Episodes).AsNoTracking(); - var lidarrContent = _lidarrAlbumRepository.GetAll().AsNoTracking(); + var lidarrContent = _lidarrAlbumRepository.GetAll().Where(x => x.FullyAvailable).AsNoTracking(); var addedLog = _recentlyAddedLog.GetAll(); var addedPlexMovieLogIds = addedLog.Where(x => x.Type == RecentlyAddedType.Plex && x.ContentType == ContentType.Parent).Select(x => x.ContentId); From 324c02a58d13516d8a05ae55bdbd97021e53fe01 Mon Sep 17 00:00:00 2001 From: Anojh Date: Sun, 7 Oct 2018 15:09:05 -0700 Subject: [PATCH 8/9] users can now remove their own requests --- .../app/requests/movierequests.component.html | 13 ++++++++----- .../app/requests/movierequests.component.ts | 7 +++++++ .../app/requests/music/musicrequests.component.html | 13 ++++++++----- .../app/requests/music/musicrequests.component.ts | 7 +++++++ .../app/requests/tvrequest-children.component.html | 4 +++- .../app/requests/tvrequest-children.component.ts | 8 ++++++++ .../app/requests/tvrequests.component.html | 2 +- .../ClientApp/app/requests/tvrequests.component.ts | 2 ++ 8 files changed, 44 insertions(+), 12 deletions(-) diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.html b/src/Ombi/ClientApp/app/requests/movierequests.component.html index 05d0ca14f..a1dd5cadc 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.html +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.html @@ -166,11 +166,7 @@
-
- -
+
+
-
- -
+
+
+
+ +
diff --git a/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts b/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts index 19e941e9d..ff451e5b5 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts +++ b/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts @@ -10,6 +10,7 @@ import { NotificationService, RequestService } from "../services"; export class TvRequestChildrenComponent { @Input() public childRequests: IChildRequests[]; @Input() public isAdmin: boolean; + @Input() public currentUser: string; @Output() public requestDeleted = new EventEmitter(); @@ -116,4 +117,11 @@ export class TvRequestChildrenComponent { this.childRequests.splice(index, 1); } } + + public isRequestUser(request: IChildRequests) { + if (request.requestedUser.userName === this.currentUser) { + return true; + } + return false; + } } diff --git a/src/Ombi/ClientApp/app/requests/tvrequests.component.html b/src/Ombi/ClientApp/app/requests/tvrequests.component.html index 801998c71..7c5e13479 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequests.component.html +++ b/src/Ombi/ClientApp/app/requests/tvrequests.component.html @@ -99,7 +99,7 @@
- +

diff --git a/src/Ombi/ClientApp/app/requests/tvrequests.component.ts b/src/Ombi/ClientApp/app/requests/tvrequests.component.ts index 144de0206..924fccd1f 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/tvrequests.component.ts @@ -20,6 +20,7 @@ export class TvRequestsComponent implements OnInit { public searchChanged = new Subject(); public searchText: string; public isAdmin: boolean; + public currentUser: string; public showChildDialogue = false; // This is for the child modal popup public selectedSeason: ITvRequests; public defaultPoster: string; @@ -48,6 +49,7 @@ export class TvRequestsComponent implements OnInit { private readonly platformLocation: PlatformLocation) { this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser"); + this.currentUser = this.auth.claims().name; if (this.isAdmin) { this.sonarrService.getQualityProfilesWithoutSettings() .subscribe(x => this.sonarrProfiles = x); From 5e0f04a2f67a177fd25fb73dac6cb5794ea2e9da Mon Sep 17 00:00:00 2001 From: Anojh Date: Sun, 7 Oct 2018 15:28:50 -0700 Subject: [PATCH 9/9] !wip - fix lint errors --- .../app/requests/movierequests.component.ts | 13 +++++++------ .../app/requests/music/musicrequests.component.ts | 13 +++++++------ .../app/requests/tvrequest-children.component.ts | 13 +++++++------ 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.ts b/src/Ombi/ClientApp/app/requests/movierequests.component.ts index 950743dc4..19fc989f2 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.ts @@ -218,6 +218,13 @@ export class MovieRequestsComponent implements OnInit { }); } + public isRequestUser(request: IMovieRequests) { + if (request.requestedUser.userName === this.auth.claims().name) { + return true; + } + return false; + } + private filterActiveStyle(el: any) { el = el.toElement || el.relatedTarget || el.target || el.srcElement; @@ -366,10 +373,4 @@ export class MovieRequestsComponent implements OnInit { ("url(" + "https://image.tmdb.org/t/p/w1280" + req.background + ")"); } - public isRequestUser(request: IMovieRequests) { - if (request.requestedUser.userName === this.auth.claims().name) { - return true; - } - return false; - } } diff --git a/src/Ombi/ClientApp/app/requests/music/musicrequests.component.ts b/src/Ombi/ClientApp/app/requests/music/musicrequests.component.ts index 360b68c27..e70d44a38 100644 --- a/src/Ombi/ClientApp/app/requests/music/musicrequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/music/musicrequests.component.ts @@ -198,6 +198,13 @@ export class MusicRequestsComponent implements OnInit { this.loadInit(); } + public isRequestUser(request: IAlbumRequest) { + if (request.requestedUser.userName === this.auth.claims().name) { + return true; + } + return false; + } + // public subscribe(request: IAlbumRequest) { // request.subscribed = true; // this.requestService.subscribeToMovie(request.id) @@ -349,10 +356,4 @@ export class MusicRequestsComponent implements OnInit { ("url(" + req.cover + ")"); } - public isRequestUser(request: IAlbumRequest) { - if (request.requestedUser.userName === this.auth.claims().name) { - return true; - } - return false; - } } diff --git a/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts b/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts index ff451e5b5..bc792a55b 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts +++ b/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts @@ -111,6 +111,13 @@ export class TvRequestChildrenComponent { }); } + public isRequestUser(request: IChildRequests) { + if (request.requestedUser.userName === this.currentUser) { + return true; + } + return false; + } + private removeRequestFromUi(key: IChildRequests) { const index = this.childRequests.indexOf(key, 0); if (index > -1) { @@ -118,10 +125,4 @@ export class TvRequestChildrenComponent { } } - public isRequestUser(request: IChildRequests) { - if (request.requestedUser.userName === this.currentUser) { - return true; - } - return false; - } }