From 12f44d94ca54887acf33d4d829f8bfdc380990fb Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Wed, 3 May 2023 20:28:13 -0700 Subject: [PATCH] nx: full load for viewer Signed-off-by: Varun Patil --- src/components/viewer/Viewer.vue | 7 ++++++- src/native.ts | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/viewer/Viewer.vue b/src/components/viewer/Viewer.vue index fc01eb17..4b39057b 100644 --- a/src/components/viewer/Viewer.vue +++ b/src/components/viewer/Viewer.vue @@ -168,6 +168,7 @@ import { getDownloadLink } from '../../services/DavRequests'; import { API } from '../../services/API'; import * as dav from '../../services/DavRequests'; import * as utils from '../../services/Utils'; +import * as nativex from '../../native'; import ImageEditor from './ImageEditor.vue'; import PhotoSwipe, { PhotoSwipeOptions } from 'photoswipe'; @@ -769,7 +770,11 @@ export default defineComponent({ } // Get full image URL - const fullUrl = isvideo ? null : API.IMAGE_DECODABLE(photo.fileid, photo.etag); + const fullUrl = isvideo + ? null + : photo.flag & this.c.FLAG_IS_LOCAL + ? nativex.NATIVE_URL_FULL(photo.fileid) + : API.IMAGE_DECODABLE(photo.fileid, photo.etag); const fullLoadCond = this.config.full_res_always ? 'always' : this.config.full_res_on_zoom ? 'zoom' : 'never'; return { diff --git a/src/native.ts b/src/native.ts index 32a77b76..ea30a918 100644 --- a/src/native.ts +++ b/src/native.ts @@ -142,3 +142,13 @@ export function IS_NATIVE_URL(url: string) { export function NATIVE_URL_PREVIEW(fileid: number) { return `nativex://preview/${fileid}`; } + +/** + * Get a full sized URL for a native file ID. + * + * @param fileid Local file ID returned by native interface + * @returns native URI + */ +export function NATIVE_URL_FULL(fileid: number) { + return `nativex://full/${fileid}`; +}