mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Fix feed audio file mimetype
This commit is contained in:
parent
5cea8f9567
commit
1611721c9b
7 changed files with 58 additions and 28 deletions
|
@ -8,6 +8,7 @@ import { ffprobePromise, getVideoStreamDimensionsInfo, getVideoStreamFPS, isAudi
|
|||
import { lTags } from './object-storage/shared/index.js'
|
||||
import { generateHLSVideoFilename, generateWebVideoFilename } from './paths.js'
|
||||
import { VideoPathManager } from './video-path-manager.js'
|
||||
import { MIMETYPES } from '@server/initializers/constants.js'
|
||||
|
||||
async function buildNewFile (options: {
|
||||
path: string
|
||||
|
@ -130,6 +131,12 @@ async function buildFileMetadata (path: string, existingProbe?: FfprobeData) {
|
|||
return new VideoFileMetadata(metadata)
|
||||
}
|
||||
|
||||
function getVideoFileMimeType (extname: string, isAudio: boolean) {
|
||||
return isAudio && extname === '.mp4' // We use .mp4 even for audio file only
|
||||
? MIMETYPES.AUDIO.EXT_MIMETYPE['.m4a']
|
||||
: MIMETYPES.VIDEO.EXT_MIMETYPE[extname]
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
|
@ -140,5 +147,6 @@ export {
|
|||
removeAllWebVideoFiles,
|
||||
removeWebVideoFile,
|
||||
|
||||
buildFileMetadata
|
||||
buildFileMetadata,
|
||||
getVideoFileMimeType
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue