From 1d0af470a54bb7daabebcb51768014bda6069542 Mon Sep 17 00:00:00 2001 From: RollingStar Date: Sat, 12 Jan 2019 16:04:13 -0500 Subject: [PATCH 1/5] More details on self-hosting musicbrainz Document important facts for self-hosting musicbrainz with beets. I don't want the beets docs to be the go-to reference for hosting MusicBrainz, but the search index requirement is not explained well on the beets wiki. Full disclosure, I haven't finished building my index yet so I'm not sure if that is actually why I can't self-host right now. But I remember doing it before to fix beets integration with my Musicbrainz server. --- docs/reference/config.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/reference/config.rst b/docs/reference/config.rst index 0cbe73723..09af74b3e 100644 --- a/docs/reference/config.rst +++ b/docs/reference/config.rst @@ -654,8 +654,8 @@ Default: ``{}`` (empty). MusicBrainz Options ------------------- -If you run your own `MusicBrainz`_ server, you can instruct beets to use it -instead of the main server. Use the ``host`` and ``ratelimit`` options under a +You can instruct beets to use `your own`_ MusicBrainz database instead of +the `main server`_. Use the ``host`` and ``ratelimit`` options under a ``musicbrainz:`` header, like so:: musicbrainz: @@ -663,14 +663,18 @@ instead of the main server. Use the ``host`` and ``ratelimit`` options under a ratelimit: 100 The ``host`` key, of course, controls the Web server hostname (and port, -optionally) that will be contacted by beets (default: musicbrainz.org). The -``ratelimit`` option, an integer, controls the number of Web service requests +optionally) that will be contacted by beets (default: musicbrainz.org). +The ``host`` must have search indexes enabled -- see "Building search indexes" +in the server setup guide linked above. + +The ``ratelimit`` option, an integer, controls the number of Web service requests per second (default: 1). **Do not change the rate limit setting** if you're using the main MusicBrainz server---on this public server, you're `limited`_ to one request per second. +.. _your own: https://musicbrainz.org/doc/MusicBrainz_Server/Setup +.. _main server: https://musicbrainz.org/ .. _limited: http://musicbrainz.org/doc/XML_Web_Service/Rate_Limiting -.. _MusicBrainz: http://musicbrainz.org/ .. _searchlimit: From d35a68d0d8cfa4b1481365f5bee8ae2bc0c96dbf Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 12 Jan 2019 14:20:16 -0800 Subject: [PATCH 2/5] Refine writing/links for #3116 --- docs/reference/config.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/reference/config.rst b/docs/reference/config.rst index 09af74b3e..57cb6c295 100644 --- a/docs/reference/config.rst +++ b/docs/reference/config.rst @@ -654,7 +654,7 @@ Default: ``{}`` (empty). MusicBrainz Options ------------------- -You can instruct beets to use `your own`_ MusicBrainz database instead of +You can instruct beets to use `your own MusicBrainz database`_ instead of the `main server`_. Use the ``host`` and ``ratelimit`` options under a ``musicbrainz:`` header, like so:: @@ -664,17 +664,17 @@ the `main server`_. Use the ``host`` and ``ratelimit`` options under a The ``host`` key, of course, controls the Web server hostname (and port, optionally) that will be contacted by beets (default: musicbrainz.org). -The ``host`` must have search indexes enabled -- see "Building search indexes" -in the server setup guide linked above. +The server must have search indices enabled (see `Building search indexes`_). The ``ratelimit`` option, an integer, controls the number of Web service requests per second (default: 1). **Do not change the rate limit setting** if you're using the main MusicBrainz server---on this public server, you're `limited`_ to one request per second. -.. _your own: https://musicbrainz.org/doc/MusicBrainz_Server/Setup +.. _your own MusicBrainz database: https://musicbrainz.org/doc/MusicBrainz_Server/Setup .. _main server: https://musicbrainz.org/ .. _limited: http://musicbrainz.org/doc/XML_Web_Service/Rate_Limiting +.. _Building search indexes: https://musicbrainz.org/doc/MusicBrainz_Server/Setup#Building_search_indexes .. _searchlimit: From a4100a28a59502755fee9f7c6a9b04bf8aa38212 Mon Sep 17 00:00:00 2001 From: RollingStar Date: Wed, 16 Jan 2019 17:56:27 -0500 Subject: [PATCH 3/5] More verbose move message --- beets/ui/commands.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 1ed03bb9e..0182369b6 100755 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -1490,18 +1490,23 @@ def move_items(lib, dest, query, copy, album, pretend, confirm=False, """ items, albums = _do_query(lib, query, album, False) objs = albums if album else items + num_objs = len(objs) # Filter out files that don't need to be moved. isitemmoved = lambda item: item.path != item.destination(basedir=dest) isalbummoved = lambda album: any(isitemmoved(i) for i in album.items()) objs = [o for o in objs if (isalbummoved if album else isitemmoved)(o)] - + num_unmoved = num_objs - len(objs) + unmoved_msg = u'' + if num_unmoved > 0: + unmoved_msg = u' ({} already in place)'.format(num_unmoved) + copy = copy or export # Exporting always copies. action = u'Copying' if copy else u'Moving' act = u'copy' if copy else u'move' entity = u'album' if album else u'item' - log.info(u'{0} {1} {2}{3}.', action, len(objs), entity, - u's' if len(objs) != 1 else u'') + log.info(u'{0} {1} {2}{3}{4}.', action, len(objs), entity, + u's' if len(objs) != 1 else u'', unmoved_msg) if not objs: return From f5086d0bc68323bfe1bbc749fce5c2e950954a26 Mon Sep 17 00:00:00 2001 From: RollingStar Date: Fri, 18 Jan 2019 17:15:29 -0500 Subject: [PATCH 4/5] Changelog and linting --- beets/ui/commands.py | 3 ++- docs/changelog.rst | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 0182369b6..a38be7a15 100755 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -1497,10 +1497,11 @@ def move_items(lib, dest, query, copy, album, pretend, confirm=False, isalbummoved = lambda album: any(isitemmoved(i) for i in album.items()) objs = [o for o in objs if (isalbummoved if album else isitemmoved)(o)] num_unmoved = num_objs - len(objs) + # Report unmoved files that match the query. unmoved_msg = u'' if num_unmoved > 0: unmoved_msg = u' ({} already in place)'.format(num_unmoved) - + copy = copy or export # Exporting always copies. action = u'Copying' if copy else u'Moving' act = u'copy' if copy else u'move' diff --git a/docs/changelog.rst b/docs/changelog.rst index c1382b61c..d2c487906 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -52,6 +52,10 @@ New features: strings, which prevents strange repeated output when running ``beet write``. Thanks to :user:`Holzhaus`. :bug:`3097` :bug:`2942` +* The ``move`` command now lists the number of items already in-place. + Thanks to :user:`RollingStar`. + :bug:`3117 + Changes: From f4f67c36bb05851278c28c4bec51bb31e88a5ab4 Mon Sep 17 00:00:00 2001 From: RollingStar Date: Fri, 18 Jan 2019 17:17:41 -0500 Subject: [PATCH 5/5] Changelog and linting --- docs/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index d2c487906..e2a94aefd 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -54,7 +54,7 @@ New features: :bug:`3097` :bug:`2942` * The ``move`` command now lists the number of items already in-place. Thanks to :user:`RollingStar`. - :bug:`3117 + :bug:`3117` Changes: