Home Page
  • November 11, 2024, 09:19:42 pm *
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Official site launch very soon, hurrah!


Author Topic: Plex Playlist Importer  (Read 125008 times)

clowg

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Plex Playlist Importer
« Reply #15 on: December 04, 2014, 11:04:21 pm »

You guessed it right.  A playlist with 150 remote songs works.  A playlist with 160 remote songs doesn't.

G.
Logged

Dakusan

  • Programmer Person
  • Administrator
  • Hero Member
  • *****
  • Posts: 546
    • View Profile
    • Dakusan's Domain
Re: Plex Playlist Importer
« Reply #16 on: December 05, 2014, 04:34:19 pm »

Weird. You should report that as a bug to Plex. Best way you can help open source software as a non coder ^_^
Logged

clowg

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Plex Playlist Importer
« Reply #17 on: December 05, 2014, 07:12:44 pm »

I will do it now.
Logged

Dakusan

  • Programmer Person
  • Administrator
  • Hero Member
  • *****
  • Posts: 546
    • View Profile
    • Dakusan's Domain
Re: Plex Playlist Importer
« Reply #18 on: February 12, 2015, 01:33:55 am »

OK. This is really weird, somehow your message was deleted sometime in the last few weeks, but fortunately the monthly SQL backup caught it and I was able to restore it.

Sorry for taking so long to get back to you on this, but since you were able to take care of everything yourself, I wasn't considering it too urgent :-)

All of your suggestions are really great and I'll most likely add most of them to my next version when I get the chance. Thanks for all the great suggestions!

As for the Python version... yeah... I had to make an active choice when starting this project which one I wanted to use, and I forget why, but I decided to go with the latest version of Python, even though I knew it wasn't as well supported/deployed. If it's not too much work, I'll see if I can't get it compiling in v2.7.x also.
Logged

Dakusan

  • Programmer Person
  • Administrator
  • Hero Member
  • *****
  • Posts: 546
    • View Profile
    • Dakusan's Domain
Re: Plex Playlist Importer
« Reply #19 on: May 09, 2016, 04:37:17 pm »

@Pierre: Are you sure you are running Python3 and not Python2?

@ulle: I'm not exactly sure what you are trying to ask. Any user could potentially use the software as long as they meet 3 conditions:
  • They have python 3 installed (and any dependent libraries)
  • They have access to the playlist and the files inside the playlist
  • They have access to write to the plex database file
Logged

Skipper42

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Plex Playlist Importer
« Reply #20 on: June 07, 2016, 01:29:38 am »

Background: running PlexPlaylistImporter.exe on the PMS host (Win 7 x64 SP1 fully patched, PMS 0.9.16.6.1993 - latest version).

Testing import of an m3u music playlist; edited to ensure full paths to all mp3 files including drive letter are in the m3u.

