Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Creak
funkwhale
Commits
66ef7a73
Verified
Commit
66ef7a73
authored
5 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Fix #946: Fix import crash when importing M4A file with no embedded cover
parent
db807101
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/funkwhale_api/music/metadata.py
+1
-1
1 addition, 1 deletion
api/funkwhale_api/music/metadata.py
api/tests/music/test_metadata.py
+5
-0
5 additions, 0 deletions
api/tests/music/test_metadata.py
changes/changelog.d/946.bugfix
+1
-0
1 addition, 0 deletions
changes/changelog.d/946.bugfix
with
7 additions
and
1 deletion
api/funkwhale_api/music/metadata.py
+
1
−
1
View file @
66ef7a73
...
@@ -72,7 +72,7 @@ def clean_id3_pictures(apic):
...
@@ -72,7 +72,7 @@ def clean_id3_pictures(apic):
def
get_mp4_tag
(
f
,
k
):
def
get_mp4_tag
(
f
,
k
):
if
k
==
"
pictures
"
:
if
k
==
"
pictures
"
:
return
f
.
get
(
"
covr
"
)
return
f
.
get
(
"
covr
"
,
[]
)
raw_value
=
f
.
get
(
k
,
None
)
raw_value
=
f
.
get
(
k
,
None
)
if
not
raw_value
:
if
not
raw_value
:
...
...
This diff is collapsed.
Click to expand it.
api/tests/music/test_metadata.py
+
5
−
0
View file @
66ef7a73
...
@@ -219,6 +219,11 @@ def test_can_get_metadata_from_m4a_file(field, value):
...
@@ -219,6 +219,11 @@ def test_can_get_metadata_from_m4a_file(field, value):
assert
data
.
get
(
field
)
==
value
assert
data
.
get
(
field
)
==
value
def
test_get_pictures_m4a_empty
():
pictures
=
metadata
.
get_mp4_tag
({},
"
pictures
"
)
assert
metadata
.
clean_mp4_pictures
(
pictures
)
==
[]
def
test_can_get_metadata_from_flac_file_not_crash_if_empty
():
def
test_can_get_metadata_from_flac_file_not_crash_if_empty
():
path
=
os
.
path
.
join
(
DATA_DIR
,
"
sample.flac
"
)
path
=
os
.
path
.
join
(
DATA_DIR
,
"
sample.flac
"
)
data
=
metadata
.
Metadata
(
path
)
data
=
metadata
.
Metadata
(
path
)
...
...
This diff is collapsed.
Click to expand it.
changes/changelog.d/946.bugfix
0 → 100644
+
1
−
0
View file @
66ef7a73
Fix import crash when importing M4A file with no embedded cover (#946)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment