diff --git a/rose/rules.py b/rose/rules.py index 813ef15..d2401be 100644 --- a/rose/rules.py +++ b/rose/rules.py @@ -244,13 +244,13 @@ def filter_track_false_positives_using_tags( match = match or (field == "secondarygenre" and any(matches_pattern(matcher.pattern, x) for x in tags.secondarygenre)) match = match or (field == "descriptor" and any(matches_pattern(matcher.pattern, x) for x in tags.descriptor)) match = match or (field == "label" and any(matches_pattern(matcher.pattern, x) for x in tags.label)) - match = match or (field == "trackartist[main]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.releaseartists.main)) - match = match or (field == "trackartist[guest]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.releaseartists.guest)) - match = match or (field == "trackartist[remixer]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.releaseartists.remixer)) - match = match or (field == "trackartist[producer]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.releaseartists.producer)) - match = match or (field == "trackartist[composer]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.releaseartists.composer)) - match = match or (field == "trackartist[conductor]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.releaseartists.conductor)) - match = match or (field == "trackartist[djmixer]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.releaseartists.djmixer)) + match = match or (field == "trackartist[main]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.trackartists.main)) + match = match or (field == "trackartist[guest]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.trackartists.guest)) + match = match or (field == "trackartist[remixer]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.trackartists.remixer)) + match = match or (field == "trackartist[producer]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.trackartists.producer)) + match = match or (field == "trackartist[composer]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.trackartists.composer)) + match = match or (field == "trackartist[conductor]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.trackartists.conductor)) + match = match or (field == "trackartist[djmixer]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.trackartists.djmixer)) match = match or (field == "releaseartist[main]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.releaseartists.main)) match = match or (field == "releaseartist[guest]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.releaseartists.guest)) match = match or (field == "releaseartist[remixer]" and any(matches_pattern(matcher.pattern, x.name) for x in tags.releaseartists.remixer)) @@ -282,13 +282,13 @@ def filter_track_false_positives_using_tags( skip = skip or (field == "secondarygenre" and any(matches_pattern(i.pattern, x) for x in tags.secondarygenre)) skip = skip or (field == "descriptor" and any(matches_pattern(i.pattern, x) for x in tags.descriptor)) skip = skip or (field == "label" and any(matches_pattern(i.pattern, x) for x in tags.label)) - skip = skip or (field == "trackartist[main]" and any(matches_pattern(i.pattern, x.name) for x in tags.releaseartists.main)) - skip = skip or (field == "trackartist[guest]" and any(matches_pattern(i.pattern, x.name) for x in tags.releaseartists.guest)) - skip = skip or (field == "trackartist[remixer]" and any(matches_pattern(i.pattern, x.name) for x in tags.releaseartists.remixer)) - skip = skip or (field == "trackartist[producer]" and any(matches_pattern(i.pattern, x.name) for x in tags.releaseartists.producer)) - skip = skip or (field == "trackartist[composer]" and any(matches_pattern(i.pattern, x.name) for x in tags.releaseartists.composer)) - skip = skip or (field == "trackartist[conductor]" and any(matches_pattern(i.pattern, x.name) for x in tags.releaseartists.conductor)) - skip = skip or (field == "trackartist[djmixer]" and any(matches_pattern(i.pattern, x.name) for x in tags.releaseartists.djmixer)) + skip = skip or (field == "trackartist[main]" and any(matches_pattern(i.pattern, x.name) for x in tags.trackartists.main)) + skip = skip or (field == "trackartist[guest]" and any(matches_pattern(i.pattern, x.name) for x in tags.trackartists.guest)) + skip = skip or (field == "trackartist[remixer]" and any(matches_pattern(i.pattern, x.name) for x in tags.trackartists.remixer)) + skip = skip or (field == "trackartist[producer]" and any(matches_pattern(i.pattern, x.name) for x in tags.trackartists.producer)) + skip = skip or (field == "trackartist[composer]" and any(matches_pattern(i.pattern, x.name) for x in tags.trackartists.composer)) + skip = skip or (field == "trackartist[conductor]" and any(matches_pattern(i.pattern, x.name) for x in tags.trackartists.conductor)) + skip = skip or (field == "trackartist[djmixer]" and any(matches_pattern(i.pattern, x.name) for x in tags.trackartists.djmixer)) skip = skip or (field == "releaseartist[main]" and any(matches_pattern(i.pattern, x.name) for x in tags.releaseartists.main)) skip = skip or (field == "releaseartist[guest]" and any(matches_pattern(i.pattern, x.name) for x in tags.releaseartists.guest)) skip = skip or (field == "releaseartist[remixer]" and any(matches_pattern(i.pattern, x.name) for x in tags.releaseartists.remixer)) diff --git a/rose/rules_test.py b/rose/rules_test.py index 24673b2..5d0ee81 100644 --- a/rose/rules_test.py +++ b/rose/rules_test.py @@ -400,3 +400,15 @@ def test_ignore_values(config: Config, source_dir: Path) -> None: execute_metadata_rule(config, rule, confirm_yes=False) af = AudioTags.from_file(source_dir / "Test Release 1" / "01.m4a") assert af.tracktitle == "Track 1" + + +def test_artist_matcher_on_trackartist_only(config: Config, source_dir: Path) -> None: + af = AudioTags.from_file(source_dir / "Test Release 1" / "01.m4a") + af.trackartists.main = [Artist("BIGBANG & 2NE1")] + af.releaseartists.main = [Artist("BIGBANG"), Artist("2NE1")] + af.flush() + update_cache(config) + rule = MetadataRule.parse("artist: & ", ["split: & "]) + execute_metadata_rule(config, rule, confirm_yes=False) + af = AudioTags.from_file(source_dir / "Test Release 1" / "01.m4a") + assert af.trackartists.main == [Artist("BIGBANG"), Artist("2NE1")]