Documentation
¶
Index ¶
- func ExtractAllMetadata(inputs []string) (map[string]*Metadata, error)
- type FolderScanner
- type Metadata
- func (m *Metadata) Album() string
- func (m *Metadata) AlbumArtist() string
- func (m *Metadata) Artist() string
- func (m *Metadata) BitRate() int
- func (m *Metadata) Comment() string
- func (m *Metadata) Compilation() bool
- func (m *Metadata) Composer() string
- func (m *Metadata) DiscNumber() (int, int)
- func (m *Metadata) DiscSubtitle() string
- func (m *Metadata) Duration() float32
- func (m *Metadata) FilePath() string
- func (m *Metadata) Genre() string
- func (m *Metadata) HasPicture() bool
- func (m *Metadata) ModificationTime() time.Time
- func (m *Metadata) Size() int64
- func (m *Metadata) SortAlbum() string
- func (m *Metadata) SortAlbumArtist() string
- func (m *Metadata) SortArtist() string
- func (m *Metadata) SortTitle() string
- func (m *Metadata) Suffix() string
- func (m *Metadata) Title() string
- func (m *Metadata) TrackNumber() (int, int)
- func (m *Metadata) Year() int
- type Scanner
- type Status
- type StatusInfo
- type TagScanner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FolderScanner ¶
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
func (*Metadata) AlbumArtist ¶
func (*Metadata) Compilation ¶
func (*Metadata) DiscNumber ¶
func (*Metadata) DiscSubtitle ¶ added in v0.19.0
func (*Metadata) HasPicture ¶
func (*Metadata) ModificationTime ¶
func (*Metadata) SortAlbumArtist ¶ added in v0.16.0
func (*Metadata) SortArtist ¶ added in v0.16.0
func (*Metadata) TrackNumber ¶
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
func (*Scanner) Status ¶
func (s *Scanner) Status() []StatusInfo
type StatusInfo ¶
type TagScanner ¶
type TagScanner struct {
// contains filtered or unexported fields
}
func NewTagScanner ¶
func NewTagScanner(rootFolder string, ds model.DataStore) *TagScanner
func (*TagScanner) Scan ¶
Scanner algorithm overview: Load all directories under the music folder, with their ModTime (self or any non-dir children, whichever is newer) Load all directories from the DB Compare both collections to find changed folders (based on lastModifiedSince) and deleted folders For each deleted folder: delete all files from DB whose path starts with the delete folder path (non-recursively) For each changed folder: get all files from DB whose path starts with the changed folder (non-recursively), check each file:
if file in folder is newer, update the one in DB
if file in folder does not exists in DB, add it
for each file in the DB that is not found in the folder, delete it from DB
Create new albums/artists, update counters:
collect all albumIDs and artistIDs from previous steps refresh the collected albums and artists with the metadata from the mediafiles
For each changed folder, process playlists:
If the playlist is not in the DB, import it, setting sync = true If the playlist is in the DB and sync == true, import it, or else skip it
Delete all empty albums, delete all empty artists, clean-up playlists