diff --git a/lib/Controller/VideoController.php b/lib/Controller/VideoController.php index 3bbeea50..ab7889ad 100644 --- a/lib/Controller/VideoController.php +++ b/lib/Controller/VideoController.php @@ -171,8 +171,12 @@ class VideoController extends GenericApiController // Requested only JSON info if ('json' === $format) { + // IPhoto object for the live video return new JSONResponse([ 'fileid' => $liveFile->getId(), + 'etag' => $liveFile->getEtag(), + 'basename' => $liveFile->getName(), + 'mimetype' => $liveFile->getMimeType(), ]); } diff --git a/src/components/Metadata.vue b/src/components/Metadata.vue index f3de2880..ad80b235 100644 --- a/src/components/Metadata.vue +++ b/src/components/Metadata.vue @@ -91,7 +91,7 @@ import * as utils from '../services/utils'; import * as dav from '../services/dav'; import { API } from '../services/API'; -import type { IAlbum, IFace, IImageInfo, IPhoto } from '../types'; +import type { IAlbum, IFace, IImageInfo, IPhoto, IExif } from '../types'; interface TopField { id?: string; @@ -117,7 +117,7 @@ export default defineComponent({ data: () => ({ fileid: null as number | null, filename: '', - exif: {} as NonNullable, + exif: {} as IExif, baseInfo: {} as IImageInfo, loading: 0, @@ -198,12 +198,12 @@ export default defineComponent({ /** Title EXIF value */ title(): string | null { - return this.exif['Title'] || null; + return this.exif.Title || null; }, /** Description EXIF value */ description(): string | null { - return this.exif['Description'] || null; + return this.exif.Description || null; }, /** Date taken info */ @@ -252,7 +252,7 @@ export default defineComponent({ dateOriginalTime(): string[] | null { if (!this.dateOriginal) return null; - const fields = ['OffsetTimeOriginal', 'OffsetTime', 'LocationTZID']; + const fields: (keyof IExif)[] = ['OffsetTimeOriginal', 'OffsetTime', 'LocationTZID']; const hasTz = fields.some((key) => this.exif[key]); const format = 't' + (hasTz ? ' ZZ' : ''); @@ -262,18 +262,18 @@ export default defineComponent({ /** Camera make and model info */ camera(): string | null { - const make = this.exif['Make']; - const model = this.exif['Model']; + const make = this.exif.Make; + const model = this.exif.Model; if (!make || !model) return null; if (model.startsWith(make)) return model; return `${make} ${model}`; }, cameraSub(): string[] { - const f = this.exif['FNumber'] || this.exif['Aperture']; + const f = this.exif.FNumber || this.exif.Aperture; const s = this.shutterSpeed; - const len = this.exif['FocalLength']; - const iso = this.exif['ISO']; + const len = this.exif.FocalLength; + const iso = this.exif.ISO; const parts: string[] = []; if (f) parts.push(`f/${f}`); @@ -285,7 +285,7 @@ export default defineComponent({ /** Convert shutter speed decimal to 1/x format */ shutterSpeed(): string | null { - const speed = Number(this.exif['ShutterSpeedValue'] || this.exif['ShutterSpeed'] || this.exif['ExposureTime']); + const speed = Number(this.exif.ShutterSpeedValue || this.exif.ShutterSpeed || this.exif.ExposureTime); if (!speed) return null; if (speed < 1) { @@ -311,7 +311,7 @@ export default defineComponent({ imageInfoSub(): string[] { let parts: string[] = []; - let mp = Number(this.exif['Megapixels']); + let mp = Number(this.exif.Megapixels); if (this.baseInfo.w && this.baseInfo.h) { parts.push(`${this.baseInfo.w}x${this.baseInfo.h}`); @@ -341,11 +341,11 @@ export default defineComponent({ }, lat(): number { - return Number(this.exif['GPSLatitude']); + return Number(this.exif.GPSLatitude); }, lon(): number { - return Number(this.exif['GPSLongitude']); + return Number(this.exif.GPSLongitude); }, tagNames(): string[] { @@ -452,7 +452,7 @@ export default defineComponent({ } }, - handleFileUpdated({ fileid }: { fileid: number }) { + handleFileUpdated({ fileid }: utils.BusEvent['files:file:updated']) { if (fileid && this.fileid === fileid) { this.refresh(); } diff --git a/src/components/MobileHeader.vue b/src/components/MobileHeader.vue index ef2199d6..a33ce673 100644 --- a/src/components/MobileHeader.vue +++ b/src/components/MobileHeader.vue @@ -44,7 +44,7 @@ export default defineComponent({ }, methods: { - onScroll({ current, previous }: { current: number; previous: number }) { + onScroll({ current, previous }: utils.BusEvent['memories.recycler.scroll']) { this.isScrollDown = (this.isScrollDown && previous - current < 40) || current - previous > 40; // momentum scroll }, }, diff --git a/src/components/ScrollerManager.vue b/src/components/ScrollerManager.vue index 8a192ba1..33b60674 100644 --- a/src/components/ScrollerManager.vue +++ b/src/components/ScrollerManager.vue @@ -476,7 +476,7 @@ export default defineComponent({ }, /** Handle mouse leave */ - mouseleave() { + mouseleave(event: MouseEvent) { this.interactend(); this.moveHoverCursor(this.cursorY); }, @@ -539,7 +539,7 @@ export default defineComponent({ }, /** Handle touch */ - touchmove(event: any) { + touchmove(event: TouchEvent) { if (!this.scrollerRect) return; let y = event.targetTouches[0].pageY - this.scrollerRect.top; y = Math.max(this.topPadding, y + MOBILE_CURSOR_HH); // middle of touch finger diff --git a/src/components/frame/XImgWorker.ts b/src/components/frame/XImgWorker.ts index 5d9429eb..ed2db2d8 100644 --- a/src/components/frame/XImgWorker.ts +++ b/src/components/frame/XImgWorker.ts @@ -21,7 +21,7 @@ const pendingUrls = new Map(); // Cache for preview images const cacheName = 'memories-images'; -let imageCache: Cache; +let imageCache: Cache | undefined; (async function openCache() { try { imageCache = await self.caches?.open(cacheName); diff --git a/src/components/modal/AlbumsList.vue b/src/components/modal/AlbumsList.vue index 7d2cf8b8..0140c8e1 100644 --- a/src/components/modal/AlbumsList.vue +++ b/src/components/modal/AlbumsList.vue @@ -11,7 +11,7 @@ @click="click($event, album)" >