Database: Incorrect IDFolder assignments – folders show only 1 file unless physically moved

Help improve MediaMonkey 2027 by testing the latest pre-release builds, and reporting bugs and feature requests.

Moderator: Gurus

janko74
Posts: 31
Joined: Wed May 04, 2011 7:28 am

Database: Incorrect IDFolder assignments – folders show only 1 file unless physically moved

Post by janko74 »

Hi,
I’m investigating a persistent issue in MediaMonkey 5 where certain folders under Entire Library → Location (tree view) do not display all files correctly.

Example:
Folder on disk:
F:\MP3\Heavy Metal - Hard Rock\Alt. - Nu Metal - Crossover\Zombie, Rob (2001) - The Sinister Urge
This folder contains a complete album with multiple files. However, when I select the folder in the tree view, only one file is displayed . (When searching the album title, or viewing via albums the complete content is displayed).

Database findings
I inspected the MM5.DB using SQLiteSpy (which seems to be one of the few tools that can read the database without issues) and found the following:
• Albums that are displayed correctly:
→ all tracks share the same IDFolder
• Albums that are not displayed correctly:
→ each track has a different IDFolder
→ example: values incrementing from 95411 to 95421

Image

Workaround
The only reliable way to fix the issue is:
• Move the affected folder (within MediaMonkey) to another location
• Move it back again
After that, the folder contents are displayed correctly.
Moving folders directly in the Windows filesystem is not recommended, as this can lead to loss of database-linked information such as play counts, ratings, and play history.

What does NOT work
• Database maintenance
• Rescanning / “Add or update files”
• Renaming the folder in the tree view

Possible cause
I suspect this may have been caused by drive letter changes a few years ago (e.g., after swapping hard drives). However, it is noticeable that the idfolder value is in a sequence with sequential numbering.
The database is quite old (like 15 years?), and I would like to avoid losing play counts, playlists, etc.

Questions
1. Is there a safe way to rebuild or normalize IDFolder assignments so that all tracks belonging to the same album/folder share a consistent IDFolder, without losing play counts, ratings, playlists, etc.?
2. If not, any suggestions to fix it without moving manually hundreds of folders back and forth?

Suggestions / feature requests
I’m not sure how database maintenance works internally, but would it be possible to:

- add a consistency check that detects cases where tracks belonging to the same IDAlbum are assigned to different IDFolder values, even though they reside in the same physical folder?

- optionally provide an automatic repair that normalizes IDFolder so that all tracks with the same IDAlbum share a single, consistent IDFolder value?

Also, while investigating this issue, I noticed that under “Files to be processed” I was missing the filter: “files without album artist”

If anyone has insight into this issue or a clean way to fix it, I would really appreciate it.