234 lines
7.1 KiB
C#
234 lines
7.1 KiB
C#
using dy.net.model.entity;
|
|
|
|
namespace dy.net.model.dto
|
|
{
|
|
public enum VideoTaskType
|
|
{
|
|
Sync = 0,
|
|
Redownload = 1,
|
|
ExclusionRestore = 2,
|
|
StorageMigration = 3,
|
|
StorageMaintenance = 4
|
|
}
|
|
|
|
public enum VideoTaskTrigger
|
|
{
|
|
Scheduled = 0,
|
|
Manual = 1,
|
|
UserAction = 2,
|
|
UpgradeRecovery = 3
|
|
}
|
|
|
|
public enum VideoTaskStatus
|
|
{
|
|
Queued = 0,
|
|
Running = 1,
|
|
WaitingForStorage = 2,
|
|
Completed = 3,
|
|
PartiallyFailed = 4,
|
|
Failed = 5,
|
|
Interrupted = 6,
|
|
Paused = 7,
|
|
Cancelled = 8,
|
|
Cleaning = 9,
|
|
Cleaned = 10,
|
|
RolledBack = 11,
|
|
WaitingForSource = 12,
|
|
Scanning = 13,
|
|
AwaitingConfirmation = 14
|
|
}
|
|
|
|
public enum VideoTaskItemStage
|
|
{
|
|
Pending = 0,
|
|
Downloading = 1,
|
|
Verifying = 2,
|
|
Committing = 3,
|
|
Succeeded = 4,
|
|
SucceededWithWarnings = 5,
|
|
Failed = 6,
|
|
Skipped = 7,
|
|
WaitingForStorage = 8,
|
|
Cleaned = 9,
|
|
RolledBack = 10,
|
|
Cancelled = 11,
|
|
WaitingForSource = 12,
|
|
RecordRemoved = 13,
|
|
Inspecting = 14,
|
|
EmptyConfirmed = 15,
|
|
SkippedNonEmpty = 16
|
|
}
|
|
|
|
public enum VideoTaskErrorType
|
|
{
|
|
None = 0,
|
|
SourceUnavailable = 1,
|
|
CookieInvalid = 2,
|
|
StorageUnavailable = 3,
|
|
IntegrityCheckFailed = 4,
|
|
DatabaseCommitFailed = 5,
|
|
Interrupted = 6,
|
|
ConfigurationChanged = 7,
|
|
Excluded = 8,
|
|
Unknown = 9,
|
|
SourceForbidden = 10,
|
|
SourceRateLimited = 11
|
|
}
|
|
|
|
public enum VideoTaskSkipReason
|
|
{
|
|
None = 0,
|
|
AlreadyExists = 1,
|
|
Deduplicated = 2,
|
|
PermanentlyExcluded = 3,
|
|
ConfigurationExcluded = 4,
|
|
NoMediaSource = 5
|
|
}
|
|
|
|
public enum MediaStorageHealthStatus
|
|
{
|
|
Healthy = 0,
|
|
Unavailable = 1
|
|
}
|
|
|
|
public sealed class VideoTaskPageRequest : PageRequestDto
|
|
{
|
|
public VideoTaskType? Type { get; set; }
|
|
public VideoTaskStatus? Status { get; set; }
|
|
public VideoTaskTrigger? Trigger { get; set; }
|
|
public string Keyword { get; set; }
|
|
public DateTime? From { get; set; }
|
|
public DateTime? To { get; set; }
|
|
}
|
|
|
|
public sealed class VideoTaskItemPageRequest : PageRequestDto
|
|
{
|
|
public VideoTaskItemStage? Stage { get; set; }
|
|
public VideoTaskErrorType? ErrorType { get; set; }
|
|
public string Keyword { get; set; }
|
|
public bool IncludeSkipped { get; set; }
|
|
}
|
|
|
|
public sealed class VideoTaskListPage
|
|
{
|
|
public int TotalCount { get; set; }
|
|
public List<UnifiedVideoTaskDto> Items { get; set; } = new();
|
|
}
|
|
|
|
public sealed class VideoTaskItemPage
|
|
{
|
|
public int TotalCount { get; set; }
|
|
public List<UnifiedVideoTaskItemDto> Items { get; set; } = new();
|
|
}
|
|
|
|
public sealed class UnifiedVideoTaskDto
|
|
{
|
|
public string Id { get; set; }
|
|
public VideoTaskType Type { get; set; }
|
|
public VideoTaskTrigger Trigger { get; set; }
|
|
public VideoTaskStatus Status { get; set; }
|
|
public string Title { get; set; }
|
|
public VideoTypeEnum? VideoType { get; set; }
|
|
public StorageType StorageType { get; set; }
|
|
public int TotalCount { get; set; }
|
|
public int PendingCount { get; set; }
|
|
public int RunningCount { get; set; }
|
|
public int SuccessCount { get; set; }
|
|
public int WarningCount { get; set; }
|
|
public int FailedCount { get; set; }
|
|
public int SkippedCount { get; set; }
|
|
public int RemovedCount { get; set; }
|
|
public string CurrentFile { get; set; }
|
|
public string ErrorMessage { get; set; }
|
|
public DateTime CreatedAt { get; set; }
|
|
public DateTime UpdatedAt { get; set; }
|
|
public DateTime? CompletedAt { get; set; }
|
|
public List<string> AvailableActions { get; set; } = new();
|
|
}
|
|
|
|
public sealed class UnifiedVideoTaskItemDto
|
|
{
|
|
public string Id { get; set; }
|
|
public string TaskId { get; set; }
|
|
public string VideoId { get; set; }
|
|
public string AwemeId { get; set; }
|
|
public string CookieName { get; set; }
|
|
public VideoTypeEnum? VideoType { get; set; }
|
|
public string VideoTitle { get; set; }
|
|
public string Author { get; set; }
|
|
public string TargetPath { get; set; }
|
|
public VideoTaskItemStage Stage { get; set; }
|
|
public VideoTaskErrorType ErrorType { get; set; }
|
|
public VideoTaskSkipReason SkipReason { get; set; }
|
|
public int Attempts { get; set; }
|
|
public long ExpectedLength { get; set; }
|
|
public long ActualLength { get; set; }
|
|
public string ErrorMessage { get; set; }
|
|
public string WarningMessage { get; set; }
|
|
public string SourceHost { get; set; }
|
|
public int? HttpStatusCode { get; set; }
|
|
public DateTime? RetryAfter { get; set; }
|
|
public string ExclusionId { get; set; }
|
|
public DateTime? ExclusionReleasedAt { get; set; }
|
|
public string RelatedTaskId { get; set; }
|
|
public DateTime CreatedAt { get; set; }
|
|
public DateTime UpdatedAt { get; set; }
|
|
public DateTime? CompletedAt { get; set; }
|
|
public bool CanRetry { get; set; }
|
|
public bool CanRetryCleanup { get; set; }
|
|
public string CleanupError { get; set; }
|
|
public bool CanUnexclude { get; set; }
|
|
}
|
|
|
|
public sealed class VideoTaskSummaryDto
|
|
{
|
|
public int Queued { get; set; }
|
|
public int Running { get; set; }
|
|
public int WaitingForStorage { get; set; }
|
|
public int WaitingForSource { get; set; }
|
|
public int Failed { get; set; }
|
|
public int Completed { get; set; }
|
|
public MediaStorageHealth StorageHealth { get; set; }
|
|
public List<DouyinSourceHealthDto> SourceHealth { get; set; } = new();
|
|
}
|
|
|
|
public sealed class DouyinSourceHealthDto
|
|
{
|
|
public string CookieId { get; set; }
|
|
public string CookieName { get; set; }
|
|
public int ConsecutiveForbidden { get; set; }
|
|
public DateTime? CooldownUntil { get; set; }
|
|
public bool RequiresAuthorization { get; set; }
|
|
public bool ProbePending { get; set; }
|
|
public int? LastStatusCode { get; set; }
|
|
public string LastError { get; set; }
|
|
public DateTime? UpdatedAt { get; set; }
|
|
}
|
|
|
|
public sealed class UnexcludeVideosRequest
|
|
{
|
|
public List<string> Ids { get; set; } = new();
|
|
public bool CreateDownloadTask { get; set; }
|
|
}
|
|
|
|
public sealed class UnexcludeVideosResult
|
|
{
|
|
public int ReleasedCount { get; set; }
|
|
public int QueuedCount { get; set; }
|
|
public string TaskId { get; set; }
|
|
public List<string> CannotQueueIds { get; set; } = new();
|
|
public string Message { get; set; }
|
|
}
|
|
|
|
public sealed class VideoExclusionPageRequest : PageRequestDto
|
|
{
|
|
public string Keyword { get; set; }
|
|
}
|
|
|
|
public sealed class VideoExclusionPage
|
|
{
|
|
public int TotalCount { get; set; }
|
|
public List<DouyinVideoDelete> Items { get; set; } = new();
|
|
}
|
|
}
|