Thank you for your donation!


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


Problem: Wrong track count in tag view?
#1
I've a flac only music collection on my NAS. Minimserver says 2075 albums - 22691 tracks. I also counted them via another program, and have the same numbers.

In the tag view of MoOde I get 2075 albums, but 22813 tracks. I was able to identify the difference of 122 tracks is in the "Jazz" genre (19282 tracks), but not the actual tracks themselfves. However, I'm confident 22691 tracks is the right overall number. The total number of files on the drive (which are not folders) is 24766, being 22691 flac files + 2075 folder.jpg files for the albums.

I already regenerated the musiic library, but with the same result.

Are there other artifacts that are taken into account as tracks?

Is the fact that the track artist on an album not being always the same as the album artist, a possible route? I've 61 albums in this case, which is (by coincidence?) the half of 122. So, maybe those are counted 3 times instead of 1?

Any idea how I can troubleshoot this?

Tx,
Kurt
Reply
#2
Run the command below to see what MPD reports for collection stats

Code:
mpc stats

IIRC there can be differences between MPD stats, moOde stats and file/folder counts for example I think MPD may only tally 1 occurrence of multiple albums named "Greatest Hits" while moOde will tally each one. Something like that.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(09-29-2023, 07:46 PM)Tim Curtis Wrote: Run the command below to see what MPD reports for collection stats

Code:
mpc stats

IIRC there can be differences between MPD stats, moOde stats and file/folder counts for example I think MPD may only tally 1 occurrence of multiple albums named "Greatest Hits" while moOde will tally each one. Something like that.

Hi Tim,

Thanks for the swift reply.

pi@moode:~ $ mpc stats
Artists:   2183
Albums:    2044
Songs:    22813

This explains where the 22813 is coming from, which seems odd, as it should be 22691.
But... I took a look at the mpc man pages and diiscovered "mpc listall ", giving me the liist of all 22813 files. 
So, I can start comparing them in Excel. Keep you posted about my findings.
Reply
#4
I did some strange findings...

"mpc listall" indeed lists some duplicates (I found all of them) like the one below:
Gare du Nord/Stronger/10 We Still Grow.flac
Gare Du Nord/Stronger/10 We Still Grow.flac
Kenny Dorham/Una Mas/01 Una Mas (One More Time).flac
Kenny Dorham/Una Mas/01 Una Mas (One More Time).FLAC

I checked the disk, and there are no duplicates. Seems mpd lost track?
Reply
#5
Couple of things to look for

1. Hidden dot files
Try ls -al on a couple of the directories. There should only be the standard Linux . and .. at the top.

2. Try the commands below to either print all the title tags in the libcache_all.json file or just generate a count of titles. It might show duplicate titles or some other tagging situation. The libcache file is what is generated by moOde from the MPD database.

Code:
# Summary count of number of lines with title tag
cat /var/local/www/libcache_all.json | json_pp -f json -t dumper -json_opt pretty | grep title | wc -l

# Print lines with title tag
cat /var/local/www/libcache_all.json | json_pp -f json -t dumper -json_opt pretty | grep title
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#6
The count says 22831 compared to the expected 22691.

I see things like:
  {
    album => "Una Mas",
    album_artist => "Kenny Dorham",
    artist => [
      "Kenny Dorham"
    ],
    comment => "",
    composer => "Kenny Dorham",
    disc => 1,
    encoded_at => "16/44.1 FLAC,s,2",
    file => "NAS/Music/Kenny Dorham/Una Mas/01 Una Mas (One More Time).FLAC",
    genre => [
      "Jazz"
    ],
    last_modified => "2022-08-04T07:47:50Z",
    mb_albumid => 0,
    time => 918,
    time_mmss => "15:18",
    title => "Una Mas (One More Time)",
    tracknum => 1,
    year => 1963
  },

But the file "NAS/Music/Kenny Dorham/Una Mas/01 Una Mas (One More Time).FLAC", with .FLAC in uppercases does not exist...

