No description
Find a file
Šarūnas Nejus 9110a1110b
Stop perpetually writing mb_artistid, mb_albumartistid and albumtypes fields (#5540)
This PR fixes an issue where the `beet write` command repeatedly shows
differences for certain fields (`mb_artistid`, `mb_albumartistid`,
`albumtype`) even after writing the tags.
This happens because these fields are actually stored as lists in the
media files (`mb_artistids`, `mb_albumartistids`, `albumtypes`), but
beets maintains both single and list versions in its database.

This PR addresses this issue in a non-invasive way: the fix ensures
consistency between single fields and their list counterparts by:
1. When setting a single field value, making it the first element of the
corresponding list
2. When setting a list, using its first element as the single field
value

This resolves long-standing issues #5265, #5371, and #4715 where users
experienced persistent "differences" in these fields despite writing
tags multiple times.

Changes:
- Added `ensure_consistent_list_fields()` function to synchronize field
pairs
- Applied this function during metadata application
- Added tests for all field combinations

Fixes #5265, #5371, #4715

**Note**: your music needs to be reimported with `beet import -LI` or
synchronised with `beet mbsync` in order to fix these fields!
2024-12-15 14:17:22 +00:00
.github Update CI config, minimum ruff version, docs and add changelog note 2024-12-10 06:10:03 +00:00
beets Define unique_list and dedupe 2024-12-15 13:22:07 +00:00
beetsplug Move imports required for typing under the TYPE_CHECKING block 2024-12-10 06:10:04 +00:00
docs Fix mb_artistid, mb_albumartistid, albumtype diff issue 2024-12-14 21:39:47 +00:00
extra Update related window files to match 3.8 2024-11-22 18:04:43 +10:00
test Ensure that list fields are corrected for album metadata too 2024-12-15 00:12:36 +00:00
.git-blame-ignore-revs Add .git-blame-ignore-revs file to ignore specific commits in git blame 2024-09-21 13:26:05 +01:00
.gitignore Utilize new way of declaring a NamedTuple 2024-08-25 16:26:19 +02:00
.pre-commit-config.yaml Drop Python 3.8 from the package, update dependencies 2024-12-10 06:08:14 +00:00
.readthedocs.yaml Fix path typo 2023-09-22 15:29:39 -04:00
CODE_OF_CONDUCT.rst Integrate code of conduct 2023-10-27 21:55:13 +10:00
codecov.yml Disable CodeCov annotations (see #4337) 2022-05-17 14:15:17 -04:00
CONTRIBUTING.rst Update CI config, minimum ruff version, docs and add changelog note 2024-12-10 06:10:03 +00:00
LICENSE Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
poetry.lock Drop Python 3.8 from the package, update dependencies 2024-12-10 06:08:14 +00:00
pyproject.toml Move imports required for typing under the TYPE_CHECKING block 2024-12-10 06:10:04 +00:00
README.rst Fix some broken/outdated links 2023-11-18 08:37:10 -05:00
README_kr.rst Fix all occurences of Discourse to GH-Discussions 2023-10-23 09:51:52 +02:00
SECURITY.md Create security policy 2021-12-22 09:34:41 -08:00
setup.cfg Remove unused logic from beets.test and exclude it from coverage 2024-10-16 12:38:21 +01:00

.. image:: https://img.shields.io/pypi/v/beets.svg
    :target: https://pypi.python.org/pypi/beets

.. image:: https://img.shields.io/codecov/c/github/beetbox/beets.svg
    :target: https://codecov.io/github/beetbox/beets

.. image:: https://github.com/beetbox/beets/workflows/ci/badge.svg?branch=master
    :target: https://github.com/beetbox/beets/actions

.. image:: https://repology.org/badge/tiny-repos/beets.svg
    :target: https://repology.org/project/beets/versions


beets
=====

Beets is the media library management system for obsessive music geeks.

The purpose of beets is to get your music collection right once and for all.
It catalogs your collection, automatically improving its metadata as it goes.
It then provides a bouquet of tools for manipulating and accessing your music.

Here's an example of beets' brainy tag corrector doing its thing::

  $ beet import ~/music/ladytron
  Tagging:
      Ladytron - Witching Hour
  (Similarity: 98.4%)
   * Last One Standing      -> The Last One Standing
   * Beauty                 -> Beauty*2
   * White Light Generation -> Whitelightgenerator
   * All the Way            -> All the Way...

Because beets is designed as a library, it can do almost anything you can
imagine for your music collection. Via `plugins`_, beets becomes a panacea:

- Fetch or calculate all the metadata you could possibly need: `album art`_,
  `lyrics`_, `genres`_, `tempos`_, `ReplayGain`_ levels, or `acoustic
  fingerprints`_.
- Get metadata from `MusicBrainz`_, `Discogs`_, and `Beatport`_. Or guess
  metadata using songs' filenames or their acoustic fingerprints.
- `Transcode audio`_ to any format you like.
- Check your library for `duplicate tracks and albums`_ or for `albums that
  are missing tracks`_.
- Clean up crufty tags left behind by other, less-awesome tools.
- Embed and extract album art from files' metadata.
- Browse your music library graphically through a Web browser and play it in any
  browser that supports `HTML5 Audio`_.
- Analyze music files' metadata from the command line.
- Listen to your library with a music player that speaks the `MPD`_ protocol
  and works with a staggering variety of interfaces.

If beets doesn't do what you want yet, `writing your own plugin`_ is
shockingly simple if you know a little Python.

.. _plugins: https://beets.readthedocs.org/page/plugins/
.. _MPD: https://www.musicpd.org/
.. _MusicBrainz music collection: https://musicbrainz.org/doc/Collections/
.. _writing your own plugin:
    https://beets.readthedocs.org/page/dev/plugins.html
.. _HTML5 Audio:
    https://html.spec.whatwg.org/multipage/media.html#the-audio-element
.. _albums that are missing tracks:
    https://beets.readthedocs.org/page/plugins/missing.html
.. _duplicate tracks and albums:
    https://beets.readthedocs.org/page/plugins/duplicates.html
.. _Transcode audio:
    https://beets.readthedocs.org/page/plugins/convert.html
.. _Discogs: https://www.discogs.com/
.. _acoustic fingerprints:
    https://beets.readthedocs.org/page/plugins/chroma.html
.. _ReplayGain: https://beets.readthedocs.org/page/plugins/replaygain.html
.. _tempos: https://beets.readthedocs.org/page/plugins/acousticbrainz.html
.. _genres: https://beets.readthedocs.org/page/plugins/lastgenre.html
.. _album art: https://beets.readthedocs.org/page/plugins/fetchart.html
.. _lyrics: https://beets.readthedocs.org/page/plugins/lyrics.html
.. _MusicBrainz: https://musicbrainz.org/
.. _Beatport: https://www.beatport.com

Install
-------

You can install beets by typing ``pip install beets`` or directly from Github (see details `here`_).
Beets has also been packaged in the `software repositories`_ of several
distributions. Check out the `Getting Started`_ guide for more information.

.. _here: https://beets.readthedocs.io/en/latest/faq.html#run-the-latest-source-version-of-beets
.. _Getting Started: https://beets.readthedocs.org/page/guides/main.html
.. _software repositories: https://repology.org/project/beets/versions

Contribute
----------

Thank you for considering contributing to ``beets``! Whether you're a
programmer or not, you should be able to find all the info you need at
`CONTRIBUTING.rst`_.

.. _CONTRIBUTING.rst: https://github.com/beetbox/beets/blob/master/CONTRIBUTING.rst

Read More
---------

Learn more about beets at `its Web site`_. Follow `@b33ts`_ on Mastodon for
news and updates.

.. _its Web site: https://beets.io/
.. _@b33ts: https://fosstodon.org/@beets

Contact
-------
* Encountered a bug you'd like to report? Check out our `issue tracker`_!
    * If your issue hasn't already been reported, please `open a new ticket`_
      and we'll be in touch with you shortly.
    * If you'd like to vote on a feature/bug, simply give a :+1: on issues
      you'd like to see prioritized over others.
* Need help/support, would like to start a discussion, have an idea for a new
  feature, or would just like to introduce yourself to the team? Check out
  `GitHub Discussions`_!

.. _GitHub Discussions: https://github.com/beetbox/beets/discussions
.. _issue tracker: https://github.com/beetbox/beets/issues
.. _open a new ticket: https://github.com/beetbox/beets/issues/new/choose

Authors
-------

Beets is by `Adrian Sampson`_ with a supporting cast of thousands.

.. _Adrian Sampson: https://www.cs.cornell.edu/~asampson/