Skip to content

Commit

Permalink
Export plugin can now export path from library, if explicitly specifi…
Browse files Browse the repository at this point in the history
…ed as field to export. Info plugin behaviour is unchanged.
  • Loading branch information
domenn committed Nov 28, 2018
1 parent b380a4c commit 5de3ee9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion beetsplug/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def library_data(lib, args):
def library_data_emitter(item):
def emitter():
data = dict(item.formatted())
data.pop('path', None) # path is fetched from item

return data, item
return emitter
Expand Down Expand Up @@ -184,6 +183,8 @@ def run(self, lib, opts, args):
included_keys = []
for keys in opts.included_keys:
included_keys.extend(keys.split(','))
# Drop path even if user provides it multiple times
included_keys = [k for k in included_keys if k != 'path']
key_filter = make_key_filter(included_keys)

first = True
Expand Down Expand Up @@ -239,4 +240,5 @@ def filter_(data):


def identity(val):
val.pop('path', None) # path is fetched from item
return val
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Changes:
``mb_albumid`` or ``mb_trackid`` field is invalid
See also the discussion on Google Groups_
Thanks to :user:`arogl`.
* :doc:`/plugins/export` now also exports ``path`` field if user explicitly
specifies it with ``-i`` parameter. Only works when exporting library fields.

.. _Groups: https://groups.google.com/forum/#!searchin/beets-users/mbsync|sort:date/beets-users/iwCF6bNdh9A/i1xl4Gx8BQAJ

Expand Down

0 comments on commit 5de3ee9

Please sign in to comment.