1
0
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:
Krateng
2018-12-21 16:32:21 +01:00
parent c6f5f38246
commit e0ec4b3137
9 changed files with 134 additions and 18 deletions

View File

@ -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):