From afe01c8341acd4cf9f4b84fbba85aab6777fd230 Mon Sep 17 00:00:00 2001 From: Krateng Date: Tue, 21 Apr 2020 18:20:40 +0200 Subject: [PATCH] Fixed db fixing with new file structure --- maloja/__pkginfo__.py | 2 +- maloja/fixexisting.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/maloja/__pkginfo__.py b/maloja/__pkginfo__.py index 191560d..edfe0ba 100644 --- a/maloja/__pkginfo__.py +++ b/maloja/__pkginfo__.py @@ -5,7 +5,7 @@ author = { "email":"maloja@krateng.dev", "github": "krateng" } -version = 2,3,7 +version = 2,3,8 versionstr = ".".join(str(n) for n in version) links = { "pypi":"malojaserver", diff --git a/maloja/fixexisting.py b/maloja/fixexisting.py index 9ee87c4..b0c39a3 100644 --- a/maloja/fixexisting.py +++ b/maloja/fixexisting.py @@ -9,7 +9,15 @@ from .backup import backup wendigo = CleanerAgent() -exp = r"([0-9]*)(\t+)([^\t]+?)(\t+)([^\t]+)(\t*)([^\t]*)\n" +exp = r"([0-9]*)(\t+)([^\t]+?)(\t+)([^\t]+)([^\n]*)\n" +# 1 2 3 4 5 6 +# groups: +# 1 - timestamp +# 2 - sep +# 3 - artists +# 4 - sep +# 5 - title +# 6 - rest @@ -38,7 +46,7 @@ def fix(): for l in oldfile: a,t = re.sub(exp,r"\3",l), re.sub(exp,r"\5",l) - r1,r2,r3 = re.sub(exp,r"\1\2",l),re.sub(exp,r"\4",l),re.sub(exp,r"\6\7",l) + r1,r2,r3 = re.sub(exp,r"\1\2",l),re.sub(exp,r"\4",l),re.sub(exp,r"\6",l) a = a.replace("␟",";")