mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Add feature to parse remix artists
This commit is contained in:
parent
20aae955b2
commit
91a7aeb50d
@ -172,6 +172,18 @@ class CleanerAgent:
|
|||||||
return (title,artists)
|
return (title,artists)
|
||||||
|
|
||||||
artists = []
|
artists = []
|
||||||
|
|
||||||
|
if malojaconfig["PARSE_REMIX_ARTISTS"]:
|
||||||
|
for filter in malojaconfig["FILTERS_REMIX"]:
|
||||||
|
# match remix in brackets
|
||||||
|
if re.match(r".*[\(\[](.*)" + filter + "[\)\]]", t):
|
||||||
|
artists += self.parseArtists(re.match(r".*[\(\[](.*)" + filter + "[\)\]]", t)[1])
|
||||||
|
print("check")
|
||||||
|
|
||||||
|
# match remix split with "-"
|
||||||
|
elif re.match(r".*-(.*)" + filter, t):
|
||||||
|
artists += self.parseArtists(re.match(r".*-(.*)" + filter, t)[1])
|
||||||
|
|
||||||
for st in self.rules_artistintitle:
|
for st in self.rules_artistintitle:
|
||||||
if st in t.lower(): artists += self.rules_artistintitle[st].split("␟")
|
if st in t.lower(): artists += self.rules_artistintitle[st].split("␟")
|
||||||
return (t,artists)
|
return (t,artists)
|
||||||
|
@ -181,7 +181,9 @@ malojaconfig = Configuration(
|
|||||||
"remove_from_title":(tp.Set(tp.String()), "Remove from Title", ["(Original Mix)","(Radio Edit)","(Album Version)","(Explicit Version)","(Bonus Track)"], "Phrases that should be removed from song titles"),
|
"remove_from_title":(tp.Set(tp.String()), "Remove from Title", ["(Original Mix)","(Radio Edit)","(Album Version)","(Explicit Version)","(Bonus Track)"], "Phrases that should be removed from song titles"),
|
||||||
"delimiters_feat":(tp.Set(tp.String()), "Featuring Delimiters", ["ft.","ft","feat.","feat","featuring","Ft.","Ft","Feat.","Feat","Featuring"], "Delimiters used for extra artists, even when in the title field"),
|
"delimiters_feat":(tp.Set(tp.String()), "Featuring Delimiters", ["ft.","ft","feat.","feat","featuring","Ft.","Ft","Feat.","Feat","Featuring"], "Delimiters used for extra artists, even when in the title field"),
|
||||||
"delimiters_informal":(tp.Set(tp.String()), "Informal Delimiters", ["vs.","vs","&"], "Delimiters in informal artist strings with spaces expected around them"),
|
"delimiters_informal":(tp.Set(tp.String()), "Informal Delimiters", ["vs.","vs","&"], "Delimiters in informal artist strings with spaces expected around them"),
|
||||||
"delimiters_formal":(tp.Set(tp.String()), "Formal Delimiters", [";","/","|","␝","␞","␟"], "Delimiters used to tag multiple artists when only one tag field is available")
|
"delimiters_formal":(tp.Set(tp.String()), "Formal Delimiters", [";","/","|","␝","␞","␟"], "Delimiters used to tag multiple artists when only one tag field is available"),
|
||||||
|
"filters_remix":(tp.Set(tp.String()), "Remix Filters", ["remix", "Remix", "Remix Edit", "remix edit", "Short Mix", "short mix", "Extended Mix", "extended mix", "Soundtrack Version", "soundtrack version"], "Filters used to recognize the remix artists in the title"),
|
||||||
|
"parse_remix_artists":(tp.Boolean(), "Parse Remix Artists", True)
|
||||||
},
|
},
|
||||||
"Web Interface":{
|
"Web Interface":{
|
||||||
"default_range_charts_artists":(tp.Choice({'alltime':'All Time','year':'Year','month':"Month",'week':'Week'}), "Default Range Artist Charts", "year"),
|
"default_range_charts_artists":(tp.Choice({'alltime':'All Time','year':'Year','month':"Month",'week':'Week'}), "Default Range Artist Charts", "year"),
|
||||||
|
Loading…
Reference in New Issue
Block a user