1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Renamed import module to match v3

This commit is contained in:
krateng 2022-04-04 16:25:21 +02:00
parent ca2596cfc9
commit 72b74eb27e
2 changed files with 6 additions and 3 deletions

View File

@ -11,7 +11,7 @@ def loadexternal(filename):
print("File could not be found.") print("File could not be found.")
return return
from .importer import import_scrobbles from .import_scrobbles import import_scrobbles
result = import_scrobbles(filename) result = import_scrobbles(filename)
msg = f"Successfully imported {result['CONFIDENT_IMPORT'] + result['UNCERTAIN_IMPORT']} scrobbles" msg = f"Successfully imported {result['CONFIDENT_IMPORT'] + result['UNCERTAIN_IMPORT']} scrobbles"

View File

@ -12,7 +12,8 @@ c = CleanerAgent()
outputs = { outputs = {
"CONFIDENT_IMPORT": lambda msg: None, "CONFIDENT_IMPORT": lambda msg: None,
"UNCERTAIN_IMPORT": lambda msg: print(col['orange'](msg)), "UNCERTAIN_IMPORT": lambda msg: print(col['orange'](msg)),
"CONFIDENT_SKIP": lambda msg: print(col['ffcba4'](msg)), #"CONFIDENT_SKIP": lambda msg: print(col['ffcba4'](msg)),
"CONFIDENT_SKIP": lambda msg: None,
"UNCERTAIN_SKIP": lambda msg: print(col['orange'](msg)), "UNCERTAIN_SKIP": lambda msg: print(col['orange'](msg)),
"FAIL": lambda msg: print(col['red'](msg)), "FAIL": lambda msg: print(col['red'](msg)),
} }
@ -145,6 +146,8 @@ def parse_spotify_lite(inputf):
yield ('FAIL',None,f"{entry} could not be parsed. Scrobble not imported. ({repr(e)})") yield ('FAIL',None,f"{entry} could not be parsed. Scrobble not imported. ({repr(e)})")
continue continue
print()
def parse_spotify_full(inputf): def parse_spotify_full(inputf):
@ -212,7 +215,7 @@ def parse_spotify_full(inputf):
ts_group = int(timestamp/10) ts_group = int(timestamp/10)
relevant_ts_groups = [ts_group-2,ts_group-1,ts_group,ts_group+1,ts_group+2] relevant_ts_groups = [ts_group-3,ts_group-2,ts_group-1,ts_group,ts_group+1,ts_group+2,ts_group+3]
similar_scrobbles = [scrob for tsg in relevant_ts_groups for scrob in inaccurate_timestamps.get(tsg,[])] similar_scrobbles = [scrob for tsg in relevant_ts_groups for scrob in inaccurate_timestamps.get(tsg,[])]
scrobble_describe = (timestamp,entry['spotify_track_uri'],entry['ms_played']) scrobble_describe = (timestamp,entry['spotify_track_uri'],entry['ms_played'])