From 28163348faed13beef54d8796d7e0670ce0c2037 Mon Sep 17 00:00:00 2001 From: krateng Date: Thu, 21 Apr 2022 21:15:53 +0200 Subject: [PATCH] Fixed importing with direct filename, fix GH-124 --- maloja/proccontrol/tasks/import_scrobbles.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/maloja/proccontrol/tasks/import_scrobbles.py b/maloja/proccontrol/tasks/import_scrobbles.py index c9d98a6..ca82078 100644 --- a/maloja/proccontrol/tasks/import_scrobbles.py +++ b/maloja/proccontrol/tasks/import_scrobbles.py @@ -117,7 +117,8 @@ def import_scrobbles(inputf): return result def parse_spotify_lite(inputf): - inputfolder = os.path.dirname(inputf) + pth = os.path + inputfolder = pth.relpath(pth.dirname(pth.abspath(inputf))) filenames = re.compile(r'StreamingHistory[0-9]+\.json') inputfiles = [os.path.join(inputfolder,f) for f in os.listdir(inputfolder) if filenames.match(f)] @@ -161,8 +162,8 @@ def parse_spotify_lite(inputf): def parse_spotify_full(inputf): - - inputfolder = os.path.dirname(inputf) + pth = os.path + inputfolder = pth.relpath(pth.dirname(pth.abspath(inputf))) filenames = re.compile(r'endsong_[0-9]+\.json') inputfiles = [os.path.join(inputfolder,f) for f in os.listdir(inputfolder) if filenames.match(f)]