Adrian Sampson  committed aab7f92

original_date config option (GC-441)

  • Participants
  • Parent commits 1ff40f5

Comments (0)

Files changed (4)

File beets/autotag/

         item.albumartist_credit = album_info.artist_credit
         # Release date.
-        for key in ('year', 'month', 'day',
-                    'original_year', 'original_month', 'original_day'):
-            value = getattr(album_info, key)
-            if value:
-                setattr(item, key, value)
+        for prefix in '', 'original_':
+            if config['original_date'] and not prefix:
+                # Ignore specific release date.
+                continue
+            for suffix in 'year', 'month', 'day':
+                key = prefix + suffix
+                value = getattr(album_info, key)
+                if value:
+                    setattr(item, key, value)
+                    if config['original_date']:
+                        # If we're using original release date for both
+                        # fields, set item.year = info.original_year,
+                        # etc.
+                        setattr(item, suffix, value)
         # Title.
         item.title = track_info.title

File beets/config_default.yaml

 per_disc_numbering: no
 verbose: no
 terminal_encoding: utf8
+original_date: no
     terminal_width: 80

File docs/changelog.rst

 1.1b2 (in development)
+This version introduces one **change to the default behavior** that you should
+be aware of. Previously, when importing new albums matched in MusicBrainz, the
+date fields (``year``, ``month``, and ``day``) would be set to the release date
+of the *original* version of the album, as opposed to the specific date of the
+release selected. Now, these fields reflect the specific release and
+``original_year``, etc., reflect the earlier release date. If you want the old
+behavior, just set :ref:`original_date` to true in your config file.
 New configuration options:
 * :ref:`default_action` lets you determine the default (just-hit-return) option
 * :ref:`max_rec` lets you define a maximum recommendation for albums with
   missing/extra tracks or differing track lengths/numbers. Thanks again to Tai
+* :ref:`original_date` determines whether, when importing new albums, the
+  ``year``, ``month``, and ``day`` fields should reflect the specific (e.g.,
+  reissue) release date or the original release date. Note that the original
+  release date is always available as ``original_year``, etc.
 * :ref:`clutter` controls which files should be ignored when cleaning up empty
   directories. Thanks to Steinþór Pálsson.
 * :doc:`/plugins/lastgenre`: A new configuration option lets you choose to

File docs/reference/config.rst

 commands. Defaults to ``$albumartist - $album``. The ``-f`` command-line
 option overrides this setting.
+.. _original_date:
+Either ``yes`` or ``no``, indicating whether matched albums should have their
+``year``, ``month``, and ``day`` fields set to the release date of the
+*original* version of an album rather than the selected version of the release.
+That is, if this option is turned on, then ``year`` will always equal
+``original_year`` and so on. Default: ``no``.
 .. _per_disc_numbering: