-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwallpapers.go
39 lines (34 loc) · 859 Bytes
/
wallpapers.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
package main
import (
// "path/filepath"
"time"
)
type Wallpaper struct { //add json tags to this
name string
filepath string
dateAdded time.Time
dateLastPlayed time.Time
playCount int
tags []string
playlists []*Playlist
skips []time.Time
favorite bool
}
//creates a new wallpaper from a filepath
func newWallpaper(filepath string) *Wallpaper {
//parse name from filepath
//attempt to set dateAdded based on metadata, or perhaps to today
//set date last played to dateAdded
//favorite to true
//everything else zero
return &Wallpaper{}
}
//for internal use, change the playcount arbitrarily
func (w *Wallpaper) addPlays(plays int) {
w.playCount += plays
}
func (w *Wallpaper) Play() {
//some logic to set the desktop background
//update dateLastPlayed to today
w.addPlays(1)
}