mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
wip
This commit is contained in:
parent
8cf7eb0e7b
commit
4c4f8f373d
5 changed files with 86 additions and 15 deletions
|
@ -62,17 +62,17 @@ stages:
|
|||
$response = Invoke-WebRequest -Uri "https://ombireleasenote.azurewebsites.net/api/ReleaseNotesFunction?buildId=$(Build.BuildId)"
|
||||
Write-Host "##vso[task.setvariable variable=ReleaseNotes;]$response"
|
||||
|
||||
- task: GitHubRelease@1
|
||||
inputs:
|
||||
gitHubConnection: 'github.com_tidusjar'
|
||||
repositoryName: 'tidusjar/Ombi'
|
||||
action: 'create'
|
||||
target: '$(Build.SourceVersion)'
|
||||
tagSource: 'userSpecifiedTag'
|
||||
tag: '$(gitTag)'
|
||||
isDraft: true
|
||||
changeLogCompareToRelease: 'lastNonDraftRelease'
|
||||
changeLogType: 'commitBased'
|
||||
# - task: GitHubRelease@1
|
||||
# inputs:
|
||||
# gitHubConnection: 'github.com_tidusjar'
|
||||
# repositoryName: 'tidusjar/Ombi'
|
||||
# action: 'create'
|
||||
# target: '$(Build.SourceVersion)'
|
||||
# tagSource: 'userSpecifiedTag'
|
||||
# tag: '$(gitTag)'
|
||||
# isDraft: true
|
||||
# changeLogCompareToRelease: 'lastNonDraftRelease'
|
||||
# changeLogType: 'commitBased'
|
||||
|
||||
- task: GitHubRelease@1
|
||||
inputs:
|
||||
|
@ -90,4 +90,4 @@ stages:
|
|||
isPreRelease: true
|
||||
changeLogCompareToRelease: 'lastNonDraftRelease'
|
||||
changeLogType: 'commitBased'
|
||||
condition: and(succeeded(), eq(variables['PublishToGithub'], 'true'))
|
||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/feature/v4'))
|
||||
|
|
69
src/Ombi.Schedule/Jobs/Ombi/AutoDeleteRequests.cs
Normal file
69
src/Ombi.Schedule/Jobs/Ombi/AutoDeleteRequests.cs
Normal file
|
@ -0,0 +1,69 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Ombi.Core;
|
||||
using Ombi.Core.Senders;
|
||||
using Ombi.Core.Settings;
|
||||
using Ombi.Settings.Settings.Models;
|
||||
using Ombi.Store.Entities;
|
||||
using Ombi.Store.Repository;
|
||||
using Ombi.Store.Repository.Requests;
|
||||
using Quartz;
|
||||
|
||||
namespace Ombi.Schedule.Jobs.Ombi
|
||||
{
|
||||
public interface IAutoDeleteRequests : IBaseJob { }
|
||||
public class AutoDeleteRequests : IAutoDeleteRequests
|
||||
{
|
||||
|
||||
private readonly ISettingsService<OmbiSettings> _ombiSettings;
|
||||
private readonly IMovieRequestRepository _movieRequests;
|
||||
|
||||
public AutoDeleteRequests(ISettingsService<OmbiSettings> ombiSettings, IMovieRequestRepository movieRequest)
|
||||
{
|
||||
_ombiSettings = ombiSettings;
|
||||
_movieRequests = movieRequest;
|
||||
}
|
||||
|
||||
public async Task Execute(IJobExecutionContext job)
|
||||
{
|
||||
var settings = await _ombiSettings.GetSettingsAsync();
|
||||
if (!settings.AutoDeleteAvailableRequests)
|
||||
{
|
||||
return;
|
||||
}
|
||||
await ProcessMovieRequests(settings.AutoDeleteAfterDays);
|
||||
}
|
||||
|
||||
private async Task ProcessMovieRequests(int deleteAfterDays)
|
||||
{
|
||||
var date = DateTime.UtcNow.AddDays(-deleteAfterDays).Date;
|
||||
var requestsToDelete = await _movieRequests.GetAll().Where(x => x.Available && x.MarkedAsAvailable.HasValue && x.MarkedAsAvailable.Value < date).ToListAsync();
|
||||
|
||||
foreach (var request in requestsToDelete)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private bool _disposed;
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (_disposed)
|
||||
return;
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
}
|
||||
_disposed = true;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -36,7 +36,7 @@ namespace Ombi.Schedule.Jobs.Ombi
|
|||
public async Task Execute(IJobExecutionContext job)
|
||||
{
|
||||
// Get all the failed ones!
|
||||
var failedRequests = _requestQueue.GetAll().Where(x => !x.Completed.HasValue);
|
||||
var failedRequests = _requestQueue.GetAll().Where(x => x.Completed == null);
|
||||
|
||||
foreach (var request in failedRequests)
|
||||
{
|
||||
|
|
|
@ -12,5 +12,7 @@
|
|||
public bool HideRequestsUsers { get; set; }
|
||||
public bool DisableHealthChecks { get; set; }
|
||||
public string DefaultLanguageCode { get; set; } = "en";
|
||||
public bool AutoDeleteAvailableRequests { get; set; }
|
||||
public int AutoDeleteAfterDays { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<button mat-button [routerLink]="['/Settings/Ombi']">Ombi</button>
|
||||
|
||||
|
||||
<button mat-button [matMenuTriggerFor]="configurationmenu"><i class="fa fa-cogs" aria-hidden="true"></i> Configuration</button>
|
||||
<mat-menu #configurationmenu="matMenu">
|
||||
<button mat-menu-item [routerLink]="['/Settings/Ombi']">General</button>
|
||||
<button mat-menu-item [routerLink]="['/Settings/Customization']">Customization</button>
|
||||
<button mat-menu-item [routerLink]="['/Settings/LandingPage']">Landing Page</button>
|
||||
<button mat-menu-item [routerLink]="['/Settings/Issues']">Issues</button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue