nx: full load for viewer

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/653/head
Varun Patil 2023-05-03 20:28:13 -07:00
parent 839de2e646
commit 12f44d94ca
2 changed files with 16 additions and 1 deletions

View File

@ -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 {

View File

@ -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}`;
}