I started analyzing the code to a certain extent and tried to track down the issue, although I am not really familiar with php.
In libcache.json each track only has one single genre:value pair.
The flat data are generated in playerlib.php within the genLibrary function:
Genre is only mapped once. But I assume that listallinfo delivers multiple genre:value pairs.
So the problem probably already occurs in genFlatList(), because the tags from a listallinfo record are mapped into an array $flat with the tag names as keys. If more tags with the same name occur in a record, only the last occurrence will be finally kept in the array due to the uniqueness of keys.
On the other hand, when selecting "track info" for a single file in the GUI, all genres are listed. Obviously mpd is queried here directly and not the Moode lib.
In libcache.json each track only has one single genre:value pair.
The flat data are generated in playerlib.php within the genLibrary function:
PHP Code:
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)
);
Genre is only mapped once. But I assume that listallinfo delivers multiple genre:value pairs.
So the problem probably already occurs in genFlatList(), because the tags from a listallinfo record are mapped into an array $flat with the tag names as keys. If more tags with the same name occur in a record, only the last occurrence will be finally kept in the array due to the uniqueness of keys.
On the other hand, when selecting "track info" for a single file in the GUI, all genres are listed. Obviously mpd is queried here directly and not the Moode lib.