in progress MediaItem refactor - does not build

This commit is contained in:
Drew Weymouth
2024-05-31 09:35:46 -07:00
parent 403e1a19b5
commit f67a0c5fc1
10 changed files with 171 additions and 44 deletions
+26
View File
@@ -139,6 +139,32 @@ type SavedPlayQueue struct {
TimePos int // seconds
}
type RadioStation struct {
Name string
ID string
HomePageURL string
StreamURL string
}
type MediaItem interface {
MediaItemName() string
MediaItemID() string
Copy() MediaItem
}
func (t Track) MediaItemName() string { return t.Name }
func (t Track) MediaItemID() string { return t.ID }
func (t *Track) Copy() MediaItem {
new := *t
return &new
}
func (r RadioStation) MediaItemName() string { return r.Name }
func (r RadioStation) MediaItemID() string { return r.ID }
func (r *RadioStation) Copy() MediaItem {
return r // no need to copy since RadioStations are immutable
}
type ContentType int
const (