diff --git a/src/Ombi.Schedule/Jobs/Ombi/AutoDeleteRequests.cs b/src/Ombi.Schedule/Jobs/Ombi/AutoDeleteRequests.cs index 6625a3bbb..a2a7e4ed1 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/AutoDeleteRequests.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/AutoDeleteRequests.cs @@ -16,14 +16,16 @@ namespace Ombi.Schedule.Jobs.Ombi private readonly ISettingsService _ombiSettings; private readonly IMovieRequestRepository _movieRequests; private readonly ITvRequestRepository _tvRequestRepository; + private readonly IMusicRequestRepository _musicRequestRepository; private readonly ILogger _logger; public AutoDeleteRequests(ISettingsService ombiSettings, IMovieRequestRepository movieRequest, - ILogger logger, ITvRequestRepository tvRequestRepository) + ILogger logger, ITvRequestRepository tvRequestRepository, IMusicRequestRepository musicRequestRepository) { _ombiSettings = ombiSettings; _movieRequests = movieRequest; _tvRequestRepository = tvRequestRepository; + _musicRequestRepository = _musicRequestRepository; _logger = logger; } @@ -37,6 +39,7 @@ namespace Ombi.Schedule.Jobs.Ombi var date = DateTime.UtcNow.AddDays(-settings.AutoDeleteAfterDays).Date; await ProcessMovieRequests(date); await ProcessTvRequests(date); + await ProcessMusicRequests(date); } private async Task ProcessMovieRequests(DateTime date) @@ -66,6 +69,20 @@ namespace Ombi.Schedule.Jobs.Ombi await _tvRequestRepository.DeleteRange(parentRequests); } + private async Task ProcessMusicRequests(DateTime date) + { + var requestsToDelete = await _musicRequestRepository.GetAll().Where(x => x.Available && x.MarkedAsAvailable.HasValue && x.MarkedAsAvailable.Value < date).ToListAsync(); + + _logger.LogInformation($"Deleting {requestsToDelete.Count} music requests that have now been scheduled for deletion, All available requests before {date::MM/dd/yyyy} will be deleted"); + foreach (var r in requestsToDelete) + { + _logger.LogInformation($"Deleting music title {r.Title} as it was approved on {r.MarkedAsApproved:MM/dd/yyyy hh:mm tt}"); + } + + await _musicRequestRepository.DeleteRange(requestsToDelete); + + } + private bool _disposed; protected virtual void Dispose(bool disposing) diff --git a/src/Ombi/.vscode/settings.json b/src/Ombi/.vscode/settings.json index 23bdd881e..f8ea48b8f 100644 --- a/src/Ombi/.vscode/settings.json +++ b/src/Ombi/.vscode/settings.json @@ -20,6 +20,7 @@ "mass-email", "issues", "emby", - "availability-rules" + "availability-rules", + "details" ] } diff --git a/src/Ombi/ClientApp/angular.json b/src/Ombi/ClientApp/angular.json index 4fda4b82b..066a75be5 100644 --- a/src/Ombi/ClientApp/angular.json +++ b/src/Ombi/ClientApp/angular.json @@ -34,11 +34,8 @@ "node_modules/@fortawesome/fontawesome-free/scss/brands.scss", "node_modules/primeng/resources/primeng.min.css", "node_modules/primeicons/primeicons.css", - "node_modules/please-wait/src/please-wait.scss", "node_modules/@fullcalendar/core/main.min.css", - "node_modules/@fullcalendar/daygrid/main.min.css", - "node_modules/spinkit/scss/spinners/11-folding-cube.scss", - "node_modules/spinkit/scss/spinkit.scss" + "node_modules/@fullcalendar/daygrid/main.min.css" ], "scripts": [ "node_modules/jquery/dist/jquery.min.js", diff --git a/src/Ombi/ClientApp/package.json b/src/Ombi/ClientApp/package.json index c68ed3782..7ee4f64e5 100644 --- a/src/Ombi/ClientApp/package.json +++ b/src/Ombi/ClientApp/package.json @@ -52,13 +52,11 @@ "ngx-infinite-scroll": "^9.0.0", "ngx-moment": "^3.0.1", "ngx-order-pipe": "^2.1.1", - "please-wait": "^0.0.5", "popper.js": "^1.14.3", "primeicons": "^4.1.0", "primeng": "^12.2.0", "rxjs": "^7.4.0", "sass-recursive-map-merge": "^1.0.1", - "spinkit": "^1.2.5", "store": "^2.0.12", "ts-md5": "^1.2.7", "tslib": "^1.10.0", diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html index 3cfe6383a..2e807547c 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html @@ -72,6 +72,12 @@ {{'Common.Request' | translate }} + + + +