szapp/exportPlaylists

ERROR: Library ID was not found.

Closed this issue · 4 comments

rsgca commented

Hi szapp! Attempting to run ./exportPlaylists.py returns the error "Library ID was not found."

I can see this is from the getLibID() function. What's the best way for me to begin troubleshooting this error?

szapp commented

Hi Richard, the script seems to fail in reading the SQL database. You could create the SQL dump of the library manually to confirm the integrity of the music database. I suggest doing the following:

  1. Confirm the location of your banshee library. The python script assumes the path to be ~/.config/banshee-1/banshee.db. If yours differs you can adjust it in line 217.

  2. Create the SQL dump file via command line:

    /usr/bin/sqlite3 ~/.config/banshee-1/banshee.db ".dump" > ~/tmp.sql
  3. Check whether the file ~/tmp.sql was created and is not empty.

  4. Open the file in a text editor and search for a line containing both INSERT INTO "CorePrimarySources" and 'MusicLibrarySource-Library'.

The last step is where the script seems to fail.

If you can pinpoint which step causes the problem, I might be able to adjust the script if necessary. Unfortunately, I have only ever used the script on one machine myself, so it would not surprise me if I missed something.

Thanks for your interest!

rsgca commented

Szapp, after successfully dumping the tmp.sql, I can see that all the INSERT INTO lines do not have quotation marks.

For example, my sql at line 32 reads INSERT INTO CorePrimarySources VALUES(1,'MusicLibrarySource-Library',26254,0);

So, after removing all the quotation mark occurrences in all the conditionals,

# if ('INSERT INTO "CorePrimarySources"' in line
if ('INSERT INTO CorePrimarySources' in line 
...
# if 'INSERT INTO "CoreTracks"' in line:
if 'INSERT INTO CoreTracks' in line:
...
# if 'INSERT INTO "CorePlaylists"' in line:
if 'INSERT INTO CorePlaylists' in line:
...etc

the script successfully exported the playlists.

I'm running Banshee 2.6.2, sqlite3 3.19.3, and Python 2.7.14 on Ubuntu 17.10

szapp commented

Thank you for debugging the script and posting the solution. I will integrate both alternatives in the code soon. I don't know when I'll find the time, so feel free to create a pull request, if you want.

szapp commented

Thanks!