Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mélanie Chauvel
funkwhale
Commits
9e5d168e
Commit
9e5d168e
authored
Nov 21, 2020
by
Philipp Wolfer
Browse files
Support AIFF file format
Fixes #1243
parent
f91abcbf
Changes
6
Hide whitespace changes
Inline
Side-by-side
api/funkwhale_api/music/metadata.py
View file @
9e5d168e
...
...
@@ -253,7 +253,7 @@ CONF = {
"comment"
:
{
"field"
:
"comment"
},
},
},
"
MP
3"
:
{
"
ID
3"
:
{
"getter"
:
get_id3_tag
,
"clean_pictures"
:
clean_id3_pictures
,
"fields"
:
{
...
...
@@ -331,6 +331,9 @@ CONF = {
},
}
CONF
[
"MP3"
]
=
CONF
[
"ID3"
]
CONF
[
"AIFF"
]
=
CONF
[
"ID3"
]
ALL_FIELDS
=
[
"position"
,
"disc_number"
,
...
...
api/funkwhale_api/music/utils.py
View file @
9e5d168e
...
...
@@ -59,6 +59,10 @@ AUDIO_EXTENSIONS_AND_MIMETYPE = [
(
"m4a"
,
"audio/x-m4a"
),
(
"flac"
,
"audio/x-flac"
),
(
"flac"
,
"audio/flac"
),
(
"aif"
,
"audio/aiff"
),
(
"aif"
,
"audio/x-aiff"
),
(
"aiff"
,
"audio/aiff"
),
(
"aiff"
,
"audio/x-aiff"
),
]
EXTENSION_TO_MIMETYPE
=
{
ext
:
mt
for
ext
,
mt
in
AUDIO_EXTENSIONS_AND_MIMETYPE
}
...
...
api/tests/music/test.aiff
0 → 100644
View file @
9e5d168e
File added
api/tests/music/test_metadata.py
View file @
9e5d168e
...
...
@@ -150,10 +150,38 @@ def test_can_get_metadata_from_id3_mp3_file(field, value):
assert
str
(
data
.
get
(
field
))
==
value
@
pytest
.
mark
.
parametrize
(
"field,value"
,
[
(
"title"
,
"Bend"
),
(
"artist"
,
"Binärpilot"
),
(
"album_artist"
,
"Binärpilot"
),
# ("artists", "Binärpilot; Another artist"), # FW does not properly extract multi-value artists from ID3
(
"album"
,
"You Can't Stop Da Funk"
),
(
"date"
,
"2006-02-07"
),
(
"position"
,
"2/4"
),
(
"disc_number"
,
"1/1"
),
(
"musicbrainz_albumid"
,
"ce40cdb1-a562-4fd8-a269-9269f98d4124"
),
(
"mbid"
,
"f269d497-1cc0-4ae4-a0c4-157ec7d73fcb"
),
(
"musicbrainz_artistid"
,
"9c6bddde-6228-4d9f-ad0d-03f6fcb19e13"
),
(
"musicbrainz_albumartistid"
,
"9c6bddde-6228-4d9f-ad0d-03f6fcb19e13"
),
(
"license"
,
"https://creativecommons.org/licenses/by-nc-nd/2.5/"
),
(
"copyright"
,
"Someone"
),
(
"comment"
,
"Hello there"
),
],
)
def
test_can_get_metadata_from_id3_aiff_file
(
field
,
value
):
path
=
os
.
path
.
join
(
DATA_DIR
,
"test.aiff"
)
data
=
metadata
.
Metadata
(
path
)
assert
str
(
data
.
get
(
field
))
==
value
@
pytest
.
mark
.
parametrize
(
"name"
,
[
"test.mp3"
,
"test.aiff"
,
"with_other_picture.mp3"
,
"sample.flac"
,
"with_cover.ogg"
,
...
...
changes/changelog.d/1243.enhancement
0 → 100644
View file @
9e5d168e
Support AIFF file format (#1243)
\ No newline at end of file
front/src/store/ui.js
View file @
9e5d168e
...
...
@@ -11,7 +11,7 @@ export default {
lastDate
:
new
Date
(),
maxMessages
:
100
,
messageDisplayDuration
:
5
*
1000
,
supportedExtensions
:
[
"
flac
"
,
"
ogg
"
,
"
mp3
"
,
"
opus
"
,
"
aac
"
,
"
m4a
"
],
supportedExtensions
:
[
"
flac
"
,
"
ogg
"
,
"
mp3
"
,
"
opus
"
,
"
aac
"
,
"
m4a
"
,
"
aiff
"
,
"
aif
"
],
messages
:
[],
theme
:
'
light
'
,
window
:
{
...
...
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