File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ def save_notedata(chart):
291291 is_ssc = True
292292 chart_path = working_path + chart_filename
293293 if os .path .exists (chart_path ):
294+ #print(chart_path)
294295 lines = read_lines_decoded (chart_path )
295296 # pull all of the notedata out and store it in the db
296297 for line in lines :
@@ -332,6 +333,10 @@ def save_notedata(chart):
332333 else :
333334 file_meter = 1
334335 else :
336+ #if line is empty, skip it (ECFA 2019 grrr)
337+ preview , lines = utils .peek (lines )
338+ if not preview .strip ():
339+ next (lines , None )
335340 file_charttype = next (lines , None ).strip ().rstrip (':' )
336341 file_description = next (lines , None ).strip ().rstrip (":" )
337342 file_difficulty = next (lines , None ).strip ().rstrip (":" )
Original file line number Diff line number Diff line change 66import re
77import shutil
88import subprocess
9+ import itertools
910import hashlib
1011import zipfile
1112from concurrent .futures import ThreadPoolExecutor
@@ -158,4 +159,8 @@ def cleanup_dir(directory):
158159 elif os .path .isdir (file_path ):
159160 shutil .rmtree (file_path )
160161 except Exception as e :
161- print (f"Failed to delete { file_path } . Reason: { e } " )
162+ print (f"Failed to delete { file_path } . Reason: { e } " )
163+
164+ def peek (iterator ):
165+ clone , preview = itertools .tee (iterator )
166+ return next (preview , None ), clone
You can’t perform that action at this time.
0 commit comments