Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.
TypeScript albumsexif-extractiongeocodinglive-photomotion-photophoto-galleryphoto-sharingwebgl-viewer
fix: handle non-prefix storage case in photo editing
Timothy Yinb61556bfce14
diff --git a/server/api/photos/[photoId]/index.put.ts b/server/api/photos/[photoId]/index.put.tsindex f84b13a1..e9d41e02 100644--- a/server/api/photos/[photoId]/index.put.ts+++ b/server/api/photos/[photoId]/index.put.ts@@ -100,12 +100,10 @@ export default eventHandler(async (event) => {const normalizedDescription =payload.description !== undefined ? payload.description.trim() : undefinedconst normalizedTags = normalizeTags(payload.tags)- let pendingReverseGeocode:- | {- latitude: number- longitude: number- }- | null = null+ let pendingReverseGeocode: {+ latitude: number+ longitude: number+ } | null = nullconst exifUpdates: Record<string, any> = {}@@ -168,8 +166,12 @@ export default eventHandler(async (event) => {}const updatedBuffer = await readFile(tempFile)+ const prefix =+ storageProvider.config && 'prefix' in storageProvider.config+ ? storageProvider.config.prefix+ : ''await storageProvider.create(- photo.storageKey.replace(storageProvider.config?.prefix || '', ''),+ photo.storageKey.replace(prefix || '', ''),updatedBuffer,)