Verified Commit 48453256 authored by Cédric Schieli's avatar Cédric Schieli
Browse files

Allow genre tags to be updated when rescanning files in-place

parent 968e66eb
......@@ -937,6 +937,8 @@ def update_track_metadata(audio_metadata, track):
if obj_updated_fields:
obj.save(update_fields=obj_updated_fields)
tags_models.set_tags(track, *new_data.get("tags", []))
if track.album and "album" in new_data and new_data["album"].get("cover_data"):
common_utils.attach_file(
track.album, "attachment_cover", new_data["album"].get("cover_data")
......
......@@ -1364,6 +1364,7 @@ def test_update_track_metadata(factories):
"license": "Dummy license: http://creativecommons.org/licenses/by-sa/4.0/",
"copyright": "Someone",
"comment": "hello there",
"genre": "classical",
}
tasks.update_track_metadata(metadata.FakeMetadata(data), track)
......@@ -1382,6 +1383,9 @@ def test_update_track_metadata(factories):
assert str(track.artist.mbid) == data["musicbrainz_artistid"]
assert track.album.artist.name == "Edvard Grieg"
assert str(track.album.artist.mbid) == "013c8e5b-d72a-4cd3-8dee-6c64d6125823"
assert sorted(track.tagged_items.values_list("tag__name", flat=True)) == [
"classical"
]
def test_fs_import_not_pending(factories):
......
Allow genre tags to be updated when rescanning files in-place (#1246)
......@@ -145,6 +145,7 @@ Funkwhale will pick up the new title. The following fields can be updated this w
- Track title
- Track position and disc number
- Track license and copyright
- Track genre
- Album cover
- Album title
- Album mbid
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment