Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Idea: In tag view use artists instead of albumartist
#2
When the Library is displayed and both Artist and Album Artist tags are populated in a song, the Album Artist is preferred when displaying the Artist field. The Album Artist tag is also used to identify Compilation albums by being populated with a constant string like "Various Artists".

I have a Jazz collection including trad, swing, bop, cool, fusion, etc. A single Artist or in the case of compilations, Album Artist set to "Various Artists" has always worked well.

I think the Performer tag (or multiple Performer tags) is supposed to be used to identify all the artists in a band or group but I've rarely seen that tag populated at least by any of the utilities that I've used.

Here are the tags that MPD recognizes
https://www.musicpd.org/doc/html/protocol.html#tags

Here are the tags used by moOde Library
https://github.com/moode-player/moode/bl...yerlib.php

Code:
// Generate library array (@chris-rudmin rewrite)
function genLibrary($flat) {
  $lib = array();

  foreach ($flat as $flatData) {
      $songData = array(
          'file' => $flatData['file'],
          'tracknum' => ($flatData['Track'] ? $flatData['Track'] : ''),
          'title' => ($flatData['Title'] ? $flatData['Title'] : 'Unknown Title'),
          'disc' => ($flatData['Disc'] ? $flatData['Disc'] : '1'),
          'artist' => ($flatData['Artist'] ? $flatData['Artist'] : 'Unknown Artist'),
          'album_artist' => $flatData['AlbumArtist'],
          'composer' => ($flatData['Composer'] ? $flatData['Composer'] : 'Composer tag missing'),
          'year' => getTrackYear($flatData),
          'time' => $flatData['Time'],
          'album' => ($flatData['Album'] ? $flatData['Album'] : 'Unknown Album'),
          'genre' => ($flatData['Genre'] ? $flatData['Genre'] : 'Unknown'),
          'time_mmss' => songTime($flatData['Time']),
          'last_modified' => $flatData['Last-Modified'],
          'encoded_at' => getEncodedAt($flatData, 'default', true)
      );

      array_push($lib, $songData);
  }

  $json_lib = json_encode($lib, JSON_INVALID_UTF8_SUBSTITUTE);
  debugLog('genLibrary(): $lib, size= ' . sizeof($lib));
  debugLog('genLibrary(): $json_lib, length= ' . strlen($json_lib));
  debugLog('genLibrary(): json_last_error()= ' . json_last_error_msg());

  if (file_put_contents(LIBCACHE_JSON, $json_lib) === false) {
      debugLog('genLibrary: create libcache.json failed');
  }
  //workerLog(print_r($lib, true));
  return $json_lib;
}
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Messages In This Thread
RE: In tag view use artists instead of albumartist - by Tim Curtis - 08-11-2020, 01:03 PM

Forum Jump: