mirror of
https://github.com/C9Glax/tranga.git
synced 2025-06-13 06:47:54 +02:00
Annotation for jobs
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using API.Schema.MangaConnectors;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace API.Schema.Jobs;
|
||||
@ -7,7 +6,8 @@ namespace API.Schema.Jobs;
|
||||
public class DownloadAvailableChaptersJob(ulong recurrenceMs, string mangaId, string? parentJobId = null, ICollection<string>? dependsOnJobsIds = null)
|
||||
: Job(TokenGen.CreateToken(typeof(DownloadAvailableChaptersJob)), JobType.DownloadAvailableChaptersJob, recurrenceMs, parentJobId, dependsOnJobsIds)
|
||||
{
|
||||
[MaxLength(64)]
|
||||
[StringLength(64)]
|
||||
[Required]
|
||||
public string MangaId { get; init; } = mangaId;
|
||||
|
||||
[JsonIgnore]
|
||||
|
@ -1,21 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.IO.Compression;
|
||||
using System.Runtime.InteropServices;
|
||||
using API.MangaDownloadClients;
|
||||
using API.Schema.MangaConnectors;
|
||||
using Newtonsoft.Json;
|
||||
using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.Formats.Jpeg;
|
||||
using SixLabors.ImageSharp.Processing;
|
||||
using SixLabors.ImageSharp.Processing.Processors.Binarization;
|
||||
using static System.IO.UnixFileMode;
|
||||
|
||||
namespace API.Schema.Jobs;
|
||||
|
||||
public class DownloadMangaCoverJob(string mangaId, string? parentJobId = null, ICollection<string>? dependsOnJobsIds = null)
|
||||
: Job(TokenGen.CreateToken(typeof(DownloadMangaCoverJob)), JobType.DownloadMangaCoverJob, 0, parentJobId, dependsOnJobsIds)
|
||||
{
|
||||
[MaxLength(64)]
|
||||
[StringLength(64)]
|
||||
[Required]
|
||||
public string MangaId { get; init; } = mangaId;
|
||||
[JsonIgnore]
|
||||
public Manga? Manga { get; init; }
|
||||
|
@ -15,7 +15,8 @@ namespace API.Schema.Jobs;
|
||||
public class DownloadSingleChapterJob(string chapterId, string? parentJobId = null, ICollection<string>? dependsOnJobsIds = null)
|
||||
: Job(TokenGen.CreateToken(typeof(DownloadSingleChapterJob)), JobType.DownloadSingleChapterJob, 0, parentJobId, dependsOnJobsIds)
|
||||
{
|
||||
[MaxLength(64)]
|
||||
[StringLength(64)]
|
||||
[Required]
|
||||
public string ChapterId { get; init; } = chapterId;
|
||||
|
||||
[JsonIgnore]
|
||||
|
@ -1,9 +1,15 @@
|
||||
namespace API.Schema.Jobs;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace API.Schema.Jobs;
|
||||
|
||||
public class MoveFileOrFolderJob(string fromLocation, string toLocation, string? parentJobId = null, ICollection<string>? dependsOnJobsIds = null)
|
||||
: Job(TokenGen.CreateToken(typeof(MoveFileOrFolderJob)), JobType.MoveFileOrFolderJob, 0, parentJobId, dependsOnJobsIds)
|
||||
{
|
||||
[StringLength(256)]
|
||||
[Required]
|
||||
public string FromLocation { get; init; } = fromLocation;
|
||||
[StringLength(256)]
|
||||
[Required]
|
||||
public string ToLocation { get; init; } = toLocation;
|
||||
|
||||
protected override IEnumerable<Job> RunInternal(PgsqlContext context)
|
||||
|
@ -7,7 +7,8 @@ namespace API.Schema.Jobs;
|
||||
public class RetrieveChaptersJob(ulong recurrenceMs, string mangaId, string? parentJobId = null, ICollection<string>? dependsOnJobsIds = null)
|
||||
: Job(TokenGen.CreateToken(typeof(RetrieveChaptersJob)), JobType.RetrieveChaptersJob, recurrenceMs, parentJobId, dependsOnJobsIds)
|
||||
{
|
||||
[MaxLength(64)]
|
||||
[StringLength(64)]
|
||||
[Required]
|
||||
public string MangaId { get; init; } = mangaId;
|
||||
|
||||
[JsonIgnore]
|
||||
|
@ -6,7 +6,8 @@ namespace API.Schema.Jobs;
|
||||
public class UpdateFilesDownloadedJob(ulong recurrenceMs, string mangaId, string? parentJobId = null, ICollection<string>? dependsOnJobsIds = null)
|
||||
: Job(TokenGen.CreateToken(typeof(UpdateFilesDownloadedJob)), JobType.UpdateFilesDownloadedJob, recurrenceMs, parentJobId, dependsOnJobsIds)
|
||||
{
|
||||
[MaxLength(64)]
|
||||
[StringLength(64)]
|
||||
[Required]
|
||||
public string MangaId { get; init; } = mangaId;
|
||||
|
||||
[JsonIgnore]
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using API.Schema.MangaConnectors;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace API.Schema.Jobs;
|
||||
@ -7,7 +6,8 @@ namespace API.Schema.Jobs;
|
||||
public class UpdateMetadataJob(ulong recurrenceMs, string mangaId, string? parentJobId = null, ICollection<string>? dependsOnJobsIds = null)
|
||||
: Job(TokenGen.CreateToken(typeof(UpdateMetadataJob)), JobType.UpdateMetaDataJob, recurrenceMs, parentJobId, dependsOnJobsIds)
|
||||
{
|
||||
[MaxLength(64)]
|
||||
[StringLength(64)]
|
||||
[Required]
|
||||
public string MangaId { get; init; } = mangaId;
|
||||
|
||||
[JsonIgnore]
|
||||
|
Reference in New Issue
Block a user