Documentation ¶
Index ¶
- Constants
- Variables
- func Download(w io.Writer, src *url.URL) error
- func DownloadAudio(w io.Writer, src *url.URL) error
- func GlobalID(i IDer) string
- func IsErrExists(err error) bool
- func IsErrNotExists(err error) bool
- func TempFile(file string) string
- type Collection
- func (c *Collection) AddSong(playlist string, s Song, reappend bool) error
- func (c *Collection) Create(n string) error
- func (c *Collection) DelSong(playlist string, s Song) error
- func (c *Collection) DelSongIndexes(playlist string, ix []int) error
- func (c *Collection) Delete(n string) error
- func (c *Collection) Exists(n string) bool
- func (c *Collection) Find(ns, id string) (Song, error)
- func (c *Collection) FindAll(ns, id string) (Song, []string, error)
- func (c *Collection) FromYoutube(r *youtube.Result) *YoutubeSong
- func (c *Collection) FromYoutubeURL(url, title string) (*YoutubeSong, error)
- func (c *Collection) Init() error
- func (c *Collection) List() []string
- func (c *Collection) Load() error
- func (c *Collection) MoveSongIndex(playlist string, from []int, to int) error
- func (c *Collection) PlaylistSongs(playlist string) ([]Song, error)
- func (c *Collection) Problematics() *Problematics
- func (c *Collection) Queue(ix int, n string) error
- func (c *Collection) QueueSong(ix int, s Song)
- func (c *Collection) RegisterUnmarshaler(ns string, unmarshaler Unmarshaler)
- func (c *Collection) RenameSong(s Song, name string)
- func (c *Collection) Run(ratelimitDownloads, ratelimitMeta <-chan struct{})
- func (c *Collection) Save() error
- func (c *Collection) Search(q string) []*SearchResult
- func (c *Collection) SongPath(id IDer) string
- func (c *Collection) Songs() []Song
- func (c *Collection) UnreferencedDownloads() []string
- type IDer
- type Playlist
- func (p *Playlist) Add(s Song, reappend bool)
- func (p *Playlist) Del(s Song)
- func (p *Playlist) DelIndexes(ix []int)
- func (p *Playlist) Find(ns, id string) (Song, error)
- func (p *Playlist) List() []Song
- func (p *Playlist) Move(from, to Song)
- func (p *Playlist) MoveIndex(from []int, to int)
- func (p *Playlist) Queue(q *Queue, ix int)
- func (p *Playlist) Search(q string) []Song
- type Problematic
- type Problematics
- type Queue
- func (q *Queue) Add(ix int, s Song)
- func (q *Queue) AddSlice(ix int, songs []Song)
- func (q *Queue) Current() *QueueItem
- func (q *Queue) CurrentIndex() int
- func (q *Queue) Next() *QueueItem
- func (q *Queue) Prev() *QueueItem
- func (q *Queue) Reset()
- func (q *Queue) SetCurrentIndex(i int)
- func (q *Queue) Shuffle()
- func (q *Queue) ShuffleRange(start, end int)
- func (q *Queue) Slice() []Song
- func (q *Queue) String() string
- type QueueItem
- type SearchResult
- type Song
- type SongTasks
- type Unmarshaler
- type YoutubeSong
Constants ¶
View Source
const NSYoutube = "yt"
Variables ¶
View Source
var ( ErrNotExists = errors.New("playlist does not exist") ErrSongNotExists = errors.New("song does not exist") ErrExists = errors.New("playlist already exists") )
View Source
var ErrUnknown = errors.New("unknown")
Functions ¶
func IsErrExists ¶
func IsErrNotExists ¶
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func (*Collection) AddSong ¶
func (c *Collection) AddSong(playlist string, s Song, reappend bool) error
func (*Collection) Create ¶
func (c *Collection) Create(n string) error
func (*Collection) DelSongIndexes ¶
func (c *Collection) DelSongIndexes(playlist string, ix []int) error
func (*Collection) Delete ¶
func (c *Collection) Delete(n string) error
func (*Collection) Exists ¶
func (c *Collection) Exists(n string) bool
func (*Collection) FindAll ¶ added in v0.12.1
func (c *Collection) FindAll(ns, id string) (Song, []string, error)
func (*Collection) FromYoutube ¶
func (c *Collection) FromYoutube(r *youtube.Result) *YoutubeSong
func (*Collection) FromYoutubeURL ¶
func (c *Collection) FromYoutubeURL(url, title string) (*YoutubeSong, error)
func (*Collection) Init ¶
func (c *Collection) Init() error
func (*Collection) List ¶
func (c *Collection) List() []string
func (*Collection) Load ¶
func (c *Collection) Load() error
func (*Collection) MoveSongIndex ¶
func (c *Collection) MoveSongIndex(playlist string, from []int, to int) error
func (*Collection) PlaylistSongs ¶
func (c *Collection) PlaylistSongs(playlist string) ([]Song, error)
func (*Collection) Problematics ¶
func (c *Collection) Problematics() *Problematics
func (*Collection) QueueSong ¶
func (c *Collection) QueueSong(ix int, s Song)
func (*Collection) RegisterUnmarshaler ¶
func (c *Collection) RegisterUnmarshaler(ns string, unmarshaler Unmarshaler)
func (*Collection) RenameSong ¶ added in v0.9.5
func (c *Collection) RenameSong(s Song, name string)
func (*Collection) Run ¶
func (c *Collection) Run(ratelimitDownloads, ratelimitMeta <-chan struct{})
func (*Collection) Save ¶
func (c *Collection) Save() error
func (*Collection) Search ¶
func (c *Collection) Search(q string) []*SearchResult
func (*Collection) SongPath ¶
func (c *Collection) SongPath(id IDer) string
func (*Collection) Songs ¶
func (c *Collection) Songs() []Song
func (*Collection) UnreferencedDownloads ¶
func (c *Collection) UnreferencedDownloads() []string
type Playlist ¶
type Playlist struct {
// contains filtered or unexported fields
}
func NewPlaylist ¶
func (*Playlist) DelIndexes ¶
type Problematic ¶
type Problematic struct {
// contains filtered or unexported fields
}
func (Problematic) Reason ¶
func (p Problematic) Reason() error
func (Problematic) Song ¶
func (p Problematic) Song() Song
type Problematics ¶
type Problematics struct {
// contains filtered or unexported fields
}
func NewProblematics ¶
func NewProblematics() *Problematics
func (*Problematics) Add ¶
func (p *Problematics) Add(s Song, err error)
func (*Problematics) Del ¶
func (p *Problematics) Del(s IDer)
func (*Problematics) List ¶
func (p *Problematics) List() []Problematic
func (*Problematics) Reason ¶
func (p *Problematics) Reason(s IDer) string
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func (*Queue) CurrentIndex ¶
func (*Queue) SetCurrentIndex ¶
func (*Queue) ShuffleRange ¶ added in v0.9.2
ShuffleRange shuffles items in the queue in range [start, end] if start < 0: shuffle from beginning if end < 0: shuffle until the end thus ShuffleRange(-1, -1) shuffles the entire queue
type QueueItem ¶
type QueueItem struct { Song // contains filtered or unexported fields }
func (*QueueItem) IsBeyondFirst ¶
func (*QueueItem) IsBeyondLast ¶
type SearchResult ¶ added in v0.12.0
type SongTasks ¶
type SongTasks struct {
// contains filtered or unexported fields
}
SongTasks runs a bunch of tasks on a song concurrenly with a given ratelimiter.
func NewSongTasks ¶
func NewSongTasks( concurrency int, rate <-chan struct{}, filter func(Song) bool, cb func(Song), ) *SongTasks
NewSongTasks creates a new SongTask that will execute cb() for every item that returns true when passed through filter(). filter will also be executed concurrenly but never ratelimited.
type YoutubeSong ¶
func YoutubeSongUnmarshal ¶ added in v0.8.0
func YoutubeSongUnmarshal(c *Collection, dec *binary.Reader) (*YoutubeSong, error)
func (*YoutubeSong) File ¶
func (s *YoutubeSong) File() (string, error)
func (*YoutubeSong) Local ¶
func (s *YoutubeSong) Local() bool
func (*YoutubeSong) NS ¶
func (s *YoutubeSong) NS() string
Click to show internal directories.
Click to hide internal directories.