diff --git a/src/Ombi.Core/Engine/IMusicRequestEngine.cs b/src/Ombi.Core/Engine/IMusicRequestEngine.cs index 5caba8a34..02a051343 100644 --- a/src/Ombi.Core/Engine/IMusicRequestEngine.cs +++ b/src/Ombi.Core/Engine/IMusicRequestEngine.cs @@ -12,7 +12,7 @@ namespace Ombi.Core.Engine { TaskApproveAlbum(AlbumRequest request); Task ApproveAlbumById(int requestId); - Task DenyAlbumById(int modelId); + Task DenyAlbumById(int modelId, string reason); Task> GetRequests(); Task> GetRequests(int count, int position, OrderFilterModel orderFilter); Task GetTotal(); diff --git a/src/Ombi.Core/Engine/Interfaces/IMovieRequestEngine.cs b/src/Ombi.Core/Engine/Interfaces/IMovieRequestEngine.cs index bb8b9e64d..d741dc8bc 100644 --- a/src/Ombi.Core/Engine/Interfaces/IMovieRequestEngine.cs +++ b/src/Ombi.Core/Engine/Interfaces/IMovieRequestEngine.cs @@ -17,6 +17,6 @@ namespace Ombi.Core.Engine.Interfaces Task UpdateMovieRequest(MovieRequests request); Task ApproveMovie(MovieRequests request); Task ApproveMovieById(int requestId); - Task DenyMovieById(int modelId); + Task DenyMovieById(int modelId, string denyReason); } } \ No newline at end of file diff --git a/src/Ombi.Core/Engine/Interfaces/ITvRequestEngine.cs b/src/Ombi.Core/Engine/Interfaces/ITvRequestEngine.cs index 36ae7da61..63de72bd1 100644 --- a/src/Ombi.Core/Engine/Interfaces/ITvRequestEngine.cs +++ b/src/Ombi.Core/Engine/Interfaces/ITvRequestEngine.cs @@ -12,7 +12,7 @@ namespace Ombi.Core.Engine.Interfaces Task RemoveTvRequest(int requestId); Task GetTvRequest(int requestId); Task RequestTvShow(TvRequestViewModel tv); - Task DenyChildRequest(int requestId); + Task DenyChildRequest(int requestId, string reason); Task> GetRequestsLite(int count, int position, OrderFilterModel type); Task> SearchTvRequest(string search); Task UpdateTvRequest(TvRequests request); diff --git a/src/Ombi.Core/Engine/MovieRequestEngine.cs b/src/Ombi.Core/Engine/MovieRequestEngine.cs index 16fd7667b..fcbb0ac3b 100644 --- a/src/Ombi.Core/Engine/MovieRequestEngine.cs +++ b/src/Ombi.Core/Engine/MovieRequestEngine.cs @@ -305,7 +305,7 @@ namespace Ombi.Core.Engine return await ApproveMovie(request); } - public async Task DenyMovieById(int modelId) + public async Task DenyMovieById(int modelId, string denyReason) { var request = await MovieRepository.Find(modelId); if (request == null) @@ -317,6 +317,7 @@ namespace Ombi.Core.Engine } request.Denied = true; + request.DeniedReason = denyReason; // We are denying a request NotificationHelper.Notify(request, NotificationType.RequestDeclined); await MovieRepository.Update(request); diff --git a/src/Ombi.Core/Engine/MusicRequestEngine.cs b/src/Ombi.Core/Engine/MusicRequestEngine.cs index 185f86c37..66be18cf6 100644 --- a/src/Ombi.Core/Engine/MusicRequestEngine.cs +++ b/src/Ombi.Core/Engine/MusicRequestEngine.cs @@ -299,7 +299,7 @@ namespace Ombi.Core.Engine return await ApproveAlbum(request); } - public async Task DenyAlbumById(int modelId) + public async Task DenyAlbumById(int modelId, string reason) { var request = await MusicRepository.Find(modelId); if (request == null) @@ -311,6 +311,7 @@ namespace Ombi.Core.Engine } request.Denied = true; + request.DeniedReason = reason; // We are denying a request NotificationHelper.Notify(request, NotificationType.RequestDeclined); await MusicRepository.Update(request); diff --git a/src/Ombi.Core/Engine/TvRequestEngine.cs b/src/Ombi.Core/Engine/TvRequestEngine.cs index 290bedd6b..ddcc22d7b 100644 --- a/src/Ombi.Core/Engine/TvRequestEngine.cs +++ b/src/Ombi.Core/Engine/TvRequestEngine.cs @@ -403,7 +403,7 @@ namespace Ombi.Core.Engine }; } - public async Task DenyChildRequest(int requestId) + public async Task DenyChildRequest(int requestId, string reason) { var request = await TvRepository.GetChild().FirstOrDefaultAsync(x => x.Id == requestId); if (request == null) @@ -414,6 +414,7 @@ namespace Ombi.Core.Engine }; } request.Denied = true; + request.DeniedReason = reason; await TvRepository.UpdateChild(request); NotificationHelper.Notify(request, NotificationType.RequestDeclined); return new RequestEngineResult diff --git a/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs b/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs index 0d7c56372..e125d9f59 100644 --- a/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs @@ -1,15 +1,11 @@ -using System; -using System.Linq; -using System.Linq.Expressions; +using System.Linq; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Query; using Ombi.Core.Models.Search; using Ombi.Core.Rule.Interfaces; using Ombi.Helpers; using Ombi.Store.Entities; using Ombi.Store.Repository; -using Ombi.Store.Repository.Requests; namespace Ombi.Core.Rule.Rules.Search { diff --git a/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs b/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs index 575d49d62..a9458fb23 100644 --- a/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs @@ -1,13 +1,10 @@ -using System; -using System.Linq; +using System.Linq; using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; using Ombi.Core.Models.Search; using Ombi.Core.Rule.Interfaces; using Ombi.Helpers; using Ombi.Store.Entities; using Ombi.Store.Repository; -using Ombi.Store.Repository.Requests; namespace Ombi.Core.Rule.Rules.Search { diff --git a/src/Ombi/Controllers/External/PlexController.cs b/src/Ombi/Controllers/External/PlexController.cs index f0492b580..9f7df05ad 100644 --- a/src/Ombi/Controllers/External/PlexController.cs +++ b/src/Ombi/Controllers/External/PlexController.cs @@ -185,7 +185,6 @@ namespace Ombi.Controllers.External /// /// Gets the plex servers. /// - /// The u. /// [HttpGet("servers")] [PowerUser] diff --git a/src/Ombi/Controllers/IdentityController.cs b/src/Ombi/Controllers/IdentityController.cs index f963db0b8..ec884ace6 100644 --- a/src/Ombi/Controllers/IdentityController.cs +++ b/src/Ombi/Controllers/IdentityController.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading.Tasks; -using System.Web; using AutoMapper; using Hangfire; using Microsoft.AspNetCore.Authorization; @@ -11,10 +10,8 @@ using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; using Ombi.Api.Plex; using Ombi.Attributes; -using Ombi.Config; using Ombi.Core.Authentication; using Ombi.Core.Engine; using Ombi.Core.Engine.Interfaces; @@ -45,6 +42,7 @@ namespace Ombi.Controllers /// [ApiV1] [Produces("application/json")] + [ApiController] public class IdentityController : Controller { public IdentityController(OmbiUserManager user, IMapper mapper, RoleManager rm, IEmailProvider prov, @@ -935,6 +933,8 @@ namespace Ombi.Controllers } [HttpPost("NotificationPreferences")] + [ProducesResponseType(404)] + [ProducesResponseType(401)] public async Task AddUserNotificationPreference([FromBody] List preferences) { foreach (var pref in preferences) diff --git a/src/Ombi/Controllers/ImagesController.cs b/src/Ombi/Controllers/ImagesController.cs index acbdfb9bc..39de92c71 100644 --- a/src/Ombi/Controllers/ImagesController.cs +++ b/src/Ombi/Controllers/ImagesController.cs @@ -16,7 +16,8 @@ namespace Ombi.Controllers { [ApiV1] [Produces("application/json")] - public class ImagesController : Controller + [ApiController] + public class ImagesController : ControllerBase { public ImagesController(IFanartTvApi fanartTvApi, IApplicationConfigRepository config, IOptions options, ICacheService c) diff --git a/src/Ombi/Controllers/IssuesController.cs b/src/Ombi/Controllers/IssuesController.cs index a228a63ef..1a5af5446 100644 --- a/src/Ombi/Controllers/IssuesController.cs +++ b/src/Ombi/Controllers/IssuesController.cs @@ -23,7 +23,8 @@ namespace Ombi.Controllers [ApiV1] [Authorize] [Produces("application/json")] - public class IssuesController : Controller + [ApiController] + public class IssuesController : ControllerBase { public IssuesController(IRepository categories, IRepository issues, IRepository comments, UserManager userManager, INotificationService notify) diff --git a/src/Ombi/Controllers/JobController.cs b/src/Ombi/Controllers/JobController.cs index a89346250..cec8d2c45 100644 --- a/src/Ombi/Controllers/JobController.cs +++ b/src/Ombi/Controllers/JobController.cs @@ -16,7 +16,8 @@ namespace Ombi.Controllers [ApiV1] [Admin] [Produces("application/json")] - public class JobController : Controller + [ApiController] + public class JobController : ControllerBase { public JobController(IOmbiAutomaticUpdater updater, IPlexUserImporter userImporter, ICacheService mem, IEmbyUserImporter embyImporter, IPlexContentSync plexContentSync, diff --git a/src/Ombi/Controllers/LandingPageController.cs b/src/Ombi/Controllers/LandingPageController.cs index e495f2cf3..6b1c27656 100644 --- a/src/Ombi/Controllers/LandingPageController.cs +++ b/src/Ombi/Controllers/LandingPageController.cs @@ -14,7 +14,8 @@ namespace Ombi.Controllers [ApiV1] [AllowAnonymous] [Produces("application/json")] - public class LandingPageController + [ApiController] + public class LandingPageController : ControllerBase { public LandingPageController(ISettingsService plex, ISettingsService emby, IPlexApi plexApi, IEmbyApi embyApi) diff --git a/src/Ombi/Controllers/LoggingController.cs b/src/Ombi/Controllers/LoggingController.cs index c6879da39..c944825af 100644 --- a/src/Ombi/Controllers/LoggingController.cs +++ b/src/Ombi/Controllers/LoggingController.cs @@ -9,7 +9,8 @@ namespace Ombi.Controllers [Authorize] [ApiV1] [Produces("application/json")] - public class LoggingController : Controller + [ApiController] + public class LoggingController : ControllerBase { public LoggingController(ILogger logger) { diff --git a/src/Ombi/Controllers/MobileController.cs b/src/Ombi/Controllers/MobileController.cs index 70a6f1053..c3b15a910 100644 --- a/src/Ombi/Controllers/MobileController.cs +++ b/src/Ombi/Controllers/MobileController.cs @@ -17,7 +17,8 @@ namespace Ombi.Controllers [ApiV1] [Authorize] [Produces("application/json")] - public class MobileController : Controller + [ApiController] + public class MobileController : ControllerBase { public MobileController(IRepository notification, OmbiUserManager user) { @@ -30,6 +31,8 @@ namespace Ombi.Controllers [HttpPost("Notification")] [ApiExplorerSettings(IgnoreApi = true)] + [ProducesResponseType(400)] + [ProducesResponseType(200)] public async Task AddNotitficationId([FromBody] NotificationIdBody body) { if (body?.PlayerId.HasValue() ?? false) diff --git a/src/Ombi/Controllers/MusicRequestController.cs b/src/Ombi/Controllers/MusicRequestController.cs index fee0cc39d..ea3f615f0 100644 --- a/src/Ombi/Controllers/MusicRequestController.cs +++ b/src/Ombi/Controllers/MusicRequestController.cs @@ -17,7 +17,8 @@ namespace Ombi.Controllers [Authorize] [Route("api/v1/request/music")] [Produces("application/json")] - public class MusicRequestController : Controller + [ApiController] + public class MusicRequestController : ControllerBase { public MusicRequestController(IMusicRequestEngine engine, IVoteEngine voteEngine, ILogger log) { @@ -154,9 +155,9 @@ namespace Ombi.Controllers /// [HttpPut("deny")] [PowerUser] - public async Task Deny([FromBody] AlbumUpdateModel model) + public async Task Deny([FromBody] DenyAlbumModel model) { - return await _engine.DenyAlbumById(model.Id); + return await _engine.DenyAlbumById(model.Id, model.Reason); } /// diff --git a/src/Ombi/Controllers/NotificationsController.cs b/src/Ombi/Controllers/NotificationsController.cs index a881a89d3..8fe453d3d 100644 --- a/src/Ombi/Controllers/NotificationsController.cs +++ b/src/Ombi/Controllers/NotificationsController.cs @@ -36,7 +36,8 @@ namespace Ombi.Controllers [Admin] [ApiV1] [Produces("application/json")] - public class NotificationsController : Controller + [ApiController] + public class NotificationsController : ControllerBase { public NotificationsController(IMassEmailSender sender) { diff --git a/src/Ombi/Controllers/PlexOAuthController.cs b/src/Ombi/Controllers/PlexOAuthController.cs index 2aad2a2a9..fe78435c9 100644 --- a/src/Ombi/Controllers/PlexOAuthController.cs +++ b/src/Ombi/Controllers/PlexOAuthController.cs @@ -20,6 +20,7 @@ namespace Ombi.Controllers [ApiExplorerSettings(IgnoreApi = true)] [ApiV1] [AllowAnonymous] + [ApiController] public class PlexOAuthController : Controller { public PlexOAuthController(IPlexOAuthManager manager, IPlexApi plexApi, ISettingsService plexSettings, diff --git a/src/Ombi/Controllers/RecentlyAddedController.cs b/src/Ombi/Controllers/RecentlyAddedController.cs index fb4446efd..a56750449 100644 --- a/src/Ombi/Controllers/RecentlyAddedController.cs +++ b/src/Ombi/Controllers/RecentlyAddedController.cs @@ -12,7 +12,8 @@ namespace Ombi.Controllers [ApiV1] [Produces("application/json")] [Authorize] - public class RecentlyAddedController : Controller + [ApiController] + public class RecentlyAddedController : ControllerBase { public RecentlyAddedController(IRecentlyAddedEngine engine) { diff --git a/src/Ombi/Controllers/RequestController.cs b/src/Ombi/Controllers/RequestController.cs index 9e13e1c90..b3cccf9d1 100644 --- a/src/Ombi/Controllers/RequestController.cs +++ b/src/Ombi/Controllers/RequestController.cs @@ -20,7 +20,8 @@ namespace Ombi.Controllers [Authorize] [ApiV1] [Produces("application/json")] - public class RequestController : Controller + [ApiController] + public class RequestController : ControllerBase { public RequestController(IMovieRequestEngine engine, ITvRequestEngine tvRequestEngine, IVoteEngine vote, ILogger log) @@ -118,9 +119,8 @@ namespace Ombi.Controllers } /// - /// Deletes the specified movie request. + /// Deletes the all movie request. /// - /// The request identifier. /// [HttpDelete("movie/all")] [PowerUser] @@ -184,9 +184,9 @@ namespace Ombi.Controllers /// [HttpPut("movie/deny")] [PowerUser] - public async Task DenyMovie([FromBody] MovieUpdateModel model) + public async Task DenyMovie([FromBody] DenyMovieModel model) { - return await MovieRequestEngine.DenyMovieById(model.Id); + return await MovieRequestEngine.DenyMovieById(model.Id, model.Reason); } /// @@ -372,9 +372,9 @@ namespace Ombi.Controllers /// [HttpPut("tv/deny")] [PowerUser] - public async Task DenyChild([FromBody] TvUpdateModel model) + public async Task DenyChild([FromBody] DenyTvModel model) { - return await TvRequestEngine.DenyChildRequest(model.Id); + return await TvRequestEngine.DenyChildRequest(model.Id, model.Reason); } /// diff --git a/src/Ombi/Controllers/RequestRetryController.cs b/src/Ombi/Controllers/RequestRetryController.cs index b8ad2759e..12208978a 100644 --- a/src/Ombi/Controllers/RequestRetryController.cs +++ b/src/Ombi/Controllers/RequestRetryController.cs @@ -16,6 +16,7 @@ namespace Ombi.Controllers [ApiV1] [Admin] [Produces("application/json")] + [ApiController] public class RequestRetryController : Controller { public RequestRetryController(IRepository requestQueue, IMovieRequestRepository movieRepo, diff --git a/src/Ombi/Controllers/SearchController.cs b/src/Ombi/Controllers/SearchController.cs index 2a7327481..0a0d08ea1 100644 --- a/src/Ombi/Controllers/SearchController.cs +++ b/src/Ombi/Controllers/SearchController.cs @@ -17,7 +17,8 @@ namespace Ombi.Controllers [Authorize] [ApiV1] [Produces("application/json")] - public class SearchController : Controller + [ApiController] + public class SearchController : ControllerBase { public SearchController(IMovieEngine movie, ITvSearchEngine tvEngine, ILogger logger, IMusicSearchEngine music) { diff --git a/src/Ombi/Controllers/SettingsController.cs b/src/Ombi/Controllers/SettingsController.cs index 6b9476ce6..a02e966c1 100644 --- a/src/Ombi/Controllers/SettingsController.cs +++ b/src/Ombi/Controllers/SettingsController.cs @@ -37,7 +37,8 @@ namespace Ombi.Controllers [Admin] [ApiV1] [Produces("application/json")] - public class SettingsController : Controller + [ApiController] + public class SettingsController : ControllerBase { public SettingsController(ISettingsResolver resolver, IMapper mapper, diff --git a/src/Ombi/Controllers/StatsController.cs b/src/Ombi/Controllers/StatsController.cs index 0d871d80f..08d98b2c3 100644 --- a/src/Ombi/Controllers/StatsController.cs +++ b/src/Ombi/Controllers/StatsController.cs @@ -10,7 +10,8 @@ namespace Ombi.Controllers [Admin] [Authorize] [Produces("application/json")] - public class StatsController : Controller + [ApiController] + public class StatsController : ControllerBase { public StatsController(IUserStatsEngine eng) { diff --git a/src/Ombi/Controllers/StatusController.cs b/src/Ombi/Controllers/StatusController.cs index bc0fd3908..a3e36fb43 100644 --- a/src/Ombi/Controllers/StatusController.cs +++ b/src/Ombi/Controllers/StatusController.cs @@ -37,7 +37,8 @@ namespace Ombi.Controllers { [ApiV1] [Produces("application/json")] - public class StatusController : Controller + [ApiController] + public class StatusController : ControllerBase { public StatusController(ISettingsService ombi) { diff --git a/src/Ombi/Controllers/TokenController.cs b/src/Ombi/Controllers/TokenController.cs index 75e40639f..be7ea56c6 100644 --- a/src/Ombi/Controllers/TokenController.cs +++ b/src/Ombi/Controllers/TokenController.cs @@ -22,7 +22,8 @@ namespace Ombi.Controllers { [ApiV1] [Produces("application/json")] - public class TokenController : Controller + [ApiController] + public class TokenController : ControllerBase { public TokenController(OmbiUserManager um, IOptions ta, IAuditRepository audit, ITokenRepository token, IPlexOAuthManager oAuthManager) @@ -46,6 +47,7 @@ namespace Ombi.Controllers /// The model. /// [HttpPost] + [ProducesResponseType(401)] public async Task GetToken([FromBody] UserAuthModel model) { if (!model.UsePlexOAuth) @@ -100,6 +102,8 @@ namespace Ombi.Controllers /// Returns the Token for the Ombi User if we can match the Plex user with a valid Ombi User /// [HttpPost("plextoken")] + [ProducesResponseType(401)] + [ProducesResponseType(400)] public async Task GetTokenWithPlexToken([FromBody] PlexTokenAuthentication model) { if (!model.PlexToken.HasValue()) @@ -161,6 +165,7 @@ namespace Ombi.Controllers } [HttpGet("{pinId:int}")] + [ProducesResponseType(401)] public async Task OAuth(int pinId) { var accessToken = await _plexOAuthManager.GetAccessTokenFromPin(pinId); @@ -201,6 +206,7 @@ namespace Ombi.Controllers /// /// [HttpPost("refresh")] + [ProducesResponseType(401)] public IActionResult RefreshToken([FromBody] TokenRefresh token) { diff --git a/src/Ombi/Controllers/UpdateController.cs b/src/Ombi/Controllers/UpdateController.cs index 0a6c3b80c..3fb1c7382 100644 --- a/src/Ombi/Controllers/UpdateController.cs +++ b/src/Ombi/Controllers/UpdateController.cs @@ -11,7 +11,8 @@ namespace Ombi.Controllers [ApiV1] [Produces("application/json")] [AllowAnonymous] - public class UpdateController : Controller + [ApiController] + public class UpdateController : ControllerBase { public UpdateController(ICacheService cache, IChangeLogProcessor processor) { diff --git a/src/Ombi/Controllers/VoteController.cs b/src/Ombi/Controllers/VoteController.cs index 70ea0ec8c..8c7c88396 100644 --- a/src/Ombi/Controllers/VoteController.cs +++ b/src/Ombi/Controllers/VoteController.cs @@ -13,7 +13,8 @@ namespace Ombi.Controllers [ApiV1] [Authorize] [Produces("application/json")] - public class VoteController : Controller + [ApiController] + public class VoteController : ControllerBase { public VoteController(IVoteEngine engine) { diff --git a/src/Ombi/Models/DenyAlbumMOdel.cs b/src/Ombi/Models/DenyAlbumMOdel.cs new file mode 100644 index 000000000..0b9346ead --- /dev/null +++ b/src/Ombi/Models/DenyAlbumMOdel.cs @@ -0,0 +1,33 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2017 Jamie Rees +// File: MovieUpdateModel.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +namespace Ombi.Core.Models.Requests +{ + public class DenyAlbumModel: AlbumUpdateModel + { + public string Reason { get; set; } + } +} \ No newline at end of file diff --git a/src/Ombi/Models/DenyMovieModel.cs b/src/Ombi/Models/DenyMovieModel.cs new file mode 100644 index 000000000..88ae5c5db --- /dev/null +++ b/src/Ombi/Models/DenyMovieModel.cs @@ -0,0 +1,33 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2017 Jamie Rees +// File: MovieUpdateModel.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +namespace Ombi.Core.Models.Requests +{ + public class DenyMovieModel : MovieUpdateModel + { + public string Reason { get; set; } + } +} \ No newline at end of file diff --git a/src/Ombi/Models/DenyTvModel.cs b/src/Ombi/Models/DenyTvModel.cs new file mode 100644 index 000000000..5bc57be0b --- /dev/null +++ b/src/Ombi/Models/DenyTvModel.cs @@ -0,0 +1,33 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2017 Jamie Rees +// File: TvUpdateModel.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +namespace Ombi.Models +{ + public class DenyTvModel: TvUpdateModel + { + public string Reason { get; set; } + } +} \ No newline at end of file diff --git a/src/Ombi/Ombi.csproj b/src/Ombi/Ombi.csproj index cf3bff48f..679d8dc7e 100644 --- a/src/Ombi/Ombi.csproj +++ b/src/Ombi/Ombi.csproj @@ -72,6 +72,8 @@ + + diff --git a/src/Ombi/Startup.cs b/src/Ombi/Startup.cs index 7e3f48c8f..b08f93045 100644 --- a/src/Ombi/Startup.cs +++ b/src/Ombi/Startup.cs @@ -96,6 +96,8 @@ namespace Ombi options.User.AllowedUserNameCharacters = string.Empty; }); + + services.AddHealthChecks(); services.AddMemoryCache(); services.AddJwtAuthentication(Configuration); @@ -150,6 +152,7 @@ namespace Ombi var ctx = serviceProvider.GetService(); loggerFactory.AddSerilog(); + app.UseHealthChecks("/health"); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage();