playlist

package
v0.0.0-...-8d52960 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPathFormat = errors.New("invalid path format")
	ErrInvalidBasePath   = errors.New("invalid base path")
	ErrNoUserPrefix      = errors.New("no user prefix")
)

Functions

func NewPath

func NewPath(userID int, playlistName string) string

Types

type Playlist

type Playlist struct {
	UpdatedAt time.Time
	UserID    int
	Name      string
	Comment   string
	Items     []string
	IsPublic  bool
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(basePath string) (*Store, error)

func (*Store) Delete

func (s *Store) Delete(relPath string) error

func (*Store) List

func (s *Store) List() ([]string, error)

List finds playlist items in s.basePath. the expected format is <base path>/<user id>/**/<playlist name>.m3u

func (*Store) Read

func (s *Store) Read(relPath string) (*Playlist, error)

func (*Store) Write

func (s *Store) Write(relPath string, playlist *Playlist) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL