diff --git a/docs/changelog.rst b/docs/changelog.rst index c394f2b4..04c5eaa1 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -46,6 +46,11 @@ v0.17.0 (UNRELEASED) - Fix scanner so that time of last modification is respected when deciding which files can be skipped. +- The scanner now ignores the capitalization of file extensions in + :confval:`local/excluded_file_extensions`, so you no longer need to list both + ``.jpg`` and ``.JPG`` to ignore JPEG files when scanning. (Fixes: + :issue:`525`) + **MPD frontend** - The MPD service is now published as a Zeroconf service if avahi-daemon is @@ -58,6 +63,9 @@ v0.17.0 (UNRELEASED) ``performer``. These tags can be used with ``list ...``, ``search ...``, and ``find ...`` and their variants, and are supported in the ``any`` tag also +- The ``bitrate`` field in the ``status`` response is now always an integer. + This follows the behavior of the original MPD server. (Fixes: :issue:`577`) + **HTTP frontend** - The HTTP service is now published as a Zeroconf service if avahi-daemon is diff --git a/mopidy/backends/local/commands.py b/mopidy/backends/local/commands.py index 601243d0..9afedf5f 100644 --- a/mopidy/backends/local/commands.py +++ b/mopidy/backends/local/commands.py @@ -29,7 +29,8 @@ class ScanCommand(commands.Command): def run(self, args, config, extensions): media_dir = config['local']['media_dir'] scan_timeout = config['local']['scan_timeout'] - excluded_file_extensions = config['local']['excluded_file_extensions'] + excluded_file_extensions = set( + ext.lower() for ext in config['local']['excluded_file_extensions']) updaters = {} for e in extensions: @@ -73,7 +74,7 @@ class ScanCommand(commands.Command): logger.info('Checking %s for unknown tracks.', media_dir) for uri in path.find_uris(media_dir): file_extension = os.path.splitext(path.uri_to_path(uri))[1] - if file_extension in excluded_file_extensions: + if file_extension.lower() in excluded_file_extensions: logger.debug('Skipped %s: File extension excluded.', uri) continue diff --git a/mopidy/frontends/mpd/protocol/status.py b/mopidy/frontends/mpd/protocol/status.py index 49e08ee8..deb5d503 100644 --- a/mopidy/frontends/mpd/protocol/status.py +++ b/mopidy/frontends/mpd/protocol/status.py @@ -214,8 +214,11 @@ def status(context): def _status_bitrate(futures): current_tl_track = futures['playback.current_tl_track'].get() - if current_tl_track is not None: - return current_tl_track.track.bitrate + if current_tl_track is None: + return 0 + if current_tl_track.track.bitrate is None: + return 0 + return current_tl_track.track.bitrate def _status_consume(futures): diff --git a/mopidy/frontends/mpd/translator.py b/mopidy/frontends/mpd/translator.py index e103e170..e4fb0d62 100644 --- a/mopidy/frontends/mpd/translator.py +++ b/mopidy/frontends/mpd/translator.py @@ -322,6 +322,12 @@ def _add_to_tag_cache(result, dirs, files, media_dir): for track in files: track_result = dict(track_to_mpd_format(track)) + # XXX Don't save comments to the tag cache as they may span multiple + # lines. We'll start saving track comments when we move from tag_cache + # to a JSON file. See #579 for details. + if 'Comment' in track_result: + del track_result['Comment'] + path = uri_to_path(track_result['file']) try: text_path = path.decode('utf-8') diff --git a/mopidy/utils/zeroconf.py b/mopidy/utils/zeroconf.py index c1781867..33fbd13b 100644 --- a/mopidy/utils/zeroconf.py +++ b/mopidy/utils/zeroconf.py @@ -1,11 +1,10 @@ from __future__ import unicode_literals import logging -import re import socket import string -logger = logging.getLogger('mopidy.utils.zerconf') +logger = logging.getLogger('mopidy.utils.zeroconf') try: import dbus @@ -17,13 +16,6 @@ _AVAHI_PROTO_UNSPEC = -1 _AVAHI_PUBLISHFLAGS_NONE = 0 -def _filter_loopback_and_meta_addresses(host): - # TODO: see if we can find a cleaner way of handling this. - if re.search(r'(?