mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Database fixing now finally respects existing separation
This commit is contained in:
parent
f62fd254dd
commit
212fbf368e
@ -5,7 +5,7 @@ author = {
|
||||
"email":"maloja@krateng.dev",
|
||||
"github": "krateng"
|
||||
}
|
||||
version = 2,10,6
|
||||
version = 2,10,7
|
||||
versionstr = ".".join(str(n) for n in version)
|
||||
links = {
|
||||
"pypi":"malojaserver",
|
||||
|
@ -48,6 +48,9 @@ class CleanerAgent:
|
||||
return (artists,title)
|
||||
|
||||
def removespecial(self,s):
|
||||
if isinstance(s,list):
|
||||
return [self.removespecial(se) for se in s]
|
||||
else:
|
||||
s = s.replace("\t","").replace("␟","").replace("\n","")
|
||||
s = re.sub(" +"," ",s)
|
||||
return s
|
||||
@ -67,6 +70,10 @@ class CleanerAgent:
|
||||
|
||||
def parseArtists(self,a):
|
||||
|
||||
if isinstance(a,list):
|
||||
res = [self.parseArtists(art) for art in a]
|
||||
return [a for group in res for a in group]
|
||||
|
||||
if a.strip() in settings.get_settings("INVALID_ARTISTS"):
|
||||
return []
|
||||
|
||||
|
@ -148,6 +148,8 @@ replaceartist 여자친구 GFriend GFriend
|
||||
# Girl's Generation
|
||||
replaceartist 소녀시대 Girls' Generation
|
||||
replaceartist SNSD Girls' Generation
|
||||
replaceartist Girls' Generation-TTS TaeTiSeo
|
||||
countas TaeTiSeo Girls' Generation
|
||||
|
||||
# Apink
|
||||
replaceartist A Pink Apink
|
||||
|
Can't render this file because it has a wrong number of fields in line 5.
|
@ -577,7 +577,7 @@ def incoming_scrobble(artists,title,album=None,duration=None,time=None,fix=True)
|
||||
|
||||
log("Incoming scrobble (): ARTISTS: " + str(artists) + ", TRACK: " + title,module="debug")
|
||||
if fix:
|
||||
(artists,title) = cla.fullclean("/".join(artists),title)
|
||||
(artists,title) = cla.fullclean(artists,title)
|
||||
trackdict = createScrobble(artists,title,time,album,duration)
|
||||
|
||||
sync()
|
||||
|
@ -49,7 +49,7 @@ def fix():
|
||||
a,t = re.sub(exp,r"\3",l), re.sub(exp,r"\5",l)
|
||||
r1,r2,r3 = re.sub(exp,r"\1\2",l),re.sub(exp,r"\4",l),re.sub(exp,r"\6",l)
|
||||
|
||||
a = a.replace("␟",";")
|
||||
a = a.split("␟")
|
||||
|
||||
(al,t) = wendigo.fullclean(a,t)
|
||||
a = "␟".join(al)
|
||||
@ -59,7 +59,7 @@ def fix():
|
||||
#os.system("diff " + "scrobbles/" + fn + "_new" + " " + "scrobbles/" + fn)
|
||||
with open(datadir("scrobbles",filename_new),"r") as newfile, open(datadir("scrobbles",filename),"r") as oldfile:
|
||||
|
||||
diff = difflib.unified_diff(oldfile.read().split("\n"),newfile.read().split("\n"),lineterm="")
|
||||
diff = difflib.unified_diff(oldfile.read().split("\n"),newfile.read().split("\n"),lineterm="",n=0)
|
||||
diff = list(diff)
|
||||
|
||||
with open(os.path.join(patchfolder,filename + ".diff"),"w") as patchfile:
|
||||
|
@ -10,7 +10,7 @@
|
||||
{% block scripts %}
|
||||
<script>
|
||||
var pending = false;
|
||||
setInterval(probeServer,1500);
|
||||
setInterval(probeServer,3500);
|
||||
|
||||
function probeServer() {
|
||||
if (!pending) {
|
||||
@ -32,7 +32,7 @@
|
||||
var status = response['db_status'];
|
||||
console.log(response);
|
||||
if (status['healthy'] && !status['rebuildinprogress']) {
|
||||
window.location = "/issues";
|
||||
window.location = "/admin_issues";
|
||||
}
|
||||
pending = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user