From 4e794167644c1dae9a8989c8cedbb160bf6695b1 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sun, 30 Jan 2022 13:33:52 +0100 Subject: [PATCH] txtp_dumper: ignore pre-created txtp --- cli/tools/txtp_dumper.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cli/tools/txtp_dumper.py b/cli/tools/txtp_dumper.py index 8a9294e4..aeb9d661 100644 --- a/cli/tools/txtp_dumper.py +++ b/cli/tools/txtp_dumper.py @@ -107,9 +107,18 @@ class App(object): subdir = subdir + '/' text = subdir + text else: + # should be a mini-txtp, but if name isn't "file.ext.txtp" and just "file.txtp", + # probably means proper txtp exists and should't be created (when generating from !tags.m3u) name = line text = '' + basename = os.path.basename(name) + subname, _ = os.path.splitext(basename) + _, subext = os.path.splitext(subname) + if not subext: + print("ignored pre-txtp: %s" % (basename)) + continue + outpath = os.path.join(path, name) with open(outpath, 'w') as fo: