Skip to content

Commit

Permalink
refactor!: remove musicbrainz plugin
Browse files Browse the repository at this point in the history
Musicbrainz is now a third-party plugin to be consistent with Moe's policy that any metadata source plugins should not be in the core repository.
  • Loading branch information
jtpavlock committed Dec 20, 2022
1 parent bcda77d commit d171be0
Show file tree
Hide file tree
Showing 20 changed files with 11 additions and 4,944 deletions.
6 changes: 3 additions & 3 deletions README.rst
Expand Up @@ -13,7 +13,7 @@ Moe comes with a command-line interface which is how most users will take advant

Alternatively, because all the core functionality is available via an API, the underlying music management system can be incorporated into any existing program or other user interface.

Finally, although a lot of Moe's functionality exists around the idea of operating on a library database of your music, the database is entirely optional. In this case, Moe provides a convenient set of tools and functionality for handling music in a general sense. For example, below is a standalone python script that takes an album directory and Musicbrainz release ID from the command-line, and then updates the underlying files' tags with any changes from Musicbrainz.
Finally, although a lot of Moe's functionality exists around the idea of operating on a library database of your music, the database is entirely optional. In this case, Moe provides a convenient set of tools and functionality for handling music in a general sense. For example, below is a standalone python script that takes an album directory and Musicbrainz release ID from the command-line, and then updates the underlying files' tags with any changes from Musicbrainz (utilizing the ``musicbrainz`` plugin).

.. code:: python
Expand All @@ -22,11 +22,11 @@ Finally, although a lot of Moe's functionality exists around the idea of operati
import argparse
import pathlib
import moe.musicbrainz as moe_mb
from moe.config import Config, ConfigValidationError
from moe.library import Album
from moe.write import write_tags
import moe_musicbrainz
def main():
try:
Expand All @@ -43,7 +43,7 @@ Finally, although a lot of Moe's functionality exists around the idea of operati
album = Album.from_dir(pathlib.Path(args.path))
album.merge(moe_mb.get_album_by_id(args.mb_id), overwrite=True)
album.merge(moe_musicbrainz.get_album_by_id(args.mb_id), overwrite=True)
for track in album.tracks:
write_tags(track)
Expand Down
28 changes: 0 additions & 28 deletions docs/cli.rst
Expand Up @@ -103,34 +103,6 @@ Optional Arguments
``-n, --dry-run``
Show what will be moved without actually moving any files.

mbcol
=====
Used to sync a musicbrainz collection with musicbrainz releases in the library. The collection synced is the one specified under ``collection_id`` in the user config.

.. code-block:: bash
moe mbcol [-h] [-a | -e] [--add | --remove] query
By default, the musicbrainz collection will be set to the releases found in the queried items. If tracks or extras are queried, their associated album releases will be synced with the collection.

Positional Arguments
--------------------
``query``
Query your library for items to sync your collection with. See the :doc:`query docs <../query>` for more info.

Optional Arguments
------------------
``-h, --help``
Display the help message.
``-a, --album``
Query for matching albums instead of tracks.
``-e, --extra``
Query for matching extras instead of tracks.
``--add``
Add releases to the collection.
``--remove``
Remove releases from the collection.

read
====
Updates Moe with any changes to your music files.
Expand Down
32 changes: 1 addition & 31 deletions docs/configuration.rst
Expand Up @@ -18,7 +18,7 @@ Global Options
==============
Most configuration options reside in their relevant plugin, however there are the following global options:

``default_plugins = ["add", "edit", "info", "ls", "move", "musicbrainz", "rm", "write"]``
``default_plugins = ["add", "edit", "info", "ls", "move", "rm", "write"]``
Overrides the list of default plugins.

``disable_plugins = []``
Expand Down Expand Up @@ -95,36 +95,6 @@ Moe allows plugins to create custom path template functions that can be called w

.. autofunction:: moe.move.move_core.e_unique

Musicbrainz
-----------
``username``
Musicbrainz username.
``password``
Musicbrainz password.

Collections
~~~~~~~~~~~
The following options involve auto updating a specific collection on musicbrainz, and should be specified under a ``musicbrainz.collection`` block as shown:

.. code-block:: toml
[musicbrainz.collection]
collection_id = "123"
.. important::

Utilizing any of the collections functionality requires setting your musicbrainz username and password as described above.

