mirror of
				https://github.com/krateng/maloja.git
				synced 2023-08-10 21:12:55 +03:00 
			
		
		
		
	Removed on-the-fly database analysis
This commit is contained in:
		| @@ -69,6 +69,8 @@ MEDALS_TRACKS = {} | ||||
| WEEKLY_TOPTRACKS = {} | ||||
| WEEKLY_TOPARTISTS = {} | ||||
|  | ||||
| ISSUES = {} | ||||
|  | ||||
| cla = CleanerAgent() | ||||
| coa = CollectorAgent() | ||||
| clients = [] | ||||
| @@ -727,17 +729,13 @@ def newrule(**keys): | ||||
| 		db_rulestate = False | ||||
|  | ||||
|  | ||||
| @dbserver.get("issues") | ||||
| def issues_external(): #probably not even needed | ||||
| 	return issues() | ||||
|  | ||||
|  | ||||
| def issues(): | ||||
| 	return ISSUES | ||||
|  | ||||
| def check_issues(): | ||||
| 	combined = [] | ||||
| 	duplicates = [] | ||||
| 	newartists = [] | ||||
| 	inconsistent = not db_rulestate | ||||
| 	# if the user manually edits files while the server is running this won't show, but too lazy to check the rulestate here | ||||
|  | ||||
| 	import itertools | ||||
| 	import difflib | ||||
| @@ -820,7 +818,8 @@ def issues(): | ||||
| 	#		duplicates.append((c[0],c[1])) | ||||
|  | ||||
|  | ||||
| 	return {"duplicates":duplicates,"combined":combined,"newartists":newartists,"inconsistent":inconsistent} | ||||
| 	return {"duplicates":duplicates,"combined":combined,"newartists":newartists} | ||||
|  | ||||
|  | ||||
|  | ||||
| @dbserver.post("importrules") | ||||
| @@ -981,6 +980,9 @@ def build_db(): | ||||
| 	global db_rulestate | ||||
| 	db_rulestate = utilities.consistentRulestate(datadir("scrobbles"),cla.checksums) | ||||
|  | ||||
| 	global ISSUES | ||||
| 	ISSUES = check_issues() | ||||
|  | ||||
| 	log("Database fully built!") | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -8,12 +8,12 @@ def instructions(keys): | ||||
| 	i = 0 | ||||
|  | ||||
| 	html = "<table class='list'>" | ||||
| 	if db_data["inconsistent"]: | ||||
| 		html += "<tr>" | ||||
| 		html += "<td>The current database wasn't built with all current rules in effect. Any problem below might be a false alarm and fixing it could create redundant rules.</td>" | ||||
| 		html += """<td class='button important' onclick="fullrebuild()"><div>Rebuild the database</div></td>""" | ||||
| 		html += "</tr>" | ||||
| 		i += 1 | ||||
| #	if db_data["inconsistent"]: | ||||
| #		html += "<tr>" | ||||
| #		html += "<td>The current database wasn't built with all current rules in effect. Any problem below might be a false alarm and fixing it could create redundant rules.</td>" | ||||
| #		html += """<td class='button important' onclick="fullrebuild()"><div>Rebuild the database</div></td>""" | ||||
| #		html += "</tr>" | ||||
| #		i += 1 | ||||
| 	for d in db_data["duplicates"]: | ||||
| 		html += "<tr>" | ||||
| 		html += "<td>'" + artistLink(d[0]) + "'" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Krateng
					Krateng