using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace TwitchArchive.Core.Config { public class GlobalConfig { [JsonPropertyName("archive_root")] public string? ArchiveRoot { get; set; } [JsonPropertyName("streamlink_path")] public string? StreamlinkPath { get; set; } [JsonPropertyName("ffmpeg_path")] public string? FfmpegPath { get; set; } [JsonPropertyName("twitchdownloader_path")] public string? TwitchDownloaderPath { get; set; } [JsonPropertyName("rclone_path")] public string? RclonePath { get; set; } [JsonPropertyName("upload_to_cloud")] public bool UploadToCloud { get; set; } = false; [JsonPropertyName("upload_destination")] public string? UploadDestination { get; set; } [JsonPropertyName("refresh_interval_seconds")] [Range(5, 86400, ErrorMessage = "Refresh interval must be between 5 and 86400 seconds.")] public int RefreshIntervalSeconds { get; set; } = 60; [JsonPropertyName("stream_segment_threads")] [Range(1, 64, ErrorMessage = "Stream segment threads must be between 1 and 64.")] public int StreamSegmentThreads { get; set; } = 4; [JsonPropertyName("default_quality")] public string? DefaultQuality { get; set; } = "best"; // Defaults section for per-streamer fallbacks [JsonPropertyName("defaults")] public DefaultsSection Defaults { get; set; } = new DefaultsSection(); } public class DefaultsSection { [JsonPropertyName("downloadVOD")] public bool DownloadVOD { get; set; } = true; [JsonPropertyName("downloadCHAT")] public bool DownloadCHAT { get; set; } = true; [JsonPropertyName("downloadLiveCHAT")] public bool DownloadLiveCHAT { get; set; } = true; [JsonPropertyName("mergeVideoChat")] public bool MergeVideoChat { get; set; } = false; [JsonPropertyName("mergeChatLayout")] public string MergeChatLayout { get; set; } = "side-by-side"; [JsonPropertyName("vodTimeout")] [Range(0, 86400, ErrorMessage = "VOD timeout must be between 0 and 86400 seconds.")] public int VodTimeout { get; set; } = 300; [JsonPropertyName("uploadCloud")] public bool UploadCloud { get; set; } = false; [JsonPropertyName("uploadPreMergeVideo")] public bool UploadPreMergeVideo { get; set; } = true; [JsonPropertyName("uploadMergedVideo")] public bool UploadMergedVideo { get; set; } = true; [JsonPropertyName("uploadChatVideo")] public bool UploadChatVideo { get; set; } = false; [JsonPropertyName("deleteFiles")] public bool DeleteFiles { get; set; } = false; [JsonPropertyName("onlyRaw")] public bool OnlyRaw { get; set; } = false; [JsonPropertyName("cleanRaw")] public bool CleanRaw { get; set; } = true; [JsonPropertyName("hls_segments")] [Range(1, 50, ErrorMessage = "HLS segments must be between 1 and 50.")] public int HlsSegments { get; set; } = 3; [JsonPropertyName("hls_segmentsVOD")] [Range(1, 200, ErrorMessage = "HLS segments (VOD) must be between 1 and 200.")] public int HlsSegmentsVOD { get; set; } = 10; [JsonPropertyName("streamlink_ttvlol")] public bool StreamlinkTtvlol { get; set; } = false; [JsonPropertyName("ffmpeg_hwaccel")] public string FfmpegHwaccel { get; set; } = "auto"; [JsonPropertyName("ffmpeg_threads")] [Range(0, 128, ErrorMessage = "FFmpeg threads must be between 0 and 128.")] public int FfmpegThreads { get; set; } = 0; [JsonPropertyName("ffmpeg_audio_codec")] public string FfmpegAudioCodec { get; set; } = "aac"; [JsonPropertyName("ffmpeg_audio_samplerate")] [Range(8000, 192000, ErrorMessage = "Audio sample rate must be between 8000 and 192000.")] public int FfmpegAudioSamplerate { get; set; } = 48000; [JsonPropertyName("ffmpeg_audio_bitrate")] public string FfmpegAudioBitrate { get; set; } = "192k"; [JsonPropertyName("ffmpeg_error_recovery")] public bool FfmpegErrorRecovery { get; set; } = true; [JsonPropertyName("ffmpeg_faststart")] public bool FfmpegFaststart { get; set; } = true; [JsonPropertyName("ffmpeg_progress")] public bool FfmpegProgress { get; set; } = false; } }