use album template fields in item templates

This lets you use, for example, the example album bitrate field in path
formats.
This commit is contained in:
Adrian Sampson 2013-05-29 10:10:07 -07:00
parent d8815898b8
commit e75718d196

View file

@ -423,10 +423,15 @@ class Item(object):
mapping['albumartist'] = mapping['artist']
# Get values from plugins.
for key, value in plugins.template_values(self).iteritems():
for key, value in plugins.template_values(self).items():
if sanitize:
value = format_for_path(value, key, pathmod)
mapping[key] = value
if album:
for key, value in plugins.album_template_values(album).items():
if sanitize:
value = format_for_path(value, key, pathmod)
mapping[key] = value
# Get template functions.
funcs = DefaultTemplateFunctions(self, lib, pathmod).functions()