MovieFan's Database Tool for Plex

@MovieFan.Plex said:
Make sure the path is exact including the case. Even 1 letter out of place will make it not match up.

The playlist is created with the same program and the same path form.
For example, the path that appears on plex properties for one track is:

And the path that appears on m3u file is:

Maybe a problem with some incompatible character or symbol?

I can’t be sure since the two pictures are using different fonts but in the 2nd image, is there an extra space between the last closing paren and the forward slash? “Soundtrack) /02.”

It looks like there is an extra space when you compare it to other lines that use the forward slash.

@rbeatse said:
I can’t be sure since the two pictures are using different fonts but in the 2nd image, is there an extra space between the last closing paren and the forward slash? “Soundtrack) /02.”

It looks like there is an extra space when you compare it to other lines that use the forward slash.

Sorry for the images, resolution is not very good.
There is no extra space. If i copy the path from plex and from playlist the result is:

/share/Hdd1/Musica/BSO/Cine/Star Wars/Star Wars - The Force Awakens (Original Motion Picture Soundtrack)/02. The Scavenger.mp3
/share/Hdd1/Musica/BSO/Cine/Star Wars/Star Wars - The Force Awakens (Original Motion Picture Soundtrack)/02. The Scavenger.mp3

The first path is copied from plex track properties, and the second is copied from playlist (opened with notepad++).

It is strange because i use musicbee to manage all my playlist and i export these playlist as an option in music bee called ‘export like external playlist’. With this option i configured that the playlist are exported with the same path that needs plex.

The rest of playlist are imported without errors but this es the only imported without tracks.

By this reason i thinked in the first in incompatible characters or symbols.

I have debugging mode enabled and this is the ‘playlist_import.txt’ file:

dropbox.com/s/crjdipdyka8imgq/playlist_import.txt?dl=0

But i don’t see errors in it.

I am still investigating.

Thanks a lot.

Hi @MovieFan.Plex

I was working with this problematic playlist and i finded a solution.

I only renamed the playlist from ‘Star Wars’ to ‘Star’ and the playlist is imported without problems.
Maybe a problem with the length of the paths?

By the way i don’t have problems renaming playlist, then is a good solution for me.

Thanks a lot for the application.

Your images look fine. I didn’t see any special characters in that m3u so I don’t think that is the issue. I do see that you have the same track twice at the beginning. I wonder if that is causing the rest of the tracks to not get imported.

@MovieFan.Plex said:
Your images look fine. I didn’t see any special characters in that m3u so I don’t think that is the issue. I do see that you have the same track twice at the beginning. I wonder if that is causing the rest of the tracks to not get imported.

My solution was rename playlist to ‘Star’ or ‘StarWars’ and playlist is imported without problem.

The duplicated first track is because when i imported my playlist, the first track doesn’t appears on plex playlist. For example, if my playlist has 20 tracks, when is imported only the last 19 tracks are on playlist, the first not. Then i duplicated the first track on playlist and now all tracks are imported.

Thanks.

Is there a way to run this script on Linux? My Plex Server runs on unRaid 6.1.8.

The script uses a Windows scripting program. There is no port of that program for linux. I wish I knew python, then i could possibly turn this into a Plex Plugin that would run on all platforms, but that is way beyond me.

Quick question…

I used the Database Tool to change my movies to Release Date instead of Date Added after I did a mass rename to the library and it worked great. The only problem is it looked like it did the same thing to my Music library and I’am 100% sure I only clicked Movies. Is there any way to revert my music library back to date added/created?

Thanks!

No, I don’t have a revert feature.

If it changed your music libraries, that was unintentional. I thought I had this to only work on movies and TV shows, but I’m not sure I actually put in a check or if I did, it’s not working properly. I’ll need to investigate. Hopefully you made a backup of the database before you did this. You can just restore the backup and run the tool again and specifically choose the libraries to process instead of hitting all.

I did not backup the database, unfortunately. Its not a huge deal though. I am 100% sure I did not select All Libraries, only Movies, since my TV Shows remained unaltered. It somehow updated my Movies correctly but also changed the way the Music library was being sorted for **ALBUMS ** once the process completed. It appears to only be reading the “Originally Available” date for sorting albums by “Date Added.” So this means when I add a new album it now shows up below a bunch of albums I have added that have a future release date instead of showing up when the album was actually added to the database. It definitely was not this way before I ran the tool. Maybe it has something to do with the agents? Any idea on how to correct his without a database backup? It looks like if sort by artist the date added works correctly and its only a problem with the albums. Maybe a way to change the albums to sort by creation date?

