|
|
|
@ -97,6 +97,7 @@ |
|
|
|
|
import { FileType, formatFileSize } from '@nextcloud/files' |
|
|
|
|
import { useHotKey } from '@nextcloud/vue/composables/useHotKey' |
|
|
|
|
import { defineComponent } from 'vue' |
|
|
|
|
import { t } from '@nextcloud/l10n' |
|
|
|
|
import NcDateTime from '@nextcloud/vue/components/NcDateTime' |
|
|
|
|
|
|
|
|
|
import { useNavigation } from '../composables/useNavigation.ts' |
|
|
|
@ -208,6 +209,25 @@ export default defineComponent({ |
|
|
|
|
return t('files', 'Unknown file type') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (window.OC?.MimeTypeList?.names?.[this.source.mime]) { |
|
|
|
|
return window.OC.MimeTypeList.names[this.source.mime] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const baseType = this.source.mime.split('/')[0] |
|
|
|
|
const ext = this.source?.extension?.toUpperCase().replace(/^\./, '') || '' |
|
|
|
|
if (baseType === 'image') { |
|
|
|
|
return t('files', '{ext} image', { ext }) |
|
|
|
|
} |
|
|
|
|
if (baseType === 'video') { |
|
|
|
|
return t('files', '{ext} video', { ext }) |
|
|
|
|
} |
|
|
|
|
if (baseType === 'audio') { |
|
|
|
|
return t('files', '{ext} audio', { ext }) |
|
|
|
|
} |
|
|
|
|
if (baseType === 'text') { |
|
|
|
|
return t('files', '{ext} text', { ext }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return this.source.mime |
|
|
|
|
}, |
|
|
|
|
size() { |
|
|
|
|