aboutsummaryrefslogtreecommitdiff
path: root/file-tagger.py
diff options
context:
space:
mode:
authorLeonard Kugis <leonard@kug.is>2023-03-21 20:33:05 +0100
committerLeonard Kugis <leonard@kug.is>2023-03-21 20:33:05 +0100
commit4936a4889c5145b679be24087e002cd9851ef1c2 (patch)
treefd710611723e82e36e6aca7541b0df7720e97a10 /file-tagger.py
parentf4ab7d7816d7b8871a48e5b2db68f89965550a73 (diff)
Better file handling for filenames with spaces.
Diffstat (limited to 'file-tagger.py')
-rw-r--r--file-tagger.py4
1 files changed, 3 insertions, 1 deletions
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