Merge branch '216-oggtheora-support' into 'develop'

Resolve "Unsupported format OggTheora"

Closes #216

See merge request funkwhale/funkwhale!209
merge-requests/237/head
Eliot Berriot 2018-05-24 15:41:07 +00:00
commit c36bdf8da5
4 zmienionych plików z 48 dodań i 0 usunięć

Wyświetl plik

@ -97,6 +97,37 @@ CONF = {
},
}
},
'OggTheora': {
'getter': lambda f, k: f[k][0],
'fields': {
'track_number': {
'field': 'TRACKNUMBER',
'to_application': convert_track_number
},
'title': {
'field': 'title'
},
'artist': {
'field': 'artist'
},
'album': {
'field': 'album'
},
'date': {
'field': 'date',
'to_application': lambda v: arrow.get(v).date()
},
'musicbrainz_albumid': {
'field': 'MusicBrainz Album Id'
},
'musicbrainz_artistid': {
'field': 'MusicBrainz Artist Id'
},
'musicbrainz_recordingid': {
'field': 'MusicBrainz Track Id'
},
}
},
'MP3': {
'getter': get_id3_tag,
'fields': {

Wyświetl plik

@ -24,6 +24,22 @@ def test_can_get_metadata_from_ogg_file(field, value):
assert data.get(field) == value
@pytest.mark.parametrize('field,value', [
('title', 'Drei Kreuze (dass wir hier sind)'),
('artist', 'Die Toten Hosen'),
('album', 'Ballast der Republik'),
('date', datetime.date(2012, 5, 4)),
('track_number', 1),
('musicbrainz_albumid', uuid.UUID('1f0441ad-e609-446d-b355-809c445773cf')),
('musicbrainz_recordingid', uuid.UUID('124d0150-8627-46bc-bc14-789a3bc960c8')),
('musicbrainz_artistid', uuid.UUID('c3bc80a6-1f4a-4e17-8cf0-6b1efe8302f1')),
])
def test_can_get_metadata_from_ogg_theora_file(field, value):
path = os.path.join(DATA_DIR, 'test_theora.ogg')
data = metadata.Metadata(path)
assert data.get(field) == value
@pytest.mark.parametrize('field,value', [
('title', 'Bend'),

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -0,0 +1 @@
Added Support for OggTheora in import.