From 1fb6d0826147a513ffe3032a6baf02f434eff5af Mon Sep 17 00:00:00 2001 From: Dyson Parkes Date: Tue, 30 Apr 2019 09:47:24 +1200 Subject: [PATCH 01/11] Update README.md Remove iOS app link Add note about auto-approval --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 79aba2c3a..814bb9bb9 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,8 @@ Follow me developing Ombi! ___ Get it on Google Play - -Get it on App Store - +
+_**Note:** There is no longer an iOS app due to complications outside of our control._ ___ @@ -43,6 +42,7 @@ Here are some of the features Ombi V3 has: * Now working without crashes on Linux. * Lets users request Movies, Music, and TV Shows (whether it being the entire series, an entire season, or even single episodes.) * Easily manage your requests +* Allows you to set specific users to automatically have requests approved and added to the relevant service (Sonarr/Radarr/Lidarr/Couchpotato etc) * User management system (supports plex.tv, Emby and local accounts) * A landing page that will give you the availability of your Plex/Emby server and also add custom notification text to inform your users of downtime. * Allows your users to get custom notifications! @@ -50,7 +50,7 @@ Here are some of the features Ombi V3 has: * Will show if the request is already on plex or even if it's already monitored. * Automatically updates the status of requests when they are available on Plex/Emby * Slick, responsive and mobile friendly UI -* Ombi will automatically update itself :) +* Ombi will automatically update itself :) (YMMV) * Very fast! ### Integration From 224a6a4103f81ccfb1d580c8734f9b3898940610 Mon Sep 17 00:00:00 2001 From: Patrick Collins Date: Thu, 9 May 2019 03:34:13 -0400 Subject: [PATCH 02/11] fix album-request-permission error message --- src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs b/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs index 1cdf03955..d3ae80f62 100644 --- a/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs +++ b/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs @@ -32,15 +32,16 @@ namespace Ombi.Core.Rule.Rules { if (User.IsInRole(OmbiRoles.RequestTv) || User.IsInRole(OmbiRoles.AutoApproveTv)) return Task.FromResult(Success()); + return Task.FromResult(Fail("You do not have permissions to Request a TV Show")); } if (obj.RequestType == RequestType.Album) { if (User.IsInRole(OmbiRoles.RequestMusic) || User.IsInRole(OmbiRoles.AutoApproveMusic)) return Task.FromResult(Success()); + return Task.FromResult(Fail("You do not have permissions to Request an Album")); } - return Task.FromResult(Fail("You do not have permissions to Request a TV Show")); } } -} \ No newline at end of file +} From 6c5e359d6919466d253428ca54133341dceff027 Mon Sep 17 00:00:00 2001 From: Patrick Collins Date: Thu, 9 May 2019 04:23:04 -0400 Subject: [PATCH 03/11] add braces to all if statements --- src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs b/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs index d3ae80f62..a73fd67c8 100644 --- a/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs +++ b/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs @@ -19,26 +19,37 @@ namespace Ombi.Core.Rule.Rules public Task Execute(BaseRequest obj) { if (User.IsInRole(OmbiRoles.Admin)) + { return Task.FromResult(Success()); + } if (obj.RequestType == RequestType.Movie) { if (User.IsInRole(OmbiRoles.RequestMovie) || User.IsInRole(OmbiRoles.AutoApproveMovie)) + { return Task.FromResult(Success()); + } + return Task.FromResult(Fail("You do not have permissions to Request a Movie")); } if (obj.RequestType == RequestType.TvShow) { if (User.IsInRole(OmbiRoles.RequestTv) || User.IsInRole(OmbiRoles.AutoApproveTv)) + { return Task.FromResult(Success()); + } + return Task.FromResult(Fail("You do not have permissions to Request a TV Show")); } if (obj.RequestType == RequestType.Album) { if (User.IsInRole(OmbiRoles.RequestMusic) || User.IsInRole(OmbiRoles.AutoApproveMusic)) + { return Task.FromResult(Success()); + } + return Task.FromResult(Fail("You do not have permissions to Request an Album")); } From 3556e055df09c71f6dbec6213311250928394e4a Mon Sep 17 00:00:00 2001 From: Patrick Collins Date: Thu, 9 May 2019 19:45:47 -0400 Subject: [PATCH 04/11] add exception to handle unknown RequestType --- src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs b/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs index a73fd67c8..87c58b1cd 100644 --- a/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs +++ b/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs @@ -53,6 +53,7 @@ namespace Ombi.Core.Rule.Rules return Task.FromResult(Fail("You do not have permissions to Request an Album")); } + throw new InvalidDataException("Permission check failed: unknown RequestType"); } } } From 36f7527c46808fe8e03d18799bbf5d3b7fb58d23 Mon Sep 17 00:00:00 2001 From: Patrick Collins Date: Thu, 16 May 2019 23:21:58 -0400 Subject: [PATCH 05/11] import System.IO --- src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs b/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs index 87c58b1cd..678e5ff6a 100644 --- a/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs +++ b/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs @@ -1,4 +1,5 @@ using Ombi.Store.Entities; +using System.IO; using System.Security.Principal; using System.Threading.Tasks; using Ombi.Core.Rule.Interfaces; From cb8272cfe9df3f95bf7055379d79abd8d02e9123 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Tue, 21 May 2019 22:05:12 +0100 Subject: [PATCH 06/11] !wip --- src/Ombi.Api.Lidarr/ILidarrApi.cs | 2 +- src/Ombi.Api.Lidarr/LidarrApi.cs | 6 ++-- .../Models/AlbumByForeignId.cs | 31 +++++++++++++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 src/Ombi.Api.Lidarr/Models/AlbumByForeignId.cs diff --git a/src/Ombi.Api.Lidarr/ILidarrApi.cs b/src/Ombi.Api.Lidarr/ILidarrApi.cs index 0eac960d0..826cfdec3 100644 --- a/src/Ombi.Api.Lidarr/ILidarrApi.cs +++ b/src/Ombi.Api.Lidarr/ILidarrApi.cs @@ -23,6 +23,6 @@ namespace Ombi.Api.Lidarr Task> GetLanguageProfile(string apiKey, string baseUrl); Task Status(string apiKey, string baseUrl); Task AlbumSearch(int[] albumIds, string apiKey, string baseUrl); - Task AlbumInformation(string albumId, string apiKey, string baseUrl); + Task AlbumInformation(string albumId, string apiKey, string baseUrl); } } \ No newline at end of file diff --git a/src/Ombi.Api.Lidarr/LidarrApi.cs b/src/Ombi.Api.Lidarr/LidarrApi.cs index cb8db759e..13bf2e437 100644 --- a/src/Ombi.Api.Lidarr/LidarrApi.cs +++ b/src/Ombi.Api.Lidarr/LidarrApi.cs @@ -105,13 +105,13 @@ namespace Ombi.Api.Lidarr return Api.Request>(request); } - public async Task AlbumInformation(string albumId, string apiKey, string baseUrl) + public async Task AlbumInformation(string albumId, string apiKey, string baseUrl) { var request = new Request($"{ApiVersion}/album", baseUrl, HttpMethod.Get); request.AddQueryString("foreignAlbumId", albumId); AddHeaders(request, apiKey); - var albums = await Api.Request>(request); - return albums.Where(x => x.foreignAlbumId.Equals(albumId, StringComparison.InvariantCultureIgnoreCase)) + var albums = await Api.Request>(request); + return albums. .FirstOrDefault(); } diff --git a/src/Ombi.Api.Lidarr/Models/AlbumByForeignId.cs b/src/Ombi.Api.Lidarr/Models/AlbumByForeignId.cs new file mode 100644 index 000000000..27a479d2f --- /dev/null +++ b/src/Ombi.Api.Lidarr/Models/AlbumByForeignId.cs @@ -0,0 +1,31 @@ +using System; +using System.Net.Mime; + +namespace Ombi.Api.Lidarr.Models +{ + public class AlbumByForeignId + { + public string title { get; set; } + public string disambiguation { get; set; } + public string overview { get; set; } + public int artistId { get; set; } + public string foreignAlbumId { get; set; } + public bool monitored { get; set; } + public bool anyReleaseOk { get; set; } + public int profileId { get; set; } + public int duration { get; set; } + public string albumType { get; set; } + public object[] secondaryTypes { get; set; } + public int mediumCount { get; set; } + public Ratings ratings { get; set; } + public DateTime releaseDate { get; set; } + public Release[] releases { get; set; } + public object[] genres { get; set; } + public Medium[] media { get; set; } + public Artist artist { get; set; } + public Image[] images { get; set; } + public Link[] links { get; set; } + public Statistics statistics { get; set; } + public int id { get; set; } + } +} \ No newline at end of file From 88fc10ea6e7edae1a810a360d751e68b06ee4bdd Mon Sep 17 00:00:00 2001 From: tidusjar Date: Tue, 21 May 2019 22:09:23 +0100 Subject: [PATCH 07/11] added stalebot --- .github/stale.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 000000000..0116dea51 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,23 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security + - bug / issue + - help wanted + - possible feature + - planned + - in progress + - enchancement +# Label to use when marking an issue as stale +staleLabel: wontfix +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false \ No newline at end of file From 4cb6533cfbf6b59197c3aaabe8a6f04a43f643c3 Mon Sep 17 00:00:00 2001 From: Jamie Date: Wed, 22 May 2019 08:07:28 +0100 Subject: [PATCH 08/11] Update stale.yml --- .github/stale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/stale.yml b/.github/stale.yml index 0116dea51..b3deb4a73 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -11,7 +11,7 @@ exemptLabels: - possible feature - planned - in progress - - enchancement + - enhancement # Label to use when marking an issue as stale staleLabel: wontfix # Comment to post when marking an issue as stale. Set to `false` to disable @@ -20,4 +20,4 @@ markComment: > recent activity. It will be closed if no further activity occurs. Thank you for your contributions. # Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false \ No newline at end of file +closeComment: false From ba1e96e5c0e123138db771112022134d38bb0141 Mon Sep 17 00:00:00 2001 From: Austin Jackson Date: Thu, 23 May 2019 13:33:36 -0500 Subject: [PATCH 09/11] Swagger index prepends configured baseurl --- src/Ombi/Startup.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/Ombi/Startup.cs diff --git a/src/Ombi/Startup.cs b/src/Ombi/Startup.cs old mode 100644 new mode 100755 index bbf56c517..01a4ceb2e --- a/src/Ombi/Startup.cs +++ b/src/Ombi/Startup.cs @@ -217,7 +217,14 @@ namespace Ombi app.UseSwagger(); app.UseSwaggerUI(c => { - c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); + if (settings.BaseUrl.HasValue()) + { + c.SwaggerEndpoint(settings.BaseUrl + "/swagger/v1/swagger.json", "My API V1"); + } + else + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); + } }); app.UseMvc(routes => From 3708c161ddeb59615a51848882b1d6935ccb46ca Mon Sep 17 00:00:00 2001 From: Austin Jackson Date: Thu, 23 May 2019 14:00:54 -0500 Subject: [PATCH 10/11] Use string interpolation --- src/Ombi/Startup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ombi/Startup.cs b/src/Ombi/Startup.cs index 01a4ceb2e..0abc63b00 100755 --- a/src/Ombi/Startup.cs +++ b/src/Ombi/Startup.cs @@ -219,7 +219,7 @@ namespace Ombi { if (settings.BaseUrl.HasValue()) { - c.SwaggerEndpoint(settings.BaseUrl + "/swagger/v1/swagger.json", "My API V1"); + c.SwaggerEndpoint($"{settings.BaseUrl}/swagger/v1/swagger.json", "My API V1"); } else { From c1db84e17c2db7eddb82cd312483584bbbce3b7c Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sat, 1 Jun 2019 21:21:57 +0100 Subject: [PATCH 11/11] Fixed --- src/Ombi.Api.Lidarr/LidarrApi.cs | 3 +-- src/Ombi.Core/Engine/MusicSearchEngine.cs | 11 +++++------ src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Ombi.Api.Lidarr/LidarrApi.cs b/src/Ombi.Api.Lidarr/LidarrApi.cs index 13bf2e437..61752e9b8 100644 --- a/src/Ombi.Api.Lidarr/LidarrApi.cs +++ b/src/Ombi.Api.Lidarr/LidarrApi.cs @@ -111,8 +111,7 @@ namespace Ombi.Api.Lidarr request.AddQueryString("foreignAlbumId", albumId); AddHeaders(request, apiKey); var albums = await Api.Request>(request); - return albums. - .FirstOrDefault(); + return albums.FirstOrDefault(); } diff --git a/src/Ombi.Core/Engine/MusicSearchEngine.cs b/src/Ombi.Core/Engine/MusicSearchEngine.cs index c8d285766..da41d5bf1 100644 --- a/src/Ombi.Core/Engine/MusicSearchEngine.cs +++ b/src/Ombi.Core/Engine/MusicSearchEngine.cs @@ -157,7 +157,7 @@ namespace Ombi.Core.Engine // TODO - private async Task MapIntoAlbumVm(AlbumResponse a, LidarrSettings settings) + private async Task MapIntoAlbumVm(AlbumByForeignId a, LidarrSettings settings) { var vm = new SearchAlbumViewModel { @@ -167,7 +167,10 @@ namespace Ombi.Core.Engine ReleaseDate = a.releaseDate, Title = a.title, Disk = a.images?.FirstOrDefault(x => x.coverType.Equals("disc"))?.url?.Replace("http", "https"), - Genres = a.genres + Genres = a.genres, + AlbumType = a.albumType, + ArtistName = a.artist.artistName, + ForeignArtistId = a.artist.foreignArtistId, }; if (a.artistId > 0) { @@ -185,10 +188,6 @@ namespace Ombi.Core.Engine } vm.Cover = a.images?.FirstOrDefault(x => x.coverType.Equals("cover"))?.url?.Replace("http", "https"); - if (vm.Cover.IsNullOrEmpty()) - { - //vm.Cover = a.remoteCover; - } await Rules.StartSpecificRules(vm, SpecificRules.LidarrAlbum); diff --git a/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs b/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs index eb974eeec..2b316cfc5 100644 --- a/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs +++ b/src/Ombi.Core/Rule/Rules/Request/CanRequestRule.cs @@ -40,7 +40,7 @@ namespace Ombi.Core.Rule.Rules.Request { if (await _manager.IsInRoleAsync(user, OmbiRoles.RequestTv) || await _manager.IsInRoleAsync(user, OmbiRoles.AutoApproveTv)) { - return TSuccess(); + return Success(); } return Fail("You do not have permissions to Request a TV Show");