From 17aca69583959c4e031b9fc6d9f5874d561422cd Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sat, 9 May 2020 20:49:42 +0100 Subject: [PATCH] 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. --- jellyfin_accounts/pw_reset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jellyfin_accounts/pw_reset.py b/jellyfin_accounts/pw_reset.py index 0dc5e47..d7b021a 100755 --- a/jellyfin_accounts/pw_reset.py +++ b/jellyfin_accounts/pw_reset.py @@ -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)