From 08d3436f3bf03dfec2b987f6af07356c77245ec9 Mon Sep 17 00:00:00 2001 From: DominikDoom Date: Sat, 27 Jan 2024 12:38:08 +0100 Subject: [PATCH] Fix mtime check for list return Fixes #269 --- scripts/tag_autocomplete_helper.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/tag_autocomplete_helper.py b/scripts/tag_autocomplete_helper.py index f2d8d79..e5a77cc 100644 --- a/scripts/tag_autocomplete_helper.py +++ b/scripts/tag_autocomplete_helper.py @@ -578,10 +578,17 @@ def needs_restart(self): script_callbacks.on_ui_settings(on_ui_settings) def get_style_mtime(): - style_file = getattr(shared, "styles_filename", "styles.csv") - style_file = Path(FILE_DIR).joinpath(style_file) - if Path.exists(style_file): - return style_file.stat().st_mtime + try: + style_file = getattr(shared, "styles_filename", "styles.csv") + # Check in case a list is returned + if isinstance(style_file, list): + style_file = style_file[0] + + style_file = Path(FILE_DIR).joinpath(style_file) + if Path.exists(style_file): + return style_file.stat().st_mtime + except Exception: + return None last_style_mtime = get_style_mtime()