feat: store and use m3u files on filesystem for playlists
closes #306 closes #307 closes #66
This commit is contained in:
22
db/model.go
22
db/model.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user