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 WriteComments bool
25 CommentSort string
26 MaxComments int
27 CommentExtractorArgs string
28 CustomFlags string
29 CreatedAt time.Time
30}
31
32type LibraryItem struct {
33 Name string
34 RelPath string
35 DirPath string
36 SourceURL string
37 Duration int
38 Description string
39 YtdlpFlags string
40 MediaFiles []MediaFile
41}
42
43type MediaFile struct {
44 Filename string
45 Filepath string
46 IsAudio bool
47 Duration int
48}
49
50type Download struct {
51 ID int64
52 URL string
53 Status string
54 Logs sql.NullString
55 ErrorMessage sql.NullString
56 PresetID sql.NullInt64
57 FormatOverride string
58 CustomFlags string
59 OutputDir sql.NullString
60 SubscriptionID sql.NullInt64
61 StartedAt sql.NullTime
62 CompletedAt sql.NullTime
63 CreatedAt time.Time
64}
65
66// Subscription is a saved URL the scheduler re-downloads. Each one owns its
67// OutputDir: dedup and pruning are scoped to that directory.
68type Subscription struct {
69 ID int64
70 Name string
71 URL string
72 Enabled bool
73 RefreshMode string // "overwrite" | "skip" | "metadata"
74 ScheduleKind string // "hourly" | "daily" | "weekly" | "monthly" | "cron"
75 CronExpr string
76 PresetID sql.NullInt64
77 FormatOverride string
78 CustomFlags string
79 OutputDir string
80 PruneRemoved bool
81 LastRunAt sql.NullTime
82 NextRunAt sql.NullTime
83 LastStatus sql.NullString
84 CreatedAt time.Time
85}
86
87type Settings struct {
88 RefreshInterval int
89 AutoRefreshLibrary bool
90 AutoRefreshDownloads bool
91 Cookies string
92}
93
94type FormatInfo struct {
95 ID string
96 Ext string
97 Resolution string
98 FPS string
99 Channels string
100 FileSize string
101 Codec string
102 Note string
103}
104
105type SubtitleTrack struct {
106 Lang string
107 Label string
108 Src string
109}
110
111type Comment struct {
112 ID string
113 Parent string
114 Author string
115 Text string
116 Timestamp int64
117 TimeText string
118 LikeCount int
119 AuthorIsUploader bool
120 ReplyTo string
121 Depth int
122}
123
124type HeatmapSegment struct {
125 StartTime float64
126 EndTime float64
127 Value float64
128 Width float64
129 Height float64
130}
131
132type ItemMetadata struct {
133 Name string `toml:"name"`
134 SourceURL string `toml:"source_url"`
135 Description string `toml:"description"`
136 VideoID string `toml:"video_id"`
137 YtdlpFlags string `toml:"ytdlp_flags"`
138 FileDurations map[string]int `toml:"file_durations"`
139}
140