mirror of
https://github.com/beetbox/beets.git
synced 2026-01-04 15:03:22 +01:00
importfeeds: absolute path option (#180)
This commit is contained in:
parent
ae40b97528
commit
b9844ccf3a
2 changed files with 14 additions and 7 deletions
|
|
@ -34,10 +34,11 @@ class ImportFeedsPlugin(BeetsPlugin):
|
|||
'm3u_name': u'imported.m3u',
|
||||
'dir': None,
|
||||
'relative_to': None,
|
||||
'absolute_path': False
|
||||
})
|
||||
|
||||
|
||||
feeds_dir = self.config['dir'].get()
|
||||
if feeds_dir:
|
||||
if feeds_dir:
|
||||
feeds_dir = os.path.expanduser(bytestring_path(feeds_dir))
|
||||
self.config['dir'] = feeds_dir
|
||||
if not os.path.exists(syspath(feeds_dir)):
|
||||
|
|
@ -92,9 +93,12 @@ def _record_items(lib, basename, items):
|
|||
|
||||
paths = []
|
||||
for item in items:
|
||||
paths.append(os.path.relpath(
|
||||
item.path, relative_to
|
||||
))
|
||||
if config['importfeeds']['absolute_path']:
|
||||
paths.append(item.path)
|
||||
else:
|
||||
paths.append(os.path.relpath(
|
||||
item.path, relative_to
|
||||
))
|
||||
|
||||
if 'm3u' in formats:
|
||||
basename = bytestring_path(
|
||||
|
|
|
|||
|
|
@ -15,11 +15,14 @@ relative to another folder than where the playlist is being written. If you're
|
|||
using importfeeds to generate a playlist for MPD, you should set this to the
|
||||
root of your music library.
|
||||
|
||||
The ``absolute_path`` configuration option can be set to use absolute paths
|
||||
instead of relative paths. Some applications may need this to work properly.
|
||||
|
||||
Three different types of outputs coexist, specify the ones you want to use by
|
||||
setting the ``formats`` parameter:
|
||||
setting the ``formats`` parameter:
|
||||
|
||||
- ``m3u``: catalog the imports in a centralized playlist. By default, the playlist is named ``imported.m3u``. To use a different file, just set the ``m3u_name`` parameter inside the ``importfeeds`` config section.
|
||||
- ``m3u_multi``: create a new playlist for each import (uniquely named by appending the date and track/album name).
|
||||
- ``m3u_multi``: create a new playlist for each import (uniquely named by appending the date and track/album name).
|
||||
- ``link``: create a symlink for each imported item. This is the recommended setting to propagate beets imports to your iTunes library: just drag and drop the ``dir`` folder on the iTunes dock icon.
|
||||
|
||||
Here's an example configuration for this plugin::
|
||||
|
|
|
|||
Loading…
Reference in a new issue