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 Duration int
43}
44
45type Download struct {
46 ID int64
47 URL string
48 Status string
49 Logs sql.NullString
50 ErrorMessage sql.NullString
51 PresetID sql.NullInt64
52 FormatOverride string
53 CustomFlags string
54 OutputDir sql.NullString
55 StartedAt sql.NullTime
56 CompletedAt sql.NullTime
57 CreatedAt time.Time
58}
59
60type Settings struct {
61 RefreshInterval int
62 AutoRefreshLibrary bool
63 AutoRefreshDownloads bool
64 Cookies string
65}
66
67type FormatInfo struct {
68 ID string
69 Ext string
70 Resolution string
71 FPS string
72 Channels string
73 FileSize string
74 Codec string
75 Note string
76}
77
78type SubtitleTrack struct {
79 Lang string
80 Label string
81 Src string
82}
83
84type ItemMetadata struct {
85 Name string `toml:"name"`
86 SourceURL string `toml:"source_url"`
87 Duration int `toml:"duration"`
88 Description string `toml:"description"`
89 FileDurations map[string]int `toml:"file_durations"`
90}
91