Fix Plex playlist duplicating

This commit is contained in:
Croneter 2018-05-02 17:55:19 +02:00
parent c98a8456ff
commit 799f9ba25a

View file

@ -444,6 +444,10 @@ class PlaylistEventhandler(FileSystemEventHandler):
def on_created(self, event): def on_created(self, event):
LOG.debug('on_created: %s', event.src_path) LOG.debug('on_created: %s', event.src_path)
old_playlist = playlist_object_from_db(path=event.src_path)
if old_playlist:
LOG.debug('Playlist already in DB - skipping')
return
playlist = PL.Playlist_Object() playlist = PL.Playlist_Object()
playlist.kodi_path = event.src_path playlist.kodi_path = event.src_path
playlist.kodi_hash = utils.generate_file_md5(event.src_path) playlist.kodi_hash = utils.generate_file_md5(event.src_path)