XDGFX / ultrasonics

Sync music playlists between all your music services. Do more with your music.
GNU General Public License v3.0
222 stars 18 forks source link

Plex plug-in: problems when playlist's name has certain characters #17

Closed Faeton73 closed 4 years ago

Faeton73 commented 4 years ago

Hi, I found this problem whne trying to sync my spotify lists... It seems there is a slash in the playlist's name that isn't properly treated

2020-09-16 06:22:21,964 - 🎧 plex - INFO - Updating playlist: We got the beat / We gotta be adored  (Verano 2018) (up_plex.py:243)
2020-09-16 06:22:21,965 - plugins - ERROR - [Errno 2] No such file or directory: '/music/.ultrasonics_tmp/We got the beat / We gotta be adored  (Verano 2018).m3u' (plugins.py:291)
Traceback (most recent call last):
  File "/ultrasonics/plugins.py", line 285, in applet_run
    plugin_run(*get_info(plugin), component="outputs",
  File "/ultrasonics/plugins.py", line 162, in plugin_run
    response = found_plugins[name].run(
  File "/ultrasonics/official_plugins/up_plex.py", line 248, in run
    f = io.open(playlist_path, "w", encoding="utf8")
FileNotFoundError: [Errno 2] No such file or directory: '/music/.ultrasonics_tmp/We got the beat / We gotta be adored  (Verano 2018).m3u'
burkasaurusrex commented 4 years ago

Same issue here!

XDGFX commented 4 years ago

Yep you're right - the forward slash in the playlist name is fine on Spotify, but Plex needs to playlist to be saved to a file, and the slash is not a valid character for a file name.

I've just committed a small fix on the master branch, could you please pull that and give it another go? It will replace the slashes in the file name, however with the way the Plex API is accessed this is unavoidable at this time.

XDGFX commented 4 years ago

I'll assume the fix worked, feel free to comment if not!