Documentation ¶
Index ¶
- Constants
- Variables
- func CountOffline(tracks []*Track) int
- func CountOnline(tracks []*Track) int
- func GetTag(path string, frame int) string
- func IndexWait()
- func IsType(sequence string, songType int) bool
- func JunkWildcards() []string
- func TagGetFrame(tag *id3v2.Tag, frame int) string
- func TagGetFrameArtwork(tag *id3v2.Tag) string
- func TagGetFrameArtworkURL(tag *id3v2.Tag) string
- func TagGetFrameDuration(tag *id3v2.Tag) string
- func TagGetFrameFeaturings(tag *id3v2.Tag) string
- func TagGetFrameLyrics(tag *id3v2.Tag) string
- func TagGetFrameOrigin(tag *id3v2.Tag) string
- func TagGetFrameSong(tag *id3v2.Tag) string
- func TagGetFrameSpotifyID(tag *id3v2.Tag) string
- func TagGetFrameTrackNumber(tag *id3v2.Tag) string
- func TagGetFrameTrackTotals(tag *id3v2.Tag) string
- func TagHasFrame(tag *id3v2.Tag, frame int) bool
- type Playlist
- type Track
- func (track Track) Basename() string
- func (track Track) Filename() string
- func (track Track) FilenameArtwork() string
- func (track Track) FilenameTemporary() string
- func (track Track) GetID3Frame(frame int) string
- func (track *Track) HasID3Frame(frame int) bool
- func (track *Track) Local() bool
- func (track Track) Query() string
- func (track Track) Seems(sequence string) error
- func (track Track) SeemsByWordMatch(sequence string) error
- func (track Track) TempFiles() []string
- func (track Track) Type() int
- type TracksDump
- type TracksIndex
Constants ¶
const ( // ID3FrameTitle : ID3 title frame tag identifier ID3FrameTitle = iota // ID3FrameSong : ID3 song frame tag identifier ID3FrameSong // ID3FrameArtist : ID3 artist frame tag identifier ID3FrameArtist // ID3FrameAlbum : ID3 album frame tag identifier ID3FrameAlbum // ID3FrameGenre : ID3 genre frame tag identifier ID3FrameGenre // ID3FrameYear : ID3 year frame tag identifier ID3FrameYear // ID3FrameFeaturings : ID3 featurings frame tag identifier ID3FrameFeaturings // ID3FrameTrackNumber : ID3 track number frame tag identifier ID3FrameTrackNumber // ID3FrameTrackTotals : ID3 total tracks number frame tag identifier ID3FrameTrackTotals // ID3FrameArtwork : ID3 artwork frame tag identifier ID3FrameArtwork // ID3FrameArtworkURL : ID3 artwork URL frame tag identifier ID3FrameArtworkURL // ID3FrameLyrics : ID3 lyrics frame tag identifier ID3FrameLyrics // ID3FrameOrigin : ID3 origin frame tag identifier ID3FrameOrigin // ID3FrameDuration : ID3 duration frame tag identifier ID3FrameDuration // ID3FrameSpotifyID : ID3 Spotify ID frame tag identifier ID3FrameSpotifyID )
const ( // SongTypeAlbum : identifier for Song in its album variant SongTypeAlbum = iota // SongTypeLive : identifier for Song in its live variant SongTypeLive // SongTypeCover : identifier for Song in its cover variant SongTypeCover // SongTypeRemix : identifier for Song in its remix variant SongTypeRemix // SongTypeAcoustic : identifier for Song in its acoustic variant SongTypeAcoustic // SongTypeKaraoke : identifier for Song in its karaoke variant SongTypeKaraoke // SongTypeParody : identifier for Song in its parody variant SongTypeParody // SongTypeReverse : identifier for Song in its reverse variant SongTypeReverse )
Variables ¶
var ( // JunkSuffixes : array containing every file suffix considered junk JunkSuffixes = []string{".ytdl", ".webm", ".opus", ".part", ".jpg", ".tmp", "-id3v2"} )
var ( // SongTypes : array containing every song variant identifier SongTypes = []int{SongTypeLive, SongTypeCover, SongTypeRemix, SongTypeAcoustic, SongTypeKaraoke, SongTypeParody} )
Functions ¶
func CountOffline ¶
CountOffline : return offline (local) songs count from Tracks
func CountOnline ¶
CountOnline : return online songs count from Tracks
func JunkWildcards ¶
func JunkWildcards() []string
JunkWildcards : return strings array containing all possible junk filenames wilcards
func TagGetFrame ¶
TagGetFrame : get input frame from open input Tag
func TagGetFrameArtwork ¶
TagGetFrameArtwork : get artwork frame from input Tag
func TagGetFrameArtworkURL ¶
TagGetFrameArtworkURL : get artwork URL frame from input Tag
func TagGetFrameDuration ¶
TagGetFrameDuration : get duration frame from input Tag
func TagGetFrameFeaturings ¶
TagGetFrameFeaturings : get track featurings frame from input Tag
func TagGetFrameLyrics ¶
TagGetFrameLyrics : get lyrics frame from input Tag
func TagGetFrameOrigin ¶
TagGetFrameOrigin : get origin frame from input Tag
func TagGetFrameSong ¶
TagGetFrameSong : get track song title frame from input Tag
func TagGetFrameSpotifyID ¶
TagGetFrameSpotifyID : get Spotify ID frame from input Tag
func TagGetFrameTrackNumber ¶
TagGetFrameTrackNumber : get track number frame from input Tag
func TagGetFrameTrackTotals ¶
TagGetFrameTrackTotals : get total tracks number frame from input Tag
Types ¶
type Playlist ¶
Playlist defines a playlist wrapper
type Track ¶
type Track struct { Title string Song string Artist string Album string Year string Featurings []string Genre string TrackNumber int TrackTotals int Duration int Image string URL string SpotifyID string Lyrics string }
Track : struct containing all the informations about a track
func OpenLocalTrack ¶
OpenLocalTrack : parse local filename track informations into a new Track object
func ParseSpotifyTrack ¶
ParseSpotifyTrack : parse Spotify track into a new Track object
func (Track) FilenameArtwork ¶
FilenameArtwork : return Track artwork filename
func (Track) FilenameTemporary ¶
FilenameTemporary : return Track temporary filename
func (Track) GetID3Frame ¶
GetID3Frame : get Track ID3 input frame string value
func (*Track) HasID3Frame ¶
HasID3Frame : return True if Track has input ID3 frame
func (Track) Seems ¶
Seems : return nil error if sequence is input sequence string matches with Track
func (Track) SeemsByWordMatch ¶
SeemsByWordMatch : return nil error if Track song name, artist and featurings are contained in sequence
type TracksDump ¶
TracksDump : Tracks dumpable object
type TracksIndex ¶
TracksIndex : Tracks index keeping ID - filename mapping and eventual filename links
func Index ¶
func Index(path string) *TracksIndex
Index triggers a path scan searching for media files and populating a TracksIndex object in return
func (*TracksIndex) Match ¶
Match returns whether an index element referenced by input id matches with input filename
func (*TracksIndex) Rename ¶
func (index *TracksIndex) Rename(id string, filename string)
Rename replace input id element with input filename
func (*TracksIndex) Sync ¶
func (index *TracksIndex) Sync(path string) error
Sync flushes tracks index object on disk at input passed path