add features

This commit is contained in:
2026-07-29 04:35:25 -05:00
parent 23c6113b33
commit cab5a987b0
29 changed files with 1179 additions and 89 deletions
+36
View File
@@ -221,8 +221,44 @@ type MediaItemType int
const (
MediaItemTypeTrack MediaItemType = iota
MediaItemTypeRadioStation
MediaItemTypePodcastEpisode
)
type PodcastChannel struct {
ID, URL, Title, Description, CoverArtID, OriginalImageURL, Status, ErrorMessage string
Episodes []*PodcastEpisode
}
type PodcastEpisode struct {
ID, StreamID, ChannelID, Title, Description, Status, CoverArtID, OriginalImageURL, ChannelTitle string
PublishDate time.Time
Duration time.Duration
Size int64
BitRate int
ContentType string
}
func (p *PodcastEpisode) Playable() bool {
return p != nil && p.Status == "completed" && p.StreamID != ""
}
func (p *PodcastEpisode) Metadata() MediaItemMetadata {
if p == nil {
return MediaItemMetadata{}
}
return MediaItemMetadata{Type: MediaItemTypePodcastEpisode, MIMEType: p.ContentType,
ID: p.ID, Name: p.Title, Artists: []string{p.ChannelTitle}, Album: p.ChannelTitle,
CoverArtID: p.CoverArtID, Duration: p.Duration, Size: p.Size, BitRate: p.BitRate}
}
func (p *PodcastEpisode) Copy() MediaItem {
if p == nil {
return nil
}
c := *p
return &c
}
type MediaItemMetadata struct {
Type MediaItemType
MIMEType string