mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
Update beets to 1.4.7
Also updates: - colorama-0.4.1 - jellyfish-0.6.1 - munkres-1.0.12 - musicbrainzngs-0.6 - mutagen-1.41.1 - pyyaml-3.13 - six-1.12.0 - unidecode-1.0.23
This commit is contained in:
parent
05b0fb498f
commit
e854005ae1
193 changed files with 15896 additions and 6384 deletions
|
@ -49,29 +49,28 @@ def find_feat_part(artist, albumartist):
|
|||
"""Attempt to find featured artists in the item's artist fields and
|
||||
return the results. Returns None if no featured artist found.
|
||||
"""
|
||||
feat_part = None
|
||||
|
||||
# Look for the album artist in the artist field. If it's not
|
||||
# present, give up.
|
||||
albumartist_split = artist.split(albumartist, 1)
|
||||
if len(albumartist_split) <= 1:
|
||||
return feat_part
|
||||
return None
|
||||
|
||||
# If the last element of the split (the right-hand side of the
|
||||
# album artist) is nonempty, then it probably contains the
|
||||
# featured artist.
|
||||
elif albumartist_split[-1] != '':
|
||||
elif albumartist_split[1] != '':
|
||||
# Extract the featured artist from the right-hand side.
|
||||
_, feat_part = split_on_feat(albumartist_split[-1])
|
||||
_, feat_part = split_on_feat(albumartist_split[1])
|
||||
return feat_part
|
||||
|
||||
# Otherwise, if there's nothing on the right-hand side, look for a
|
||||
# featuring artist on the left-hand side.
|
||||
else:
|
||||
lhs, rhs = split_on_feat(albumartist_split[0])
|
||||
if lhs:
|
||||
feat_part = lhs
|
||||
return lhs
|
||||
|
||||
return feat_part
|
||||
return None
|
||||
|
||||
|
||||
class FtInTitlePlugin(plugins.BeetsPlugin):
|
||||
|
@ -90,7 +89,7 @@ class FtInTitlePlugin(plugins.BeetsPlugin):
|
|||
|
||||
self._command.parser.add_option(
|
||||
u'-d', u'--drop', dest='drop',
|
||||
action='store_true', default=False,
|
||||
action='store_true', default=None,
|
||||
help=u'drop featuring from artists and ignore title update')
|
||||
|
||||
if self.config['auto']:
|
||||
|
@ -137,7 +136,7 @@ class FtInTitlePlugin(plugins.BeetsPlugin):
|
|||
# Only update the title if it does not already contain a featured
|
||||
# artist and if we do not drop featuring information.
|
||||
if not drop_feat and not contains_feat(item.title):
|
||||
feat_format = self.config['format'].get(unicode)
|
||||
feat_format = self.config['format'].as_str()
|
||||
new_format = feat_format.format(feat_part)
|
||||
new_title = u"{0} {1}".format(item.title, new_format)
|
||||
self._log.info(u'title: {0} -> {1}', item.title, new_title)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue