feat: store and use m3u files on filesystem for playlists

closes #306
closes #307
closes #66
This commit is contained in:
sentriz
2023-04-22 18:25:19 +01:00
committed by Senan Kelly
parent 1d3877668f
commit 7dc9575e52
18 changed files with 621 additions and 355 deletions

View File

@@ -242,28 +242,6 @@ func (a *Album) GenreStrings() []string {
return strs
}
type Playlist struct {
ID int `gorm:"primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
User *User
UserID int `sql:"default: null; type:int REFERENCES users(id) ON DELETE CASCADE"`
Name string
Comment string
TrackCount int
Items string
IsPublic bool `sql:"default: null"`
}
func (p *Playlist) GetItems() []specid.ID {
return splitIDs(p.Items, ",")
}
func (p *Playlist) SetItems(items []specid.ID) {
p.Items = joinIds(items, ",")
p.TrackCount = len(items)
}
type PlayQueue struct {
ID int `gorm:"primary_key"`
CreatedAt time.Time