-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DB Error: no such collation sequence: naturalsort #18
Comments
Can you check issue #17 ? (I think this comment I just made should have a link in it) |
I was able to fix the original issue by manually updating the sql lite dll and placing it in the programs folder. Now I am having an issue creating a playlist: DB Error: no such collation sequence: icu_root Are there any workarounds? I created an additional issue in #19 |
The 2 google searches that pulled up anything about icu_root are both from within the last 1 month. Both seemed to agree that you need to step back to an older version of sqlite3. https://forums.plex.tv/t/plex-not-importing-new-media/706729 |
Thank you for investigating this. It appears to be some sort of structural issue. Unfortunately, I tried with an older Sql lite version that I was able to find using the way back site here : https://www.sqlite.org/2019/sqlite-dll-win32-x86-3290000.zip with no luck. As a next step I posted a issue on the plex forum: https://forums.plex.tv/t/error-checking-db-integrity-error-no-such-collation-sequence-icu-root/709470 . There was a related issue and fix posted here: https://forums.plex.tv/t/error-deleting-collections/701586 but that fix doesn't seem to correct the specific issue i am seeing with the latest server version. |
Ok I was able to get the import working. Overall the primary blocker was schema related and not a sqlite3 version issue. I took these steps to get the import working:
Overall it seems that raw db inserts and updates are pretty broken. Not sure what can be done through the python libraries given the recent schema changes. |
zbourdeau's workaround allowed me to import a playlist into an existing playlist:
Could the abcence of these triggers during importing lead to database corruption? I will look into the |
Thanks for the update. If this continues to be a problem for people I'll see about adding it into the codebase. |
I went further down into this rabbit hole and managed to find a partial workaround for creating playlists. CREATE INDEX 'index_title_sort_icu' ON 'metadata_items' ('title_sort' COLLATE icu_root); Changing this index to use the BINARY collation seems to resolve the problem. But we still run into the unknown tokenizer error while creating a playlist. We can avoid this error by disabling the One problem remains: while the new playlist is added to the database it does not show up in the plex interface. This might be caused by the disabled trigger that would normally add an entry to fts4_metadata_titles_icu: CREATE TRIGGER fts4_metadata_titles_after_insert_icu AFTER INSERT ON metadata_items BEGIN INSERT INTO fts4_metadata_titles_icu(docid, title, title_sort, original_title) VALUES(new.rowid, new.title, new.title_sort, new.original_title); END; So, to recap, this workaround lets the script create a playlist and add tracks to it, but the playlist does not show up in plex:
|
I found some info about the underlying problem causing these issues in this thread on the Plex forum. It seems Plex recently started using collation extensions to SQLite to improve search. This means the Plex database can only be edited using the SQLite version built into Plex ( We are running into these issues because PlexPlaylistImporter uses the SQLite version bundled with python, which does not contain the extensions Plex uses now. Can PlexPlaylistImporter be changed to use the Plex version of SQLite? |
On windows this software does actually use the sqlite3.dll. So if you put a sqlite3.dll in its working directory, it will use that. For Linux, you can probably use LD_LIBRARY_PATH to accomplish what you want. Just set the directory of where the sqlite3.so file is (I'm assuming that is the file name, I do not have plex installed on linux ATM). Your best bet is to probably copy the sqlite3.so file that you want to use into the PlexPlaylistImporter working directory and use "./" as your LD_LIBRARY_PATH (it might need an absolute path though, unsure). |
Creating the playlist in Plex before importing without removing the triggers did not work and resulted in a new error: Thanks! |
Unfortunately, My playlists continue to get wiped out by plex server updates. It looks like I am going to have to do this again. It would be ideal if Plex had a built in import API where we can provide a file name or file path and a playlist name. Anyone know who to reach out to at Plex to ask for better functionality in this regard? |
It's been over 5 years since I've touched this project and things may have changed in their sqlite user databases. As far as I know, there is no official Plex API. The only official "API" I could find of theirs involved querying data via the web client. It looks like there has been some serious work in the last few years on hooking into the undocumented Plex API in Python and some other languages. I can almost guarantee you that reaching out to the creators of Plex will get you nowhere. The most you may get is to add a +1 to a request for an API, which is unlikely to ever be responded to. This kind of thing just isn't on their radar of interest. Did you create your playlist originally in Plex and just update the contents through this project? |
On the latest version of plex import seems to fail. This is the error I am encountering:
PlexPlaylistImporter.exe PlaylistFile.m3u PlayListFile
Plex playlist is not already created. Would you like to create it now (y/n)? y
DB Error: no such collation sequence: naturalsort
Note: The script is not detecting that the playlist already is created or is creating the playlist.
The text was updated successfully, but these errors were encountered: