mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Case is now ignored when building track titles and artist names
This commit is contained in:
parent
1e346f7d0e
commit
30881099bf
@ -28,7 +28,10 @@ class CleanerAgent:
|
||||
return (list(set(artists)),title)
|
||||
|
||||
def removespecial(self,s):
|
||||
return s.replace("\t","").replace("␟","").replace("\n","")
|
||||
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
|
||||
def confirmedReal(self,a):
|
||||
|
20
database.py
20
database.py
@ -81,25 +81,37 @@ def readScrobble(artists,title,time):
|
||||
def getArtistID(name):
|
||||
|
||||
obj = name
|
||||
objlower = name.lower()
|
||||
|
||||
try:
|
||||
i = ARTISTS.index(obj)
|
||||
return ARTISTS.index(obj)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
return [a.lower() for a in ARTISTS].index(objlower)
|
||||
except:
|
||||
i = len(ARTISTS)
|
||||
ARTISTS.append(obj)
|
||||
return i
|
||||
return i
|
||||
|
||||
def getTrackID(artists,title):
|
||||
artistset = set()
|
||||
for a in artists:
|
||||
artistset.add(getArtistID(name=a))
|
||||
obj = (frozenset(artistset),title)
|
||||
objlower = (frozenset(artistset),title.lower())
|
||||
|
||||
try:
|
||||
i = TRACKS.index(obj)
|
||||
return TRACKS.index(obj)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
# not the best performance
|
||||
return [(t[0],t[1].lower()) for t in TRACKS].index(objlower)
|
||||
except:
|
||||
i = len(TRACKS)
|
||||
TRACKS.append(obj)
|
||||
return i
|
||||
return i
|
||||
|
||||
|
||||
####
|
||||
|
@ -53,7 +53,7 @@ table td.time {
|
||||
color:lightgray;
|
||||
}
|
||||
table td.artists,td.artist,td.title,td.amount {
|
||||
width:300px;
|
||||
width:350px;
|
||||
}
|
||||
|
||||
table td.button {
|
||||
|
Loading…
Reference in New Issue
Block a user