mirror of
https://github.com/fergalmoran/picard.git
synced 2026-03-01 19:13:59 +00:00
Merge pull request #392 from phw/PICARD-335_fix_folksonomy_tag_comparisson
Improve folksonomy tag comparison for ignored tags.
This commit is contained in:
@@ -144,10 +144,10 @@ class Track(DataObject, Item):
|
||||
# And generate the genre metadata tag
|
||||
maxtags = config.setting['max_tags']
|
||||
minusage = config.setting['min_tag_usage']
|
||||
ignore_tags = config.setting['ignore_tags']
|
||||
ignore_tags = self._get_ignored_folksonomy_tags()
|
||||
genre = []
|
||||
for usage, name in taglist[:maxtags]:
|
||||
if name in ignore_tags:
|
||||
if name.lower() in ignore_tags:
|
||||
continue
|
||||
if usage < minusage:
|
||||
break
|
||||
@@ -158,6 +158,13 @@ class Track(DataObject, Item):
|
||||
genre = [join_tags.join(genre)]
|
||||
self.metadata['genre'] = genre
|
||||
|
||||
def _get_ignored_folksonomy_tags(self):
|
||||
tags = []
|
||||
ignore_tags = config.setting['ignore_tags']
|
||||
if ignore_tags:
|
||||
tags = [s.strip().lower() for s in ignore_tags.split(',')]
|
||||
return tags
|
||||
|
||||
|
||||
class NonAlbumTrack(Track):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user