forked from FoundKeyGang/FoundKey
client: improved module tracker file detection
Reviewed-on: FoundKeyGang/FoundKey#344 Changelog: Fixed
This commit is contained in:
commit
3acf127e1d
2 changed files with 13 additions and 2 deletions
|
@ -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);
|
||||
});
|
||||
};
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue