mirror of
https://github.com/krateng/maloja.git
synced 2025-04-16 00:40:32 +03:00
Fixed error for Lastfm import and added feedback, fix GH-118
This commit is contained in:
parent
61526fdc89
commit
32a900cf37
@ -268,11 +268,17 @@ def parse_lastfm(inputf):
|
||||
with open(inputf,'r',newline='') as inputfd:
|
||||
reader = csv.reader(inputfd)
|
||||
|
||||
line = 0
|
||||
for row in reader:
|
||||
line += 1
|
||||
try:
|
||||
artist,album,title,time = row
|
||||
except ValueError:
|
||||
yield ('FAIL',None,f"{row} does not look like a valid entry. Scrobble not imported.")
|
||||
yield ('FAIL',None,f"{row} (Line {line}) does not look like a valid entry. Scrobble not imported.")
|
||||
continue
|
||||
|
||||
if time == '':
|
||||
yield ('FAIL',None,f"{row} (Line {line}) is missing a timestamp.")
|
||||
continue
|
||||
|
||||
try:
|
||||
@ -287,7 +293,7 @@ def parse_lastfm(inputf):
|
||||
'scrobble_duration':None
|
||||
},'')
|
||||
except Exception as e:
|
||||
yield ('FAIL',None,f"{entry} could not be parsed. Scrobble not imported. ({repr(e)})")
|
||||
yield ('FAIL',None,f"{row} (Line {line}) could not be parsed. Scrobble not imported. ({repr(e)})")
|
||||
continue
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user