pull/3703/head
Jamie Rees 4 years ago
parent 8cf7eb0e7b
commit 4c4f8f373d

@ -62,17 +62,17 @@ stages:
$response = Invoke-WebRequest -Uri "https://ombireleasenote.azurewebsites.net/api/ReleaseNotesFunction?buildId=$(Build.BuildId)" $response = Invoke-WebRequest -Uri "https://ombireleasenote.azurewebsites.net/api/ReleaseNotesFunction?buildId=$(Build.BuildId)"
Write-Host "##vso[task.setvariable variable=ReleaseNotes;]$response" Write-Host "##vso[task.setvariable variable=ReleaseNotes;]$response"
- task: GitHubRelease@1 # - task: GitHubRelease@1
inputs: # inputs:
gitHubConnection: 'github.com_tidusjar' # gitHubConnection: 'github.com_tidusjar'
repositoryName: 'tidusjar/Ombi' # repositoryName: 'tidusjar/Ombi'
action: 'create' # action: 'create'
target: '$(Build.SourceVersion)' # target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag' # tagSource: 'userSpecifiedTag'
tag: '$(gitTag)' # tag: '$(gitTag)'
isDraft: true # isDraft: true
changeLogCompareToRelease: 'lastNonDraftRelease' # changeLogCompareToRelease: 'lastNonDraftRelease'
changeLogType: 'commitBased' # changeLogType: 'commitBased'
- task: GitHubRelease@1 - task: GitHubRelease@1
inputs: inputs:
@ -90,4 +90,4 @@ stages:
isPreRelease: true isPreRelease: true
changeLogCompareToRelease: 'lastNonDraftRelease' changeLogCompareToRelease: 'lastNonDraftRelease'
changeLogType: 'commitBased' changeLogType: 'commitBased'
condition: and(succeeded(), eq(variables['PublishToGithub'], 'true')) condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/feature/v4'))

@ -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) public async Task Execute(IJobExecutionContext job)
{ {
// Get all the failed ones! // 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) foreach (var request in failedRequests)
{ {

@ -12,5 +12,7 @@
public bool HideRequestsUsers { get; set; } public bool HideRequestsUsers { get; set; }
public bool DisableHealthChecks { get; set; } public bool DisableHealthChecks { get; set; }
public string DefaultLanguageCode { get; set; } = "en"; 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> <button mat-button [matMenuTriggerFor]="configurationmenu"><i class="fa fa-cogs" aria-hidden="true"></i> Configuration</button>
<mat-menu #configurationmenu="matMenu"> <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/Customization']">Customization</button>
<button mat-menu-item [routerLink]="['/Settings/LandingPage']">Landing Page</button> <button mat-menu-item [routerLink]="['/Settings/LandingPage']">Landing Page</button>
<button mat-menu-item [routerLink]="['/Settings/Issues']">Issues</button> <button mat-menu-item [routerLink]="['/Settings/Issues']">Issues</button>

Loading…
Cancel
Save