models.go
⎇
Raw
1package models
2
3import (
4 "database/sql"
5 "time"
6)
7
8type Preset struct {
9 ID int64
10 Name string
11 Description string
12 IsDefault bool
13 FormatMode string
14 Format string
15 Quality string
16 CustomFormat string
17 ExtractAudio bool
18 AudioFormat string
19 EmbedSubs bool
20 SubLangs string
21 EmbedThumbnail bool
22 EmbedMetadata bool
23 WriteInfoJSON bool
24 CustomFlags string
25 CreatedAt time.Time
26}
27
28type LibraryItem struct {
29 Name string
30 RelPath string
31 DirPath string
32 SourceURL string
33 Duration int
34 Description string
35 YtdlpFlags string
36 MediaFiles []MediaFile
37}
38
39type MediaFile struct {
40 Filename string
41 Filepath string
42 IsAudio bool
43 Duration int
44}
45
46type Download struct {
47 ID int64
48 URL string
49 Status string
50 Logs sql.NullString
51 ErrorMessage sql.NullString
52 PresetID sql.NullInt64
53 FormatOverride string
54 CustomFlags string
55 OutputDir sql.NullString
56 SubscriptionID sql.NullInt64
57 StartedAt sql.NullTime
58 CompletedAt sql.NullTime
59 CreatedAt time.Time
60}
61
62// Subscription is a saved URL that the scheduler re-downloads on a recurring
63// schedule. Each subscription owns its OutputDir: refresh/dedup and pruning are
64// scoped to that directory (see service.DownloadService refresh modes).
65type Subscription struct {
66 ID int64
67 Name string
68 URL string
69 Enabled bool
70 RefreshMode string // "overwrite" | "skip" | "metadata"
71 ScheduleKind string // "hourly" | "daily" | "weekly" | "monthly" | "cron"
72 CronExpr string
73 PresetID sql.NullInt64
74 FormatOverride string
75 CustomFlags string
76 OutputDir string
77 PruneRemoved bool
78 LastRunAt sql.NullTime
79 NextRunAt sql.NullTime
80 LastStatus sql.NullString
81 CreatedAt time.Time
82}
83
84type Settings struct {
85 RefreshInterval int
86 AutoRefreshLibrary bool
87 AutoRefreshDownloads bool
88 Cookies string
89}
90
91type FormatInfo struct {
92 ID string
93 Ext string
94 Resolution string
95 FPS string
96 Channels string
97 FileSize string
98 Codec string
99 Note string
100}
101
102type SubtitleTrack struct {
103 Lang string
104 Label string
105 Src string
106}
107
108type ItemMetadata struct {
109 Name string `toml:"name"`
110 SourceURL string `toml:"source_url"`
111 Description string `toml:"description"`
112 VideoID string `toml:"video_id"`
113 YtdlpFlags string `toml:"ytdlp_flags"`
114 FileDurations map[string]int `toml:"file_durations"`
115}
116