navidrome/model/playlist.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.2 KiB
Go
Raw Normal View History

2020-01-15 04:22:34 +01:00
package model
import (
"time"
)
type Playlist struct {
ID string `json:"id" orm:"column(id)"`
2020-05-08 16:47:06 +02:00
Name string `json:"name"`
Comment string `json:"comment"`
Duration float32 `json:"duration"`
SongCount int `json:"songCount"`
2020-05-08 16:47:06 +02:00
Owner string `json:"owner"`
Public bool `json:"public"`
2020-05-11 16:53:09 +02:00
Tracks MediaFiles `json:"tracks,omitempty"`
2020-05-08 16:47:06 +02:00
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
2020-05-16 02:47:15 +02:00
type Playlists []Playlist
type PlaylistRepository interface {
2020-05-04 02:05:03 +02:00
CountAll(options ...QueryOptions) (int64, error)
Exists(id string) (bool, error)
Put(pls *Playlist) error
Get(id string) (*Playlist, error)
GetAll(options ...QueryOptions) (Playlists, error)
Delete(id string) error
2020-05-16 02:47:15 +02:00
Tracks(playlistId string) PlaylistTrackRepository
}
2020-05-16 02:47:15 +02:00
type PlaylistTrack struct {
ID string `json:"id" orm:"column(id)"`
MediaFileID string `json:"mediaFileId" orm:"column(media_file_id)"`
2020-05-16 02:47:15 +02:00
PlaylistID string `json:"playlistId" orm:"column(playlist_id)"`
MediaFile
}
2020-05-16 02:47:15 +02:00
type PlaylistTracks []PlaylistTrack
type PlaylistTrackRepository interface {
2020-05-17 00:10:08 +02:00
ResourceRepository
2020-05-16 02:47:15 +02:00
Add(mediaFileIds []string) error
Update(mediaFileIds []string) error
2020-05-17 00:10:08 +02:00
Delete(id string) error
}