-
Notifications
You must be signed in to change notification settings - Fork 1
/
structs.go
79 lines (65 loc) · 2.08 KB
/
structs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package main
type Track struct {
TrackName string `json:"track_name,omitempty"`
ArtistName string `json:"artist_name,omitempty"`
AlbumName string `json:"album_name,omitempty"`
TrackLength int `json:"track_length,omitempty"`
Instrumental int `json:"instrumental,omitempty"`
HasLyrics int `json:"has_lyrics,omitempty"`
HasSubtitles int `json:"has_subtitles,omitempty"`
}
type Lyrics struct {
LyricsBody string `json:"lyrics_body,omitempty"`
}
type Synced struct {
Lines []Lines
}
type Lines struct {
Text string `json:"text,omitempty"`
Time Time `json:"time,omitempty"`
}
type Time struct {
Total float64 `json:"total,omitempty"`
Minutes int `json:"minutes,omitempty"`
Seconds int `json:"seconds,omitempty"`
Hundredths int `json:"hundredths,omitempty"`
}
type Song struct {
Track Track
Lyrics Lyrics
Subtitles Synced
}
type Inputs struct {
Track Track
Outdir string
Filename string
}
type Args struct {
Song []string `arg:"positional,required" help:"song information in [ artist,title ] format (required)"`
Outdir string `arg:"-o,--outdir" help:"output directory" default:"lyrics"`
Cooldown int `arg:"-c,--cooldown" help:"cooldown time in seconds" default:"15"`
Depth int `arg:"-d,--depth" help:"(directory mode) maximum recursion depth" default:"100"`
Update bool `arg:"-u,--update" help:"(directory mode) update existing lyrics file"`
BFS bool `arg:"--bfs" help:"(directory mode) use breatdth-first-search traversal"`
Token string `arg:"-t,--token" help:"musixmatch token" default:""`
}
type InputsQueue struct {
Queue []Inputs
}
func (q *InputsQueue) next() Inputs {
return q.Queue[0]
}
func (q *InputsQueue) pop() Inputs {
tmp := q.Queue[0]
q.Queue = q.Queue[1:]
return tmp
}
func (q *InputsQueue) push(i Inputs) {
q.Queue = append(q.Queue, i)
}
func (q *InputsQueue) len() int {
return len(q.Queue)
}
func (q *InputsQueue) empty() bool {
return len(q.Queue) == 0
}