No wonder playlists and crates tends to break with time

Warning, this is more a rant post than anything.

I’ve been working on a tools for syncing some data which isn’t done through the PRIME software. I’ve been able to change some stuff pretty easily (such as importing the added date from itunes). Same for ratings.

Now there’s still the issue that there are multiple database instances. You have at least one in your home folder, but there will be another sets of databases located on the same disk as the music files. Both databases will have metadata for the same music file. My understanding is that the database on the same drive as the music file will be the “master” for the metadata and the one on home folder will keep some data and a reference to where to get the data (probably in case the secondary database goes missing).

So far so good, even though i don’t see the point of copying the metadata. Also, i realised making a “backup” through the UI won’t backup that secondary database, so this means the backup is pretty useless since if the secondary database become corrupted or get deleted, the database in your home folder will reference a dead link and won’t be able to restore those references.

When I got to try to understand the playlist / crates, it got pretty pretty much random or at least very difficult to understand. This happen when importing from other software such as traktor or itunes. Depending on the source, the crate/playlist won’t be created in the same database. So I guess playlist always get created on the “main” database, with tracklist containing external ref but crates are stored on the local database for some reason.

I wish the engine PRIME software was open source, i could easily either suggest fixes or at least create alternate software. I mainly use itune for “database” purpose since pretty much all software got some kind of import functionality with it (itunes itself is crapware, but that’s another story).

All this because I want to import back playlists and crates stored on an exported SSD.

2 Likes

i ran into similar problems when i wrote some custom tools like this: Serato date importer

i would guess that the duplication of the crates in the home folder database happens because that way you can have tracks from different drives in the same crate.

the “Track” table in the home folder database is used for playlists and can be truncated if you don’t have any. i do it like this:

$db_usb = new SQLite3('/Users/me/Music/Engine Library/m.db');
$db_usb->query("DELETE FROM List WHERE type = 1");
$db_usb->query("DELETE FROM ListParentList WHERE listOriginType = 1");
$db_usb->query("DELETE FROM ListTrackList WHERE listType = 1");
$db_usb->query("DELETE FROM Track");