I get the prompt to create the new PMS playlist (it doesn't already exist), and after answering 'y' to the prompt, I get the following:
DB Error: no such module: fts4

Explicitly identifying the PMS database path and filename in the command line made no difference.

Do I separately need to install and run Python 3, or is the one on the (running) PMS sufficient?

TIA,
S
Logged

Dakusan

  • Programmer Person
  • Administrator
  • Hero Member
  • *****
  • Posts: 546
    • View Profile
    • Dakusan's Domain
Re: Plex Playlist Importer
« Reply #21 on: June 07, 2016, 08:42:25 am »

From an internet search "This error is happening because of [your] build of SQLite does not include the FTS modules." So I'd guess that either your sqlite3 libs, or python sqlite3 libs need to be updated. I really need to get a windows executable compiled for it...

You might want to try using the provided executable instead. It is at the top of the project page under "Downloads: Binary".

[Edit] After rereading your message... are you already using the executable I provided?
« Last Edit: June 07, 2016, 08:50:34 am by Dakusan »
Logged

Skipper42

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Plex Playlist Importer
« Reply #22 on: June 07, 2016, 01:22:33 pm »

You're correct - I'm using your binary from here.

I copied all the content from the downloaded Zip archive to a corresponding folder: C:\Program Files (x86)\PlexPlaylistImporter\.

I don't have SQL Lite installed per se; I only have PMS (latest version) installed and running. Do I need to do anything else to ensure the correct DLLs get used?

Thanks!
Logged

Dakusan

  • Programmer Person
  • Administrator
  • Hero Member
  • *****
  • Posts: 546
    • View Profile
    • Dakusan's Domain
Re: Plex Playlist Importer
« Reply #23 on: June 07, 2016, 03:33:27 pm »

Just to make sure... you do have the sqlite3.dll in the same directory as the PlexPlaylistImporter.exe, right?

Yeah, my next guess was going to be that it was choosing the wrong dll.

The article I linked says:
  • If a DLL with the same module name is already loaded in memory, the  system uses the loaded DLL, no matter which directory it is in. The  system does not search for the DLL.
  • If the  DLL is on the list of known DLLs for the version of Windows  on which the application is running, the system uses its copy of the  known DLL (and the known DLL's dependent DLLs, if any). The system does  not search for the DLL. For a list of known DLLs on the current system,  see the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs.     
So it is most likely the first one. Is it possible for you to temporarily unload the program that is using it? You can also search for DLL usage handles by using Process Explorer. In the find menu there is a "Find Handle or DLL... (Ctrl+F)" option.
If you are unable to stop the other process, you can try manually replacing the .dll in its folder, but that is risky
Logged

Skipper42

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Plex Playlist Importer
« Reply #24 on: June 07, 2016, 05:16:32 pm »

Yes, the sqlite3.dll is in the same folder as the executable.
A quick check in Process Explorer shows three other active instances of two separate sqlite3.dll copies: - Backup software infrastructure component; I may be able to stop this service, reboot, and proceed without having the service restart, so it's at least something I can try. - PlexDLNAServer.exe - PMS
If I don't need PMS running when doing the import, this should be manageable. Both PMS and the DLNA server use the same copy in the PMS directory.
I'll note that a Win Explorer search found 9 separate copies of sqlite3.dll, all with different dates and sizes, including some not currently active: - PlexPlaylistImporter - PMS - MediaMonkey (which I'm using til I get music playlist imports to work in PMS) - Kodi (ditto; horse race for which gets there first) - Backup software - Security software
Thanks!
Logged

Skipper42

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Plex Playlist Importer
« Reply #25 on: June 08, 2016, 04:12:12 pm »

I've disabled the services using sqllite3.dll, rebooted, and confirmed those services are not running. I've also not started PMS.
When I run the batch file that launches PlexPlaylistImporter.exe, however, after answering 'y' to create the new PMS playlist, I get the same error:   Plex playlist is not already created. Would you like to create it now (y/n)? y   DB Error: no such module: fts4
I've verified in the Registry (HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs) and in Process Explorer that the sqllite3.dll in the PlexPlaylistImporter.exe folder – C:\Program Files (x86)\PlexPlaylistImporter – is not known to the system. The same is true of the python34.dll in the same PPI folder. It looks to me like the program is failing to find and load the DLLs.
Any suggestions?
Thanks!
Logged

Skipper42

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Plex Playlist Importer
« Reply #26 on: June 09, 2016, 02:01:55 pm »

Googled the problem and found this:
https://www.sqlite.org/fts3.html#section_2
  • If a build of SQLite does not include the FTS modules, then any attempt to prepare an SQL statement to create an FTS3 or FTS4 table or to drop or access an existing FTS table in any way will fail. The error message returned will be similar to "no such module: ftsN" (where N is either 3 or 4).
Since that seemed to suggest the sqlite3.dll in your executable binary distro was built without FTS4, I hunted down an x86 version that did (the x64 version didn't work, since your app is x86, apparently). After putting the DLLs, the executable, and the importing .m3u all in the same directory...
IT WORKED! I now have the test .m3u successfully imported into the Plex Playlists, and it plays!
I can't believe the Plex folks cannot figure out how to do this on their own.  You're my hero for the day!
Many thanks for your patience, advice and hard work on this.
Logged

Dakusan

  • Programmer Person
  • Administrator
  • Hero Member
  • *****
  • Posts: 546
    • View Profile
    • Dakusan's Domain
Re: Plex Playlist Importer
« Reply #27 on: June 09, 2016, 04:00:50 pm »

Awesome! Glad you got it working! Sorry I couldn't have been more help on fixing it. Busy busy.

Very interesting @ the proc architecture. I had never even thought about seeing what arch the files compiled as. Though x86 makes sense for the extended compatibility, which for a project like this, is appropriate. Will definitely keep it in mind for the future
Logged

Skipper42

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Plex Playlist Importer
« Reply #28 on: June 11, 2016, 07:56:24 pm »

For some reason, I'm unable to reproduce the working import function with other m3u playlists.
I'm getting the same gibberish characters as the earlier poster (Clowg) at the front of the first line; switching to relative paths from absolute paths doesn't help. Doesn't matter whether the line is blank or an actual reference to an mp3 file. The references are correct; I've verified that with Explorer.
I've used mp3Tag, Notepad, and Wordpad all. Saving as UTF-8, Unicode, Unicode Big Endian... none of that changes the outcome. I'm also not getting the prompt to create the new playlist.
Here's what I get:ListImporter 'Winamp playlist': Cannot find file listed in playlist (must be relative to the playlist): E:\Users\Public\Music\Music Library\<artist>\<album>\<song>.mp3
Also doesn't matter whether I'm running from the command line, from a batch file, or where the playlist file is relative to PlexPlaylistImporter.exe. I'm specifying in the command line the filename of the playlist, the playlist name, and the file path and name of the PMS database. Doesn't matter whether or not PMS is running.
Finally, mp3Tag has no problem finding the associated mp3's from the playlist when opening the playlist .m3u in mp3Tag.
Hope this helps you diagnose the fault.
Thanks!
Logged

Dakusan

  • Programmer Person
  • Administrator
  • Hero Member
  • *****
  • Posts: 546
    • View Profile
    • Dakusan's Domain
Re: Plex Playlist Importer
« Reply #29 on: June 11, 2016, 10:58:51 pm »

Whatever program you used to save the playlist file as UTF8 is adding a BOM (byte order marker) to the beginning of the file, specifically, the utf8 BOM " ". It needs to not be in the file. You can generally set a setting in your text editor to not include it. I'll see if I can't make an update soon to bypass this problem.
Logged