PDA

View Full Version : Quick Question - Locking Files in Bulk



hsbrown2
06-16-2020, 05:14 AM
I'm working on validating all the metadata for my music (a daunting task).

I'd like to lock all the files after I am done, and I'm hopeful that it will reduce indexing time as I add new stuff. Right now, all the music files are unlocked, and there are several hundred thousand of them, which would be painful through the GUI. I'm ensuring the metadata source is accurate (not using web metadata), as opposed to using the Mezzmo GUI, so once the metadata is set, I want it to ignore any file/object that has the "Locked" flag set.

It doesn't look like the CLI offers this kind of bulk management.

Is there a way to connect to the Mezzmo database directly, and if so, is there a query I can run that tells Mezzmo to tick the "Locked" flag on all the music files?

Thanks!

jbinkley60
06-16-2020, 06:36 AM
I'm working on validating all the metadata for my music (a daunting task).

I'd like to lock all the files after I am done, and I'm hopeful that it will reduce indexing time as I add new stuff. Right now, all the music files are unlocked, and there are several hundred thousand of them, which would be painful through the GUI. I'm ensuring the metadata source is accurate (not using web metadata), as opposed to using the Mezzmo GUI, so once the metadata is set, I want it to ignore any file/object that has the "Locked" flag set.

It doesn't look like the CLI offers this kind of bulk management.

Is there a way to connect to the Mezzmo database directly, and if so, is there a query I can run that tells Mezzmo to tick the "Locked" flag on all the music files?

Thanks!

You can do it via the GUI for everything in a playlist. Select the first item in the playlist, hold down the shift key on the last item and click it. This should select all of the items. Then go to properties, and click the lock button in the top right corner and Click Ok.

In the database there is a table called MGOFile and a column called lock. A 1 in that field indicates a lock for the file in that line. A 0 is unlocked.

hsbrown2
06-16-2020, 01:34 PM
In the GUI is fine if you’re just doing a few, but if you try to shift+select too many at once, it bombs. With close to a million files using the GUI would take months, but update blah Set blah = 1 where blah=0 would be infinitely faster. What tools are there to execute queries? I think it’s SQLite but I’m not sure. Is there a free management studio somewhere? How do I connect to the DB?

jbinkley60
06-16-2020, 05:12 PM
I use DB Browser for SQL Lite . It works great and you can write, run your own SQL statements or cut/paste in bulk. Just make sure you do a backup before starting.

hsbrown2
06-21-2020, 05:41 AM
Perfect! UPDATE MGOFile SET Lock = '1' WHERE Lock = '0' worked like a charm (I just locked everything at this point, although there are a couple of items I still need to fix).

jbinkley60
06-21-2020, 07:22 AM
Yep, that SQL query will do it. Glad it worked for you.