Skip to content

Latest commit

 

History

History
122 lines (92 loc) · 4.71 KB

File metadata and controls

122 lines (92 loc) · 4.71 KB

Music Database

(C) Tim Curtis 2025

Overview

The Music Database consists of the MPD database, Library tag cache and Album cover thumbnail cache. The Library tag cache contains track metadata extracted by MPD plus custom metadata generated by moOde.

MPD database

The MPD database is generated or updated when MPD scans the directory tree where the music files are located and extracts metadata tags from the files. The database is essentially a tag cache.

File: /var/lib/mpd/database

Library tag cache

The Library tag cache is based on the MPD database and is generated when Tag or Album view is first opened. This file contains enhanced metadata thats not available in the MPD database. Subsequent access to Tag or Album view will read the tag cache file and skip reading the MPD database thus providing quick performance.

The library tag cache is automatically cleared whenever there are changes made to the MPD database thus ensuring it will be regenerated the next time Tag or Album view is accessed. it can also be manually cleared if needed.

Note that Folder view queries the MPD database directly and does not have access to the enhanced metadata and other features of Tag and Album views.

File: /var/local/www/libcache_[name].json

Album cover thumbnail cache

The Album cover thumbnail cache is generated or updated by the Thumbnail Generator. It scans the directory tree where the music files are located looking for embedded images in the tracks or a cover image file in the Album directory. The Cover Art section of Menu > Preferences has options that control how cover art is handled.

Embedded images

Supported formats include MP3, FLAC and M4A (ALAC/AAC). The last track in each Album directory is used to look for embedded cover art.

Cover image files

It looks for the image files below and if none are found then it looks for any file of type image in the album directory. It's best to consistently use one of the file names below. Menu > Preferences > Cover Art has options that control how cover art is handled including embedded cover art and artist covers.

The files below are considered first. If none are found then the first file of type image in the Album directory is chosen using the natural sort order of files in the directory.

File names File types
Cover, cover, Folder, folder jpg, jpeg, png, tif, tiff
Thumbnails

The generated thumbnail images are jpg format at a resolution and quality specified by settings in the Cover Art section of Menu > Preferences. The file name assigned to each thumbnail is created by performing an MD5 hash of the Album directory path.

The cache can be regenerated via Menu > Configure > Library, "Regenerate" Album cover thumbnail cache.

File: /var/local/www/imagesw/thmcache/

Generating the Music Database

The Music Database is generated or updated via Menu > Update library or "Regenerate music database" in Menu > Configure > Library. The process is below.

  1. MPD database update or rescan runs
  2. At the same time the thumbnail generator runs

Entries in the moOde log moodeutl -l or cat /var/log/moode.log

20250222 073431 worker: Job update_library
20250222 073431 mpdindex: Start
20250222 073431 mpdindex: Cmd (update)
20250222 073431 thumb-gen: Start
20250222 073431 thumb-gen: Scan opt: Default+
20250222 073431 thumb-gen: Priority: Embedded cover
20250222 073431 thumb-gen: Res,Qual: 600px,60
20250222 073431 thumb-gen: Px ratio: 3
20250222 073431 thumb-gen: Th width: 600
20250222 073431 thumb-gen: Thm qual: 60
20250222 073431 thumb-gen: Scanning: NAS, NVME, OSDISK, SATA USB
20250222 073435 thumb-gen: Done: 381 folders scanned, 0 thumbs created, 381 already in cache.
20250222 073443 mpdindex: Done: indexed 296 artists, 380 albums, 4248 songs
20250222 073443 worker: Job update_library done

Music directory tree

A commonly used directory tree is below. For compilation albums set the Album Artist tag in each track to a consistent string for example "Various Artists".

root/  
  |
  +-- Artist1/
         |
         +-- Album1/
               |
               +-- Track1
               .
               .
               +-- TrackN
         .
         .
         +-- AlbumN/
               |
               +-- Track1
               .
               .
               +-- TrackN
  .
  .
  +-- ArtistN/
  .
  .
  +-- Compilations/
           |
           +-- Album1/
                 |
                 +-- Track1
                 .
                 .
                 +-- TrackN
           .
           .
           +-- AlbumN/
                 |
                 +-- Track1
                 .
                 .
                 +-- TrackN