Allow filtering audio files with is:audio

For now only support FLAC, MP3, WAV and WMA
More extensions will come at a later date
This commit is contained in:
Bobby Wibowo 2020-11-03 22:51:29 +07:00
parent 628d4aab55
commit 9c7241d145
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
3 changed files with 7 additions and 4 deletions

View File

@ -894,7 +894,8 @@ self.list = async (req, res) => {
},
typeIs: [
'image',
'video'
'video',
'audio'
],
flags: {}
}

View File

@ -29,6 +29,7 @@ const self = {
imageExts: ['.gif', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff', '.webp'],
videoExts: ['.3g2', '.3gp', '.asf', '.avchd', '.avi', '.divx', '.evo', '.flv', '.h264', '.h265', '.hevc', '.m2p', '.m2ts', '.m4v', '.mk3d', '.mkv', '.mov', '.mp4', '.mpeg', '.mpg', '.mxf', '.ogg', '.ogv', '.ps', '.qt', '.rmvb', '.ts', '.vob', '.webm', '.wmv'],
audioExts: ['.flac', '.mp3', '.wav', '.wma'],
thumbsSize: config.uploads.generateThumbs.size || 200,
ffprobe: promisify(ffmpeg.ffprobe),

View File

@ -93,7 +93,7 @@ const page = {
imageExts: ['.gif', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff', '.webp'],
videoExts: ['.3g2', '.3gp', '.asf', '.avchd', '.avi', '.divx', '.evo', '.flv', '.h264', '.h265', '.hevc', '.m2p', '.m2ts', '.m4v', '.mk3d', '.mkv', '.mov', '.mp4', '.mpeg', '.mpg', '.mxf', '.ogg', '.ogv', '.ps', '.qt', '.rmvb', '.ts', '.vob', '.webm', '.wmv'],
audioExts: ['.flac', '.mp3', '.wma'],
audioExts: ['.flac', '.mp3', '.wav', '.wma'],
isSomethingLoading: false,
fadingIn: null,
@ -1148,8 +1148,9 @@ page.uploadFiltersHelp = element => {
This key can also be specified more than once, where their order will decide the sorting steps.
Finally, there are type-<b>is</b> keys to refine by types.
You can use <code>is:image</code> and <code>is:video</code> to list images and videos respectively.
This will only use image/video extensions whose thumbnails can be generated by the safe.
You can use <code>is:image</code>, <code>is:video</code>, and <code>is:audio</code> to list images, videos, audios respectively.
This will only use image, video and audio extensions that are whitelisted internally in the safe.
For images and videos specifically, they will be the ones whose thumbnails can be generated by the safe.
Negation sign works for this key as well.
Mixing inclusion and exclusion is not allowed (i.e. <code>is:image -is:video</code>, since the second key is redundant).