txtp_dumper: ignore pre-created txtp

This commit is contained in:
bnnm 2022-01-30 13:33:52 +01:00
parent e76ccb6ab7
commit 4e79416764

View File

@ -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: