Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jovuit
funkwhale
Commits
055ae44a
Commit
055ae44a
authored
Oct 11, 2020
by
Cédric Schieli
Committed by
Agate
Oct 25, 2020
Browse files
Allow genre tags to be updated when rescanning files in-place
parent
aabcc3c5
Changes
4
Hide whitespace changes
Inline
Side-by-side
api/funkwhale_api/music/tasks.py
View file @
055ae44a
...
...
@@ -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"
)
...
...
api/tests/music/test_tasks.py
View file @
055ae44a
...
...
@@ -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
):
...
...
changes/changelog.d/1246.enhancement
0 → 100644
View file @
055ae44a
Allow genre tags to be updated when rescanning files in-place (#1246)
docs/admin/importing-music.rst
View file @
055ae44a
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment