diff --git a/src/components/Viewer.vue b/src/components/Viewer.vue index 3fc74652..0020a343 100644 --- a/src/components/Viewer.vue +++ b/src/components/Viewer.vue @@ -136,7 +136,6 @@ import { IDay, IPhoto, IRow, IRowType } from "../types"; import NcActions from "@nextcloud/vue/dist/Components/NcActions"; import NcActionButton from "@nextcloud/vue/dist/Components/NcActionButton"; import { subscribe, unsubscribe } from "@nextcloud/event-bus"; -import { generateUrl } from "@nextcloud/router"; import { showError } from "@nextcloud/dialogs"; import * as dav from "../services/DavRequests"; @@ -658,10 +657,8 @@ export default class Viewer extends Mixins(GlobalMixin) { const isvideo = photo.flag & this.c.FLAG_IS_VIDEO; // Preview aren't animated - if (photo.mimetype === "image/gif") { + if (isvideo || photo.mimetype === "image/gif") { previewUrl = getDownloadLink(photo); - } else if (isvideo) { - previewUrl = generateUrl(getDownloadLink(photo)); } // Get height and width diff --git a/src/services/dav/download.ts b/src/services/dav/download.ts index 4684a371..3c47c1e2 100644 --- a/src/services/dav/download.ts +++ b/src/services/dav/download.ts @@ -98,9 +98,9 @@ export function getDownloadLink(photo: IPhoto) { route.params.name ); if (fInfos.length) { - return `/remote.php/dav${fInfos[0].originalFilename}`; + return generateUrl(`/remote.php/dav${fInfos[0].originalFilename}`); } } - return `/remote.php/dav${photo.filename}`; + return generateUrl(`/remote.php/dav${photo.filename}`); }