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 that the scheduler re-downloads on a recurring
67// schedule. Each subscription owns its OutputDir: refresh/dedup and pruning are
68// scoped to that directory (see service.DownloadService refresh modes).
69type Subscription struct {
70 ID int64
71 Name string
72 URL string
73 Enabled bool
74 RefreshMode string // "overwrite" | "skip" | "metadata"
75 ScheduleKind string // "hourly" | "daily" | "weekly" | "monthly" | "cron"
76 CronExpr string
77 PresetID sql.NullInt64
78 FormatOverride string
79 CustomFlags string
80 OutputDir string
81 PruneRemoved bool
82 LastRunAt sql.NullTime
83 NextRunAt sql.NullTime
84 LastStatus sql.NullString
85 CreatedAt time.Time
86}
87
88type Settings struct {
89 RefreshInterval int
90 AutoRefreshLibrary bool
91 AutoRefreshDownloads bool
92 Cookies string
93}
94
95type FormatInfo struct {
96 ID string
97 Ext string
98 Resolution string
99 FPS string
100 Channels string
101 FileSize string
102 Codec string
103 Note string
104}
105
106type SubtitleTrack struct {
107 Lang string
108 Label string
109 Src string
110}
111
112type Comment struct {
113 ID string
114 Parent string
115 Author string
116 Text string
117 Timestamp int64
118 TimeText string
119 LikeCount int
120 AuthorIsUploader bool
121 ReplyTo string
122 Depth int
123}
124
125type HeatmapSegment struct {
126 StartTime float64
127 EndTime float64
128 Value float64
129 Width float64
130 Height float64
131}
132
133type ItemMetadata struct {
134 Name string `toml:"name"`
135 SourceURL string `toml:"source_url"`
136 Description string `toml:"description"`
137 VideoID string `toml:"video_id"`
138 YtdlpFlags string `toml:"ytdlp_flags"`
139 FileDurations map[string]int `toml:"file_durations"`
140}
141