From b1862c066470f7e374e733944bcefc79f5f1a279 Mon Sep 17 00:00:00 2001 From: BenShelton Date: Sat, 5 Jun 2021 17:54:12 +0100 Subject: [PATCH] feat(media): add more supported file extensions closes #45 --- packages/media/app/main/src/ipc.ts | 9 ++++++++- .../media/app/renderer/src/pages/Display.vue | 13 ++++++------- packages/media/app/shared/extensions.ts | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 packages/media/app/shared/extensions.ts diff --git a/packages/media/app/main/src/ipc.ts b/packages/media/app/main/src/ipc.ts index 97097a3..35dd4a6 100644 --- a/packages/media/app/main/src/ipc.ts +++ b/packages/media/app/main/src/ipc.ts @@ -14,6 +14,7 @@ import { } from '@library-api/core' import { MediaDetailsDTO } from '@library-api/core/types/dto' +import { imageExtensions, videoExtensions } from 'shared/extensions' import { initDirectories } from './directories' import { getControlWindow, getDisplayWindow } from './window' import { CATALOG_PATH, DOWNLOAD_DIR, VIDEO_DIR } from './constants' @@ -151,7 +152,13 @@ export function initIPC (): void { title: 'Choose the media you want to display', defaultPath: app.getPath('downloads'), filters: [ - { name: 'Media', extensions: ['jpg', 'png', 'gif', 'mp4', 'avi'] } + { + name: 'Media', + extensions: [ + ...imageExtensions, + ...videoExtensions + ] + } ] }) if (canceled || !filePaths.length) return false diff --git a/packages/media/app/renderer/src/pages/Display.vue b/packages/media/app/renderer/src/pages/Display.vue index 62e0978..1a33871 100644 --- a/packages/media/app/renderer/src/pages/Display.vue +++ b/packages/media/app/renderer/src/pages/Display.vue @@ -30,6 +30,8 @@