The "Gare du nord" entries appear twice. Like this one for example
{
    album => "Club Gare du Nord",
    album_artist => "Gare du Nord",
    artist => [
      "Gare du Nord"
    ],
    comment => "",
    composer => "Gare du Nord",
    disc => 1,
    encoded_at => "16/44.1 FLAC,s,2",
    file => "NAS/Music/Gare Du Nord/Club Gare du Nord/07 Tom's Song.flac",
    genre => [
      "Jazz"
    ],
    last_modified => "2022-05-03T16:16:40Z",
    mb_albumid => 0,
    time => 230,
    time_mmss => "03:50",
    title => "Tom's Song",
    tracknum => 7,
    year => 2005
  },


The ls -la shows what I expeted, but that's not what mpc -listall says...
pi@PI4B:/mnt/Music/Kenny Dorham/Una Mas $ ls -la
total 215520
drwxrwxrwx 1 root root        0 Sep  4 15:28  .
drwxrwxrwx 1 root root     4096 Sep  4 15:28  ..
-rwxrwxrwx 1 root root 94146447 Sep 14 03:02 '01 Una Mas (One More Time).flac'
-rwxrwxrwx 1 root root 58245497 Sep 14 03:02 '02 Straight Ahead.flac'
-rwxrwxrwx 1 root root 42485375 Sep 14 03:02 '03 Sao Paulo.flac'
-rwxrwxrwx 1 root root 25768716 Sep 14 03:02 '04 If Ever I Would Leave You.flac'
-rwxrwxrwx 1 root root    40928 May 27  2022  folder.jpg

pi@PI4B:/mnt/Music/Gare du Nord/Club Gare du Nord $ ls -la
total 234114
drwxrwxrwx 1 root root     4096 Sep  4 12:55  .
drwxrwxrwx 1 root root     4096 Sep  4 12:58  ..
-rwxrwxrwx 1 root root 21679708 May  3  2022 '01 Are You Coming With Me.flac'
-rwxrwxrwx 1 root root 27657818 May  3  2022 "02 What's Up.flac"
-rwxrwxrwx 1 root root 17820641 May  3  2022 "03 It's In The Mind, Not In The Eye.flac"
-rwxrwxrwx 1 root root 24671675 May  3  2022 '04 Poor Boy'\''s Blues (for Nick Drake).flac'
-rwxrwxrwx 1 root root 20973721 May  3  2022 '05 Exquis-It, Baby.flac'
-rwxrwxrwx 1 root root 28866784 May  3  2022 "06 Somethin' Like That.flac"
-rwxrwxrwx 1 root root 20377962 May  3  2022 "07 Tom's Song.flac"
-rwxrwxrwx 1 root root 14154032 May  3  2022 '08 (Watch Your Step) Mind The Gap.flac'
-rwxrwxrwx 1 root root 18890162 May  3  2022 '09 Go Back, Jack!.flac'
-rwxrwxrwx 1 root root 13576406 May  3  2022 '10 Where Is Your Monkey.flac'
-rwxrwxrwx 1 root root 31012160 May  3  2022 '11 We Still Grow.flac'
-rwxrwxrwx 1 root root    40540 May  3  2022  folder.jpg
Reply
#7
Very odd. Maybe there is something hidden that MPD is indexing or something in the NAS file tree thats not obvious. 

You could try browsing on-demand via Folder view which uses the lsinfo <path> command.

Also via MPD directly. The lsinfo command with no path will list the root directories that MPD indexes.

Code:
telnet localhost 6600
lsinfo

lsinfo "SDCARD"

lsinfo "directory path"
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#8
Hi Tim,

I fixed it. Seems the MPD DB was corrupt.

I did following steps:
1) sudo service mpd stop
2) sudo rm /var/lib/mpd/database
3) sudo service mpd start
4) mpc rescan

Now, "mpc stats" lists 22691 files, and this is also what shows up in the tag view.

Thanks for your help!
Reply
#9
Interesting and glad its fixed.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: