Playlist: update service so it supports both read+write (#55959)

This commit is contained in:
Ryan McKinley
2022-10-04 11:11:18 -04:00
committed by GitHub
parent d293055ef6
commit 3b1a8d45ed
14 changed files with 118 additions and 287 deletions
+9 -3
View File
@@ -27,11 +27,17 @@ func exportSystemPlaylists(helper *commitHelper, job *gitExportJob) error {
comment: "Export playlists",
}
for _, playlist := range res {
// TODO: fix the playlist API so it returns the json we need :)
for _, item := range res {
playlist, err := job.playlistService.Get(helper.ctx, &playlist.GetPlaylistByUidQuery{
UID: item.UID,
OrgId: helper.orgID,
})
if err != nil {
return err
}
gitcmd.body = append(gitcmd.body, commitBody{
fpath: filepath.Join(helper.orgDir, "system", "playlists", fmt.Sprintf("%s-playlist.json", playlist.UID)),
fpath: filepath.Join(helper.orgDir, "system", "playlists", fmt.Sprintf("%s-playlist.json", playlist.Uid)),
body: prettyJSON(playlist),
})
}