Database Structure Question

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

bripley

Database Structure Question

Post by bripley »

I've been writing some SQL to try and clean up my music database. I have a question about the relationship between the Songs table and the Covers table. It looked pretty obvious to me at first, Use the IDSong attribute on Covers to find all the cover art related to a song...

To test it, I used one of my Songs (ID 155414) with 4 pieces of art associated to it. I put four different descriptions (one on each of the covers). So, for MYSONG, there are four pieces of art with descriptions (MYSONG 1, MYSONG 2, MYSONG 3, and MYSONG4).

I run the following SQL:

SELECT ID, CoverType, CoverDescription FROM Covers WHERE IDSong = 155414

It only returns the first two Cover rows. I thought maybe they're associated to the song in anther manner, so I just tried to find them using the following:

SELECT ID, CoverType, CoverDescription FROM Covers WHERE CoverDescription LIKE 'MYSONG%'

it returns the same 2 rows...

My question is... where are the other two rows stored? I know they're there, I can see them in MM.

Thanks!
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: Database Structure Question

Post by Bex »

Your sql's are correct, the thing is that the cover table is only used for keeping track over the images but is not responsible for displaying them. Sometimes it gets wrong, especially in MM 3.0 but in MM 3.1 this works better. Try to rescan the album and MM should then update the cover table with the correct information.
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
bripley

Re: Database Structure Question

Post by bripley »

Bex wrote:Your sql's are correct, the thing is that the cover table is only used for keeping track over the images but is not responsible for displaying them. Sometimes it gets wrong, especially in MM 3.0 but in MM 3.1 this works better. Try to rescan the album and MM should then update the cover table with the correct information.
I am running MM 3.06.1190 on Vista.

I tested this by using a new song and adding 5 pieces of art each with a different comment. I ran the sql:

Select IDSong, CoverOrder, CoverDescription, CoverType FROM COVERS WHERE IDSong = 30566

and it only shows 3 (not the first 3 either). From your reply I understand that COVERS is not responsible for displaying, but I know the 5 rows should exist somewhere. How else will MediaMonkey know to display the art along with the correct description. My question is where is the Art and associated description kept if not in COVERS. If it is kept in COVERS, then why does the SQL not retrieve it?

Also, what did you mean by rescan the album? I'm not sure how to do this.

Thanks again for replying!
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: Database Structure Question

Post by Bex »

The info about the images is stored in the tags of the tracks and that's the info which is used to display them. In fact you can delete everything in the Covers table and MM will still display Album Art perfectly. The Covers table should contain the same info but sometimes it doesn't.

The Covers table is populated/updated with information when you Add or Rescan your tracks into MM. So if you rescan the folders (File->Add/Rescan bla bla) where the album is located, the Covers table will hopefully gets updated with correct info. If not you need to update to MM 3.1 (see the beta forum) where this has been fixed.
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
bripley

Re: Database Structure Question

Post by bripley »

Thanks again Bex. I downloaded MM 3.1, and then re-imported my music. It seems to be fine now.

Appreciate your help! :D
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: Database Structure Question

Post by Bex »

Bex wrote:In fact you can delete everything in the Covers table and MM will still display Album Art perfectly.
This statement isn't fully correct. It's only applicable for embedded Album Art. If you have linked Album Art then the cover table is indeed responsible for displaying them. Sorry for the mistake. I found this out while working on an update on my Tagging Inconsistencies Script.
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Post Reply