diff --git a/beetsplug/importfeeds.py b/beetsplug/importfeeds.py index cf367fb5b..0f1cd11c8 100644 --- a/beetsplug/importfeeds.py +++ b/beetsplug/importfeeds.py @@ -13,17 +13,20 @@ # included in all copies or substantial portions of the Software. """Write paths of imported files in various formats to ease later import in a -music player. +music player. Also allow printing the new file locations to stdout in case +one wants to manually add music to a player by its path. """ import datetime import os import re +import logging from beets.plugins import BeetsPlugin from beets.util import normpath, syspath, bytestring_path from beets import config M3U_DEFAULT_NAME = 'imported.m3u' +log = logging.getLogger('beets') class ImportFeedsPlugin(BeetsPlugin): @@ -126,6 +129,11 @@ def _record_items(lib, basename, items): if not os.path.exists(syspath(dest)): os.symlink(syspath(path), syspath(dest)) + if 'echo' in formats: + log.info("Location of imported music:") + for path in paths: + log.info(" " + path) + @ImportFeedsPlugin.listen('library_opened') def library_opened(lib): diff --git a/docs/plugins/importfeeds.rst b/docs/plugins/importfeeds.rst index dcc2ae653..515295dca 100644 --- a/docs/plugins/importfeeds.rst +++ b/docs/plugins/importfeeds.rst @@ -18,12 +18,13 @@ 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 +Four different types of outputs coexist, specify the ones you want to use by 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). - ``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. +- ``echo``: do not write a playlist file at all, but echo a list of new file paths to the terminal. Here's an example configuration for this plugin::