client: improved module tracker file detection
All checks were successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful

Reviewed-on: #344
Changelog: Fixed
This commit is contained in:
Johann150 2023-02-19 15:03:44 +01:00
commit 3acf127e1d
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1
2 changed files with 13 additions and 2 deletions

View file

@ -23,7 +23,7 @@ import XBanner from './media-banner.vue';
import XImage from './media-image.vue';
import XVideo from './media-video.vue';
import XModPlayer from './mod-player.vue';
import { FILE_TYPE_BROWSERSAFE, FILE_EXT_TRACKER_MODULES } from '@/const';
import { FILE_TYPE_BROWSERSAFE, FILE_TYPE_TRACKER_MODULES, FILE_EXT_TRACKER_MODULES } from '@/const';
const props = defineProps<{
mediaList: foundkey.entities.DriveFile[];
@ -130,7 +130,7 @@ const previewable = (file: foundkey.entities.DriveFile): boolean => {
};
const isModule = (file: foundkey.entities.DriveFile): boolean => {
return FILE_EXT_TRACKER_MODULES.some((ext) => {
return FILE_TYPE_TRACKER_MODULES.includes(file.type) || FILE_EXT_TRACKER_MODULES.some((ext) => {
return file.name.toLowerCase().endsWith("." + ext);
});
};

View file

@ -47,6 +47,17 @@ export const FILE_TYPE_BROWSERSAFE = [
'audio/vnd.wave',
];
export const FILE_TYPE_TRACKER_MODULES = [
"audio/mod",
"audio/x-mod",
"audio/s3m",
"audio/x-s3m",
"audio/xm",
"audio/x-xm",
"audio/it",
"audio/x-it"
];
export const FILE_EXT_TRACKER_MODULES = [
'mod',
's3m',