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",
|
"email":"maloja@krateng.dev",
|
||||||
"github": "krateng"
|
"github": "krateng"
|
||||||
}
|
}
|
||||||
version = 2,10,6
|
version = 2,10,7
|
||||||
versionstr = ".".join(str(n) for n in version)
|
versionstr = ".".join(str(n) for n in version)
|
||||||
links = {
|
links = {
|
||||||
"pypi":"malojaserver",
|
"pypi":"malojaserver",
|
||||||
|
@ -48,9 +48,12 @@ class CleanerAgent:
|
|||||||
return (artists,title)
|
return (artists,title)
|
||||||
|
|
||||||
def removespecial(self,s):
|
def removespecial(self,s):
|
||||||
s = s.replace("\t","").replace("␟","").replace("\n","")
|
if isinstance(s,list):
|
||||||
s = re.sub(" +"," ",s)
|
return [self.removespecial(se) for se in s]
|
||||||
return s
|
else:
|
||||||
|
s = s.replace("\t","").replace("␟","").replace("\n","")
|
||||||
|
s = re.sub(" +"," ",s)
|
||||||
|
return s
|
||||||
|
|
||||||
|
|
||||||
# if an artist appears in any created rule, we can assume that artist is meant to exist and be spelled like that
|
# if an artist appears in any created rule, we can assume that artist is meant to exist and be spelled like that
|
||||||
@ -67,6 +70,10 @@ class CleanerAgent:
|
|||||||
|
|
||||||
def parseArtists(self,a):
|
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"):
|
if a.strip() in settings.get_settings("INVALID_ARTISTS"):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@ -148,6 +148,8 @@ replaceartist 여자친구 GFriend GFriend
|
|||||||
# Girl's Generation
|
# Girl's Generation
|
||||||
replaceartist 소녀시대 Girls' Generation
|
replaceartist 소녀시대 Girls' Generation
|
||||||
replaceartist SNSD Girls' Generation
|
replaceartist SNSD Girls' Generation
|
||||||
|
replaceartist Girls' Generation-TTS TaeTiSeo
|
||||||
|
countas TaeTiSeo Girls' Generation
|
||||||
|
|
||||||
# Apink
|
# Apink
|
||||||
replaceartist A Pink 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")
|
log("Incoming scrobble (): ARTISTS: " + str(artists) + ", TRACK: " + title,module="debug")
|
||||||
if fix:
|
if fix:
|
||||||
(artists,title) = cla.fullclean("/".join(artists),title)
|
(artists,title) = cla.fullclean(artists,title)
|
||||||
trackdict = createScrobble(artists,title,time,album,duration)
|
trackdict = createScrobble(artists,title,time,album,duration)
|
||||||
|
|
||||||
sync()
|
sync()
|
||||||
|
@ -49,7 +49,7 @@ def fix():
|
|||||||
a,t = re.sub(exp,r"\3",l), re.sub(exp,r"\5",l)
|
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)
|
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)
|
(al,t) = wendigo.fullclean(a,t)
|
||||||
a = "␟".join(al)
|
a = "␟".join(al)
|
||||||
@ -59,7 +59,7 @@ def fix():
|
|||||||
#os.system("diff " + "scrobbles/" + fn + "_new" + " " + "scrobbles/" + fn)
|
#os.system("diff " + "scrobbles/" + fn + "_new" + " " + "scrobbles/" + fn)
|
||||||
with open(datadir("scrobbles",filename_new),"r") as newfile, open(datadir("scrobbles",filename),"r") as oldfile:
|
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)
|
diff = list(diff)
|
||||||
|
|
||||||
with open(os.path.join(patchfolder,filename + ".diff"),"w") as patchfile:
|
with open(os.path.join(patchfolder,filename + ".diff"),"w") as patchfile:
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script>
|
<script>
|
||||||
var pending = false;
|
var pending = false;
|
||||||
setInterval(probeServer,1500);
|
setInterval(probeServer,3500);
|
||||||
|
|
||||||
function probeServer() {
|
function probeServer() {
|
||||||
if (!pending) {
|
if (!pending) {
|
||||||
@ -32,7 +32,7 @@
|
|||||||
var status = response['db_status'];
|
var status = response['db_status'];
|
||||||
console.log(response);
|
console.log(response);
|
||||||
if (status['healthy'] && !status['rebuildinprogress']) {
|
if (status['healthy'] && !status['rebuildinprogress']) {
|
||||||
window.location = "/issues";
|
window.location = "/admin_issues";
|
||||||
}
|
}
|
||||||
pending = false;
|
pending = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user