jcorporation / myMPD

myMPD is a standalone and mobile friendly web mpd client with a tiny footprint and advanced features.
https://jcorporation.github.io/myMPD/
GNU General Public License v3.0
418 stars 65 forks source link

CoverGrid repeating each track as an album #254

Closed AgentKith closed 4 years ago

AgentKith commented 4 years ago

myMPD version: 6.3.1

Browse -> CoverGrid showing every track as it's own album

Go to browse, and then click on the CoverGrid tab. This should be showing albums only. But I'm seeing duplicates of the same album. If an album has 10 tracks, the album is repeated 9 times (n-1).

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'Browse'
  2. Click on 'CoverGrid'
  3. Click every album, it shows the correct tracks in the album. But the number of albums displayed is duplicated by "total number of tracks" -1.
  4. It's doing the opposite of first song (displays everything but the first song, hence n-1).

Expected behavior

It should only show the first song of each album (instead of the opposite).

Screenshots CoverGrid

Server plattform (please complete the following information):

Client plattform (please complete the following information):

Debug logs (please attach if it can be usefull)

AgentKith commented 4 years ago

BTW, forgot to mention myMPD is built from source. And this is my build commands:

./build.sh cleanupdist
ENABLE_SSL="OFF" ENABLE_LIBID3TAG="ON" ./build.sh release

FWIW I tried with libid3tag ON and OFF and still get the same results.

jcorporation commented 4 years ago

This could be the case if your songs in your Albums has all the track number set to one. For the covergrid myMPD does a search for all tracks with number one.

AgentKith commented 4 years ago

Here's the tag info for one of the albums (Col 7#): image

Interestingly, if I modify src/mpd_client/mpd_client_browse.c, line #370 to such:

sds expression = sdscatprintf(sdsempty(), "((Track != '%d')", config->covergridminsongs);

The returned JSON message appears to be correct (Note first song URI is now returning the first track now, instead of 2 and up): image

I'm still tracing through to find the issue (as I'm not sure if this is MPD, or libmpdclient or myMPD related). Seems somewhere is inverting the search result for tracks?

There's also a potential problem to this search. What if the album has no tags for Track (or any tags at all?), will this search still show the album if it's not ID3 tagged?

jcorporation commented 4 years ago

myMPD uses the embedded libmpdclient not the shared library from the system.

The covergrid does not work if the music files are not correctly taged.

This search is the fastest method to get all needed information in one pass from mpd. A better approach is of course welcome.

Seems somewhere is inverting the search result for tracks?

Enable verbose log in mpd and you should see more.

jcorporation commented 4 years ago

MPD verbose log and myMPD debug log of the unpatched myMPD will be usefull. I can not reproduce the behavior.

jcorporation commented 4 years ago

@AgentKith: I close this issue now as invalid. Please post appropriated debug logs if I should dig deeper in this issue.