From 646c290a373ef668a67c8e8b08b7974bf15309fa Mon Sep 17 00:00:00 2001 From: krateng Date: Thu, 21 Apr 2022 21:17:55 +0200 Subject: [PATCH] Added separate output for importing zero files --- maloja/proccontrol/tasks/import_scrobbles.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/maloja/proccontrol/tasks/import_scrobbles.py b/maloja/proccontrol/tasks/import_scrobbles.py index ca82078..41c76c7 100644 --- a/maloja/proccontrol/tasks/import_scrobbles.py +++ b/maloja/proccontrol/tasks/import_scrobbles.py @@ -122,6 +122,10 @@ def parse_spotify_lite(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)] + if len(inputfiles) == 0: + print("No files found!") + return + if inputfiles != [inputf]: print("Spotify files should all be imported together to identify duplicates across the whole dataset.") if not ask("Import " + ", ".join(col['yellow'](i) for i in inputfiles) + "?",default=True): @@ -167,6 +171,10 @@ def parse_spotify_full(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)] + if len(inputfiles) == 0: + print("No files found!") + return + if inputfiles != [inputf]: print("Spotify files should all be imported together to identify duplicates across the whole dataset.") if not ask("Import " + ", ".join(col['yellow'](i) for i in inputfiles) + "?",default=True):