Well, I don’t have a “Movie” category. It is either “All” or individual libraries. If you only have a single Movie library and you selected that, then it should only have changed the dates for that library. If your TV shows didn’t change then it sounds like you did select a single library, so I have no idea why your music library would have changed. The date added is just that, the date the entry was added to the database. There is no way to revert that since the date isn’t stored anywhere else. The only fix would be to remove the albums and add them back. Then they would have the current date. Or you manually edit each date and put in whatever date you think should be there. But again, none of the old info is saved anywhere else so there is no way to put it back the way it was.

Oh. I was just rechecking my code and I may have a bug where even selecting a single library is changing all of them.

I guess I really need to get around to finishing the update to this tool.

Luckily, my database backed up automatically last night so I was able to revert. I’ll just deal with the Movies in the recently added for now since I don’t want it to reorganize the music library also. Thanks for looking into this, hopefully it helps.

Hi all,

Probably quite late to the thread but I’m trying hard to draw my playlists from itunes with little success so far. I run PMS on a FreeNAS, I access it from mobile devices (ipads / iphones) and I usually fiddle with it from my PC.

I’ve tried several ways to get PMS to import iTunes playlists but I realised it probably does not work because of the NAS (hence different path for the files in the playlist).

I’ve exported the playlists from iTunes in m3u format (thanks for the small software, it worked very well) but I can’t make the Database Tool to work. It says it can’t find any libraries, nor playlists, it shows no detail for user…

In setting.ini, I’ve put the absolute address for the database \192.168.xxx.xxx…\Databases\com.plexapp.plugins.library.db.

I’m trying hard but I feel like I’m missing something.

Any idea?
Thanks a million!

I have not tried accessing the database overt a network path. It’s a bad idea to try. You risk corrupting the database that way. Best to copy the database file to your pc, run the script, then copy the file back.

Interesting. I’ll try that

The plot thickens:

  • If I copy only the library.db file, it seems to function when using the Database tool (it shows that I’m adding a playlist - even though it does not show the full list of songs) BUT when I copy the file back to the PMS folder, the playlist does not show :slight_smile:
  • If I copy the full folder to the C: drive, even if I add playlists and it says successful, when I List them again, the new playlist does not show
  • I’ve also try adding selectively files into the PMS folder (only the library and the dlna files) but no success so far

Any ideas?

I have tried your program to upload m3u music playlist file. when i choose the m3u file to import it says successful but when I go and check to see if it is there it shows that there isnt any there is there something that I am missing

I completed the basic setup and task to make this tool my new best friend. I recently have found out that I am a visual learner. I can and do read the words very well and understand exactly what it entails. Hell I could teach a seminar on this right now. YET for myself I am still missing something.

Is there a video walking me through these steps? If yes GREAT, If No, I might consider working it out and making one for all others (like me) out there

@anon18523487 said:
Update 4/14/2015

  • Change added_at date routine now located in Library sub-routine. Can now be done on a per library basis.

  • Added Find Unmatched feature. This will identify media on your system not matched up in Plex.

*Note - The Find Unmatched currently gives false positives for cross media in your library folders. Example, local movie posters will show as unmatched photos, and video in a photo library will show as an unmatched video. I will get these fixed soon.

MovieFan’s Database Tool for Plex v0.3.2.zip (26.5 KB)

Update 4/11/2015

There was an error in the script for performing the change added_at feature. Thanks to hthighway for finding the bug.

How To Install

Just unzip the 2 files into a folder of your choice. Find the correct version of Mosrtscript.exe and copy it into the same folder. Then right click on it and run as administrator. This will register the .mscr extension in the registry. Running it normally will say it registered, but it really doesn’t. I have also added a new file with Mortscript. It actually comes with the program but I did not include it before. It is originally called autorun.exe. It is a shortcut to run your scripts. Just rename it to match your script and running it will run the script. I have already renamed it to match my script. Just copy the file with the version of Mortscript you use. I do this so I can associate the .mscr extension with notepad as default so opening the .mscr will allow me to view the file, while running the exe will run the script. Otherwise you would need to right click and use Open With. You can skip this file and just run the .mscr file you like.