add playlists and profiles init/pull/push
This commit is contained in:
parent
3af050caa0
commit
fe5eb2db34
15 changed files with 305 additions and 114 deletions
|
|
@ -17,11 +17,15 @@ func LoadPlaylists() []model.Playlist {
|
|||
var item model.Playlist
|
||||
json.Unmarshal([]byte(lines[i]), &item)
|
||||
|
||||
if !added[item.Id] {
|
||||
added[item.Id] = true
|
||||
if !added[item.RemoteId] {
|
||||
added[item.RemoteId] = true
|
||||
collection = append(collection, item)
|
||||
}
|
||||
}
|
||||
|
||||
return collection
|
||||
}
|
||||
|
||||
func UpdatePlaylists(data []string) {
|
||||
file.WriteDatabase(config.GetConfig().DbPath("playlists"), data)
|
||||
}
|
||||
|
|
@ -17,11 +17,15 @@ func LoadProfiles() []model.Profile {
|
|||
var item model.Profile
|
||||
json.Unmarshal([]byte(lines[i]), &item)
|
||||
|
||||
if !added[item.Name] {
|
||||
added[item.Name] = true
|
||||
if !added[item.RemoteId] {
|
||||
added[item.RemoteId] = true
|
||||
collection = append(collection, item)
|
||||
}
|
||||
}
|
||||
|
||||
return collection
|
||||
}
|
||||
|
||||
func UpdateProfiles(data []string) {
|
||||
file.WriteDatabase(config.GetConfig().DbPath("profiles"), data)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue