From 4c113dcf19b7e2553e74c8aed65c08ae8b15564a Mon Sep 17 00:00:00 2001 From: Alok Saboo Date: Sun, 4 Jun 2023 11:23:32 -0400 Subject: [PATCH 1/2] Update comment explaining how to extend import fields --- beets/importer.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/beets/importer.py b/beets/importer.py index 5eaebe960e..ff20071469 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -50,7 +50,18 @@ SINGLE_ARTIST_THRESH = 0.25 PROGRESS_KEY = 'tagprogress' HISTORY_KEY = 'taghistory' -# Album and item flexble attrbutes that should not be preserved on reimports. +""" +Album and item flexible attributes that should not be preserved on reimports. +All other fields will be preserved (i.e., not updated) during reimports. If +you prefer to change this behavior, you can modify the +`REIMPORT_FRESH_FIELDS_ALBUM` and the REIMPORT_FRESH_FIELDS_ITEM` lists in +your code. For example, if you want to allow updating update a flexible item +attribute `tidal_track_popularity`, you can add it to the list like this: + +from beets import importer +def extend_reimport_fresh_fields_item(): + importer.REIMPORT_FRESH_FIELDS_ITEM.extend(['tidal_track_popularity']) +""" REIMPORT_FRESH_FIELDS_ALBUM = ['data_source'] REIMPORT_FRESH_FIELDS_ITEM = ['data_source', 'bandcamp_album_id', 'spotify_album_id', 'deezer_album_id', From 4c8b13560f34e0438955486d6b9f2eb7a254e91b Mon Sep 17 00:00:00 2001 From: Alok Saboo Date: Mon, 3 Jul 2023 16:03:38 -0400 Subject: [PATCH 2/2] Updated comment --- beets/importer.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/beets/importer.py b/beets/importer.py index ff20071469..4b5284fec8 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -50,18 +50,15 @@ SINGLE_ARTIST_THRESH = 0.25 PROGRESS_KEY = 'tagprogress' HISTORY_KEY = 'taghistory' -""" -Album and item flexible attributes that should not be preserved on reimports. -All other fields will be preserved (i.e., not updated) during reimports. If -you prefer to change this behavior, you can modify the -`REIMPORT_FRESH_FIELDS_ALBUM` and the REIMPORT_FRESH_FIELDS_ITEM` lists in -your code. For example, if you want to allow updating update a flexible item -attribute `tidal_track_popularity`, you can add it to the list like this: - -from beets import importer -def extend_reimport_fresh_fields_item(): - importer.REIMPORT_FRESH_FIELDS_ITEM.extend(['tidal_track_popularity']) -""" +# Usually flexible attributes are preserved (i.e., not updated) during +# reimports. The following two lists (globally) change this behaviour for +# certain fields. To alter these lists only when a specific plugin is in use, +# something like this can be used within that plugin's code: +# +# from beets import importer +# def extend_reimport_fresh_fields_item(): +# importer.REIMPORT_FRESH_FIELDS_ITEM.extend(['tidal_track_popularity'] +# ) REIMPORT_FRESH_FIELDS_ALBUM = ['data_source'] REIMPORT_FRESH_FIELDS_ITEM = ['data_source', 'bandcamp_album_id', 'spotify_album_id', 'deezer_album_id',