From 8b37c3315465deef4ae2fea9ba5ba2724a4cb292 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 22 May 2023 21:57:53 -0700 Subject: [PATCH] admin: add preview types Signed-off-by: Varun Patil --- docs/file-types.md | 4 - lib/SystemConfigDefault.php | 4 + src/components/admin/AdminMain.vue | 3 +- src/components/admin/AdminTypes.ts | 2 + src/components/admin/sections/FileSupport.vue | 81 +++++++++++++++++++ src/components/admin/sections/Indexing.vue | 11 --- 6 files changed, 89 insertions(+), 16 deletions(-) create mode 100644 src/components/admin/sections/FileSupport.vue diff --git a/docs/file-types.md b/docs/file-types.md index 889b1c98..65cda445 100644 --- a/docs/file-types.md +++ b/docs/file-types.md @@ -11,7 +11,6 @@ Memories supports the file types supported by the Nextcloud previews app. If you ``` PNG (image/png) JPEG (image/jpeg) -PNG (image/png) GIF (image/gif) BMP (image/bmp) ``` @@ -47,9 +46,6 @@ You need to install `ffmpeg` and add the video config to `config.php` 'enabledPreviewProviders' => array ( 'OC\\Preview\\Movie', - 'OC\\Preview\\MKV', - 'OC\\Preview\\MP4', - 'OC\\Preview\\AVI', ), ``` diff --git a/lib/SystemConfigDefault.php b/lib/SystemConfigDefault.php index 064de35a..311d14e6 100644 --- a/lib/SystemConfigDefault.php +++ b/lib/SystemConfigDefault.php @@ -61,4 +61,8 @@ return [ // -2 => Direct (disable transcoding) // 1080 => 1080p (and so on) 'memories.video_default_quality' => '0', + + // Preview providers for Nextcloud + // Memories only provides an admin interface for these + 'enabledPreviewProviders' => [], ]; diff --git a/src/components/admin/AdminMain.vue b/src/components/admin/AdminMain.vue index 2d29eaa0..e697eb85 100644 --- a/src/components/admin/AdminMain.vue +++ b/src/components/admin/AdminMain.vue @@ -17,6 +17,7 @@ import * as utils from '../../services/Utils'; import Exif from './sections/Exif.vue'; import Indexing from './sections/Indexing.vue'; +import FileSupport from './sections/FileSupport.vue'; import Performance from './sections/Performance.vue'; import Places from './sections/Places.vue'; import Video from './sections/Video.vue'; @@ -35,7 +36,7 @@ export default defineComponent({ status: null as ISystemStatus | null, config: null as ISystemConfig | null, - components: [Exif, Indexing, Performance, Places, Video, VideoTranscoder, VideoAccel], + components: [Exif, Indexing, FileSupport, Performance, Places, Video, VideoTranscoder, VideoAccel], }), mounted() { diff --git a/src/components/admin/AdminTypes.ts b/src/components/admin/AdminTypes.ts index a2ea7eca..941f7496 100644 --- a/src/components/admin/AdminTypes.ts +++ b/src/components/admin/AdminTypes.ts @@ -22,6 +22,8 @@ export type ISystemConfig = { 'memories.vod.nvenc': boolean; 'memories.vod.nvenc.temporal_aq': boolean; 'memories.vod.nvenc.scale': string; + + enabledPreviewProviders: string[]; }; export type IBinaryStatus = 'ok' | 'not_found' | 'not_executable' | 'test_ok' | string; diff --git a/src/components/admin/sections/FileSupport.vue b/src/components/admin/sections/FileSupport.vue new file mode 100644 index 00000000..537993bd --- /dev/null +++ b/src/components/admin/sections/FileSupport.vue @@ -0,0 +1,81 @@ + + + diff --git a/src/components/admin/sections/Indexing.vue b/src/components/admin/sections/Indexing.vue index a3a99ce3..56a7c4f0 100644 --- a/src/components/admin/sections/Indexing.vue +++ b/src/components/admin/sections/Indexing.vue @@ -110,17 +110,6 @@ {{ t('memories', 'Clear all existing index tables:') }}
occ memories:index --clear -
- -
- {{ t('memories', 'The following MIME types are configured for preview generation correctly. More documentation:') }} - - {{ t('memories', 'External Link') }} - -
-