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 MediaFiles []MediaFile
36}
37
38type MediaFile struct {
39 Filename string
40 Filepath string
41 IsAudio bool
42 HasEmbeddedThumbnail 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 StartedAt sql.NullTime
57 CompletedAt sql.NullTime
58 CreatedAt time.Time
59}
60
61type Settings struct {
62 RefreshInterval int
63 AutoRefreshLibrary bool
64 AutoRefreshDownloads bool
65 Cookies string
66}
67
68type FormatInfo struct {
69 ID string
70 Ext string
71 Resolution string
72 FPS string
73 Channels string
74 FileSize string
75 Codec string
76 Note string
77}
78
79type SubtitleTrack struct {
80 Lang string
81 Label string
82 Src string
83}
84
85type ItemMetadata struct {
86 Name string `toml:"name"`
87 SourceURL string `toml:"source_url"`
88 Duration int `toml:"duration"`
89 Description string `toml:"description"`
90 FileDurations map[string]int `toml:"file_durations"`
91}
92