From 4936a4889c5145b679be24087e002cd9851ef1c2 Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Tue, 21 Mar 2023 20:33:05 +0100 Subject: Better file handling for filenames with spaces. --- .tmsu/db | Bin 0 -> 26624 bytes file-tagger.py | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .tmsu/db diff --git a/.tmsu/db b/.tmsu/db new file mode 100644 index 0000000..c8c7825 Binary files /dev/null and b/.tmsu/db differ diff --git a/file-tagger.py b/file-tagger.py index c56e760..9812f62 100644 --- a/file-tagger.py +++ b/file-tagger.py @@ -86,7 +86,9 @@ def tmsu_tags(base, file): proc.wait() logger.debug("TMSU returncode: {}".format(proc.returncode)) if proc.returncode == 0: - tags.update(re.split("\s", proc.stdout.read().decode())[1:-1]) + ret = proc.stdout.read().decode() + logger.debug("Raw TMSU tags: {}".format(ret)) + tags.update(re.split("\s", ret.split(":")[1])[1:-1]) else: logger.error("Could not get tags for file {}".format(file)) return tags -- cgit v1.2.1