mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] Advertise audio/mpeg as supported (#3632)
This will be either an mp1, mp2 or mp3 file. In practice it'll probably be mp3, but this handles mp1 too for good measure. We don't advertise audio/mp1 as a supported media type since best I can tell that was never a MIME type that's been used. This also changes the returned MIME-type for mp2 and mp3 to audio/mpeg, to match what's expected and supported by most things nowadays. Fixes: #3531
This commit is contained in:
@@ -377,12 +377,15 @@ func (res *result) GetFileType() (gtsmodel.FileType, string, string) {
|
||||
case "mp3":
|
||||
if len(res.audio) > 0 {
|
||||
switch res.audio[0].codec {
|
||||
case "mp1":
|
||||
return gtsmodel.FileTypeAudio,
|
||||
"audio/mpeg", "mp1"
|
||||
case "mp2":
|
||||
return gtsmodel.FileTypeAudio,
|
||||
"audio/mp2", "mp2"
|
||||
"audio/mpeg", "mp2"
|
||||
case "mp3":
|
||||
return gtsmodel.FileTypeAudio,
|
||||
"audio/mp3", "mp3"
|
||||
"audio/mpeg", "mp3"
|
||||
}
|
||||
}
|
||||
case "asf":
|
||||
|
Reference in New Issue
Block a user