mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Database can now analyze consistency of scrobble data
This commit is contained in:
20
utilities.py
20
utilities.py
@ -77,7 +77,27 @@ def combineChecksums(filename,checksums):
|
||||
f.close()
|
||||
return True
|
||||
|
||||
# checks ALL files for their rule state. if they are all the same as the current loaded one, the entire database can be assumed to be consistent with the current ruleset
|
||||
# in any other case, get out
|
||||
def consistentRulestate(folder,checksums):
|
||||
import os
|
||||
|
||||
result = []
|
||||
for scrobblefile in os.listdir(folder + "/"):
|
||||
|
||||
if (scrobblefile.endswith(".tsv")):
|
||||
|
||||
try:
|
||||
f = open(folder + "/" + scrobblefile + ".rulestate","r")
|
||||
if f.read() != checksums:
|
||||
return False
|
||||
|
||||
except:
|
||||
return False
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def parseAllTSV(path,*args):
|
||||
|
Reference in New Issue
Block a user