Skip to content
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

[Linux] Symlinks' path converted to destination path #7

Open
qoxxxx opened this issue Jan 16, 2017 · 3 comments
Open

[Linux] Symlinks' path converted to destination path #7

qoxxxx opened this issue Jan 16, 2017 · 3 comments

Comments

@qoxxxx
Copy link

qoxxxx commented Jan 16, 2017

My music library folder have symlinks pointing to tracks from all over ..
For example, /plex/music_folder/symlink_of_track1.mp3, which points to /hard/drive/track1.mp3
So Plex only knows /plex/music_folder/symlink_of_track1.mp3, not /hard/drive/track1.mp3

The problem is PlexPlaylistImporter converts the symlink path to the path it points to, so it can't find the track in the database.

The line responsible is in M3U.py, line 31

LookupPath=os.path.realpath(('' if IsAbsolutePath else PlaylistDirPath)+LineStr.rstrip('\n'))

Replacing it by LookupPath=LineStr.rstrip('\n') does the trick.

I can see it's there to support relative path, but I'm guessing converting symlinks is a side effect.

PS: PlexPlaylistImporter is an awesome contribution ! I can't believe Plex doesn't support it still..

@dakusan
Copy link
Owner

dakusan commented Jan 19, 2017

Can you instead change "realpath" to say "normpath" and see if it fixes it? I think that will make the old stuff work and no longer follow symlinks (which i consider the preferred behavior).

And thanks :D

@qoxxxx
Copy link
Author

qoxxxx commented Jan 19, 2017

normpath is working fine for me, thanks.

@weetabixface
Copy link

weetabixface commented Apr 20, 2018

thanks for this tool, very useful to import lots of playlists

I had a similar problem to the OP , Plex for me runs in a jail on my FreeNAS so the full path to files is something like /mnt/tank/<user>/media/music/<artist>/<track>

the media folder is then mounted in the jail as /media so in the Plex DB the entries to files entries are /media/music/<artist>/<track> so was getting lots of errors with files paths not matching between .m3u and DB

workaround was to use the fix described here for relative/absolute paths and also editing line 40 to ensure what was pulled from the .m3u playlist went into the PlaylistFiles output in the correct format to include the leading / of the mount point in the jail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants