Added artistintitle rules

This commit is contained in:
Krateng 2019-12-11 14:25:09 +01:00
parent a6b1a8a144
commit 5d066d9b26
4 changed files with 15 additions and 2 deletions

View File

@ -7,7 +7,7 @@ author = {
"email":"maloja@krateng.dev",
"github": "krateng"
}
version = 2,0,13
version = 2,0,14
versionstr = ".".join(str(n) for n in version)

View File

@ -18,6 +18,7 @@ class CleanerAgent:
self.rules_replaceartist = {b.lower():c for [a,b,c,d] in raw if a=="replaceartist"}
self.rules_ignoreartist = [b.lower() for [a,b,c,d] in raw if a=="ignoreartist"]
self.rules_addartists = {c.lower():(b.lower(),d) for [a,b,c,d] in raw if a=="addartists"}
self.rules_artistintitle = {b.lower():c for [a,b,c,d] in raw if a=="artistintitle"}
#self.rules_regexartist = [[b,c] for [a,b,c,d] in raw if a=="regexartist"]
#self.rules_regextitle = [[b,c] for [a,b,c,d] in raw if a=="regextitle"]
# TODO
@ -137,7 +138,10 @@ class CleanerAgent:
artists += self.parseArtists(re.sub(r"(.*) " + d + " (.*).*",r"\2",t))
return (title,artists)
return (t,[])
artists = []
for st in self.rules_artistintitle:
if st in t.lower(): artists += self.rules_artistintitle[st].split("")
return (t,artists)

View File

@ -156,3 +156,8 @@ replacetitle 벌써 12시 Gotta Go Gotta Go
# ITZY
replacetitle 달라달라 (DALLA DALLA) Dalla Dalla
# Popular Remixes
artistintitle Areia Remix Areia
artistintitle Areia Kpop Areia

Can't render this file because it has a wrong number of fields in line 5.

View File

@ -20,6 +20,9 @@ The first column defines the type of the rule:
Second column is artists that need to be already present for this rule to apply
Third column is the song title
Fourth column are artists that shoud be added, separated by ␟
artistintitle Defines title strings that imply the presence of another artist.
Second column is the string
Third column is the artist or artists
Rules in non-tsv files are ignored. '#' is used for comments. Additional columns are ignored. To have a '#' in a name, use '\num'
Comments are not supported in scrobble lists, but you probably never edit these manually anyway.
@ -35,3 +38,4 @@ replaceartist Dal Shabet Dal★Shabet
replaceartist Mr FijiWiji, AgNO3 Mr FijiWiji␟AgNO3 # one artist is replaced by two artists
countas Trouble Maker HyunA
addartists HyunA Change Jun Hyung
artistintitle Areia Remix Areia