-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.go
59 lines (54 loc) · 1.5 KB
/
configuration.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
package main
// Configuration Stores the application configuration
type Configuration struct {
StorageLocation string
UpKeybind string
DownKeybind string
LeftKeybind string
RightKeybind string
PlayKeybind string
SearchKeybind string
ActionKeybind string
DeleteKeybind string
FastForward string
Rewind string
FastForwardLength int
RewindLength int
Theme theme
Subscribed []Podcast
Downloaded []PodcastEpisode
Cached []CachedPodcast
}
//TODO make this better
//now functions on slice of podcast entry
func (entries PodcastEpisodeSlice) Len() int {
return len(entries)
}
func (entries PodcastEpisodeSlice) Less(i, j int) bool {
return entries[i].Title < entries[j].Title
}
func (entries PodcastEpisodeSlice) Swap(i, j int) {
entries[i], entries[j] = entries[j], entries[i]
}
//CreateDefault creates default configuration
func CreateDefault() Configuration {
return Configuration{
StorageLocation: "",
UpKeybind: "k",
DownKeybind: "j",
LeftKeybind: "h",
RightKeybind: "l",
PlayKeybind: "<Space>",
SearchKeybind: "/",
ActionKeybind: "s",
DeleteKeybind: "d",
FastForward: "<Previous>",
Rewind: "<Next>",
FastForwardLength: 30,
RewindLength: 10,
Theme: ThemeLight,
Subscribed: make([]Podcast, 0),
Downloaded: make([]PodcastEpisode, 0),
Cached: make([]CachedPodcast, 0),
}
}