diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5310df2d5..137f74b72 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,7 @@ jobs: strategy: matrix: platform: [ubuntu-latest, windows-latest] - python-version: [3.6, 3.7, 3.8, 3.9, 3.10-rc.2] + python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0-rc.2] env: PY_COLORS: 1 @@ -45,7 +45,7 @@ jobs: sudo apt install ffmpeg # For replaygain - name: Test older Python versions with tox - if: matrix.python-version != '3.9' && matrix.python-version != '3.10-rc.2' + if: matrix.python-version != '3.9' && matrix.python-version != '3.10.0-rc.2' run: | tox -e py-test @@ -55,7 +55,7 @@ jobs: tox -vv -e py-cov - name: Test nightly Python version with tox - if: matrix.python-version == '3.10-rc.2' + if: matrix.python-version == '3.10.0-rc.2' # continue-on-error is not ideal since it doesn't give a visible # warning, but there doesn't seem to be anything better: # https://github.com/actions/toolkit/issues/399 diff --git a/beets/autotag/mb.py b/beets/autotag/mb.py index e6a2e277f..7765e970c 100644 --- a/beets/autotag/mb.py +++ b/beets/autotag/mb.py @@ -18,6 +18,8 @@ import musicbrainzngs import re import traceback +from collections import Counter +from six.moves.urllib.parse import urljoin from beets import logging from beets import plugins diff --git a/beets/library.py b/beets/library.py index d94468800..79e84e3e6 100644 --- a/beets/library.py +++ b/beets/library.py @@ -455,47 +455,47 @@ class Item(LibModel): 'path': PathType(), 'album_id': types.FOREIGN_ID, - 'title': types.STRING, - 'artist': types.STRING, - 'artist_sort': types.STRING, - 'artist_credit': types.STRING, - 'album': types.STRING, - 'albumartist': types.STRING, - 'albumartist_sort': types.STRING, - 'albumartist_credit': types.STRING, - 'genre': types.STRING, - 'style': types.STRING, - 'discogs_albumid': types.INTEGER, - 'discogs_artistid': types.INTEGER, - 'discogs_labelid': types.INTEGER, - 'lyricist': types.STRING, - 'composer': types.STRING, - 'composer_sort': types.STRING, - 'work': types.STRING, - 'mb_workid': types.STRING, - 'work_disambig': types.STRING, - 'arranger': types.STRING, - 'grouping': types.STRING, - 'year': types.PaddedInt(4), - 'month': types.PaddedInt(2), - 'day': types.PaddedInt(2), - 'track': types.PaddedInt(2), - 'tracktotal': types.PaddedInt(2), - 'disc': types.PaddedInt(2), - 'disctotal': types.PaddedInt(2), - 'lyrics': types.STRING, - 'comments': types.STRING, - 'bpm': types.INTEGER, - 'comp': types.BOOLEAN, - 'mb_trackid': types.STRING, - 'mb_albumid': types.STRING, - 'mb_artistid': types.STRING, - 'mb_albumartistid': types.STRING, - 'mb_releasetrackid': types.STRING, - 'trackdisambig': types.STRING, - 'albumtype': types.STRING, - 'albumtypes': types.STRING, - 'label': types.STRING, + 'title': types.STRING, + 'artist': types.STRING, + 'artist_sort': types.STRING, + 'artist_credit': types.STRING, + 'album': types.STRING, + 'albumartist': types.STRING, + 'albumartist_sort': types.STRING, + 'albumartist_credit': types.STRING, + 'genre': types.STRING, + 'style': types.STRING, + 'discogs_albumid': types.INTEGER, + 'discogs_artistid': types.INTEGER, + 'discogs_labelid': types.INTEGER, + 'lyricist': types.STRING, + 'composer': types.STRING, + 'composer_sort': types.STRING, + 'work': types.STRING, + 'mb_workid': types.STRING, + 'work_disambig': types.STRING, + 'arranger': types.STRING, + 'grouping': types.STRING, + 'year': types.PaddedInt(4), + 'month': types.PaddedInt(2), + 'day': types.PaddedInt(2), + 'track': types.PaddedInt(2), + 'tracktotal': types.PaddedInt(2), + 'disc': types.PaddedInt(2), + 'disctotal': types.PaddedInt(2), + 'lyrics': types.STRING, + 'comments': types.STRING, + 'bpm': types.INTEGER, + 'comp': types.BOOLEAN, + 'mb_trackid': types.STRING, + 'mb_albumid': types.STRING, + 'mb_artistid': types.STRING, + 'mb_albumartistid': types.STRING, + 'mb_releasetrackid': types.STRING, + 'trackdisambig': types.STRING, + 'albumtype': types.STRING, + 'albumtypes': types.STRING, + 'label': types.STRING, 'acoustid_fingerprint': types.STRING, 'acoustid_id': types.STRING, 'mb_releasegroupid': types.STRING, @@ -1024,35 +1024,35 @@ class Album(LibModel): _fields = { 'id': types.PRIMARY_ID, 'artpath': PathType(True), - 'added': DateType(), + 'added': DateType(), - 'albumartist': types.STRING, - 'albumartist_sort': types.STRING, - 'albumartist_credit': types.STRING, - 'album': types.STRING, - 'genre': types.STRING, - 'style': types.STRING, - 'discogs_albumid': types.INTEGER, - 'discogs_artistid': types.INTEGER, - 'discogs_labelid': types.INTEGER, - 'year': types.PaddedInt(4), - 'month': types.PaddedInt(2), - 'day': types.PaddedInt(2), - 'disctotal': types.PaddedInt(2), - 'comp': types.BOOLEAN, - 'mb_albumid': types.STRING, - 'mb_albumartistid': types.STRING, - 'albumtype': types.STRING, - 'albumtypes': types.STRING, - 'label': types.STRING, - 'mb_releasegroupid': types.STRING, - 'asin': types.STRING, - 'catalognum': types.STRING, - 'script': types.STRING, - 'language': types.STRING, - 'country': types.STRING, - 'albumstatus': types.STRING, - 'albumdisambig': types.STRING, + 'albumartist': types.STRING, + 'albumartist_sort': types.STRING, + 'albumartist_credit': types.STRING, + 'album': types.STRING, + 'genre': types.STRING, + 'style': types.STRING, + 'discogs_albumid': types.INTEGER, + 'discogs_artistid': types.INTEGER, + 'discogs_labelid': types.INTEGER, + 'year': types.PaddedInt(4), + 'month': types.PaddedInt(2), + 'day': types.PaddedInt(2), + 'disctotal': types.PaddedInt(2), + 'comp': types.BOOLEAN, + 'mb_albumid': types.STRING, + 'mb_albumartistid': types.STRING, + 'albumtype': types.STRING, + 'albumtypes': types.STRING, + 'label': types.STRING, + 'mb_releasegroupid': types.STRING, + 'asin': types.STRING, + 'catalognum': types.STRING, + 'script': types.STRING, + 'language': types.STRING, + 'country': types.STRING, + 'albumstatus': types.STRING, + 'albumdisambig': types.STRING, 'releasegroupdisambig': types.STRING, 'rg_album_gain': types.NULL_FLOAT, 'rg_album_peak': types.NULL_FLOAT, diff --git a/beetsplug/albumtypes.py b/beetsplug/albumtypes.py index 47f8dc64e..4d7948c7b 100644 --- a/beetsplug/albumtypes.py +++ b/beetsplug/albumtypes.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # This file is part of beets. # Copyright 2021, Edgars Supe. # @@ -14,6 +16,7 @@ """Adds an album template field for formatted album types.""" +from __future__ import division, absolute_import, print_function from beets.autotag.mb import VARIOUS_ARTISTS_ID from beets.library import Album diff --git a/docs/changelog.rst b/docs/changelog.rst index cf99baae2..ecf43b803 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -27,6 +27,13 @@ Major new features: option is set, and sort them by the number of votes. Thanks to :user:`aereaux`. +* Primary and secondary release types from MusicBrainz are now stored in + ``albumtypes`` field. Thanks to :user:`edgars-supe`. + :bug:`2200` + +* :doc:`/plugins/albumtypes`: An accompanying plugin for formatting + ``albumtypes``. Thanks to :user:`edgars-supe`. + Other new things: * Permissions plugin now sets cover art permissions to the file permissions. diff --git a/test/test_albumtypes.py b/test/test_albumtypes.py index 91808553d..a9db12c30 100644 --- a/test/test_albumtypes.py +++ b/test/test_albumtypes.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2021, Edgars Supe. # @@ -14,6 +15,7 @@ """Tests for the 'albumtypes' plugin.""" +from __future__ import division, absolute_import, print_function import unittest