diff --git a/packages/client/src/components/media-list.vue b/packages/client/src/components/media-list.vue index 8d82080e3..c2643b23e 100644 --- a/packages/client/src/components/media-list.vue +++ b/packages/client/src/components/media-list.vue @@ -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,9 @@ 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.some((type) => { + return file.type === type; + }) || FILE_EXT_TRACKER_MODULES.some((ext) => { return file.name.toLowerCase().endsWith("." + ext); }); }; diff --git a/packages/client/src/const.ts b/packages/client/src/const.ts index 16744c64b..1318ee26d 100644 --- a/packages/client/src/const.ts +++ b/packages/client/src/const.ts @@ -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',