``collection_id``
Musicbrainz collection to automatically update.

``auto_add = False``
Whether to automatically add new releases in the library to the collection defined in ``collection_id``.

``auto_remove = False``
Whether to automatically remove releases from ``collection_id`` when removed from the library.


Overriding Config Values
========================
All configuration parameters can be overridden through environment variables. To override the configuration parameter ``{param}``, use an environment variable named ``MOE_{PARAM}``.
Expand Down
7 changes: 0 additions & 7 deletions docs/developers/api/core.rst
Expand Up @@ -82,13 +82,6 @@ Move
.. automodule:: moe.move
:members:

Musicbrainz
-----------
``moe.musicbrainz``

.. automodule:: moe.musicbrainz
:members:

Read
----
``moe.read``
Expand Down
6 changes: 0 additions & 6 deletions docs/developers/contributing.rst
Expand Up @@ -148,12 +148,6 @@ If adding a new field to Moe, the following checklist can help ensure you cover

* Add tests under ``test_write.py:TestWriteTags:test_write_tags()``

#. Read/load from the field from musicbrainz as necessary.

* See ``mb_core.py:_create_album()``
* Is it possible a musicbrainz release may not contain this field? Use safe dict access if necessary.
* Add to the ``album`` function in ``tests/plugins/musicbrainz/full_release.py`` to test parsing the new field from a musicbrainz release.

#. Add a weight for how much the field should factor into matching a track or album to another track or album in ``moe/util/core/match.py:MATCH_<TRACK/ALBUM>_FIELD_WEIGHTS``.
#. Include documentation for your new field in ``docs/fields.rst``
#. Create a migration script for your new field.
Expand Down
10 changes: 1 addition & 9 deletions docs/fields.rst
Expand Up @@ -53,12 +53,4 @@ Extra Fields
*************
Custom Fields
*************
In addition to the above fields, plugins may add any number of custom fields to Moe. These fields can be edited, queried, etc. the same as normal fields. The following custom fields currently are available by default:

Track Fields
============
* ``mb_track_id`` - musicbrainz track id

Album Fields
============
* ``mb_album_id`` - musicbrainz album aka release id
In addition to the above fields, plugins may add any number of custom fields to Moe. These fields can be edited, queried, etc. the same as normal fields.
6 changes: 5 additions & 1 deletion docs/getting_started.rst
Expand Up @@ -29,6 +29,10 @@ There also exist external or third-party plugins that extend the functionality o
*********
Now what?
*********
The first step is configuring Moe to your liking. To do this, check out the :doc:`configuration docs <configuration>`.
The first step is configuring Moe to your liking. To do this, check out the :doc:`configuration docs <configuration>`. You can also check out the various :doc:`third-party plugins <third_party_plugins>` available to extend the core functionality even further.

.. note::

Moe doesn't ship with any metadata source connections by default. If you'd like to import metadata from online sources such as Musicbrainz, you'll have to install a third-party plugin.

Once you're satisfied with everything, you can start using Moe! For normal users, check out the :doc:`command-line interface docs <cli>` to interact with and start adding music to your music library. If you're a developer, check out the relevant :doc:`developer docs <developers/developers>`.
1 change: 1 addition & 0 deletions docs/third_party_plugins.rst
Expand Up @@ -13,5 +13,6 @@ Known Plugins
=============
Below is a list of known third-party plugins for Moe. If you'd like to add your plugin to this list, please submit a pull request.

* `musicbrainz <https://moe-musicbrainz.readthedocs.io/en/latest/>`_ - Musicbrainz integration.
* `random <https://github.com/MoeMusic/moe_random>`_ - CLI command to output a random item from your library.
* `transcode <https://moe-transcode.readthedocs.io/en/latest/>`_ - API functions for transcoding music in your library.
1 change: 0 additions & 1 deletion moe/config.py
Expand Up @@ -45,7 +45,6 @@
"import": "moe.moe_import",
"list": "moe.list",
"move": "moe.move",
"musicbrainz": "moe.musicbrainz",
"read": "moe.read",
"sync": "moe.sync",
"remove": "moe.remove",
Expand Down
25 changes: 0 additions & 25 deletions moe/musicbrainz/__init__.py

This file was deleted.

101 changes: 0 additions & 101 deletions moe/musicbrainz/mb_cli.py

This file was deleted.

0 comments on commit d171be0

Please sign in to comment.