Switch back to 'modified' fs event only

Originally i switched this to 'created' because of a Windows issue someone was
having, but I believe it was something else i'd done that fixed it.
Using 'created' also meant multiple password resets for a user wouldn't
be registered, as jellyfin would just overwrite the existing file.
Hopefully this doesn't break anything.
This commit is contained in:
Harvey Tindall 2020-05-09 20:49:42 +01:00
parent 81a80afdf2
commit 17aca69583
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import time
import json
import platform
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from jellyfin_accounts.email import Mailgun, Smtp
@ -33,8 +34,7 @@ class Handler(FileSystemEventHandler):
def on_any_event(event):
if event.is_directory:
return None
elif ((event.event_type == 'modified' or
event.event_type == 'created') and
elif (event.event_type == 'modified' and
'passwordreset' in event.src_path):
log.debug(f'Password reset file: {event.src_path}')
time.sleep(1)