mirror of
https://github.com/beetbox/beets.git
synced 2025-12-21 08:04:03 +01:00
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:
parent
d8815898b8
commit
e75718d196
1 changed files with 6 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue