diff --git a/maloja/__init__.py b/maloja/__init__.py index 08ba947..ce9990e 100644 --- a/maloja/__init__.py +++ b/maloja/__init__.py @@ -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) diff --git a/maloja/cleanup.py b/maloja/cleanup.py index 600170a..5180a6d 100644 --- a/maloja/cleanup.py +++ b/maloja/cleanup.py @@ -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) diff --git a/maloja/data_files/rules/predefined/krateng_kpopgirlgroups.tsv b/maloja/data_files/rules/predefined/krateng_kpopgirlgroups.tsv index 2344605..28efdb0 100644 --- a/maloja/data_files/rules/predefined/krateng_kpopgirlgroups.tsv +++ b/maloja/data_files/rules/predefined/krateng_kpopgirlgroups.tsv @@ -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 diff --git a/maloja/data_files/rules/rules.info b/maloja/data_files/rules/rules.info index c016d07..239837c 100644 --- a/maloja/data_files/rules/rules.info +++ b/maloja/data_files/rules/rules.info @@ -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