From ba4c055fea8cb65492b2c2ee0ddc9f673c26ef30 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 14 Oct 2023 12:56:31 -0700 Subject: [PATCH 1/2] psalm: use separate langserver config Signed-off-by: Varun Patil --- .vscode/settings.json | 3 +++ psalm-ls.xml | 40 ++++++++++++++++++++++++++++++++++++++++ psalm.xml | 17 ++++------------- 3 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 psalm-ls.xml diff --git a/.vscode/settings.json b/.vscode/settings.json index 267fa74a4..7abca2a55 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -98,4 +98,7 @@ }, "git.alwaysSignOff": true, "editor.formatOnSave": true, + "psalm.configPaths": [ + "psalm-ls.xml" + ], } \ No newline at end of file diff --git a/psalm-ls.xml b/psalm-ls.xml new file mode 100644 index 000000000..eb9f6a8be --- /dev/null +++ b/psalm-ls.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/psalm.xml b/psalm.xml index a2895d81a..5cd61c324 100644 --- a/psalm.xml +++ b/psalm.xml @@ -8,23 +8,14 @@ xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" cacheDirectory=".cache/psalm" > + - - - - - - - - + + + From 1bc5f58f910a2ee2ae52c6cf8ca55721628b39eb Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 14 Oct 2023 13:06:36 -0700 Subject: [PATCH 2/2] chore: update prettier Signed-off-by: Varun Patil --- .github/workflows/static-analysis.yaml | 2 +- package-lock.json | 48 ++++++++++++++----- package.json | 1 + src/App.vue | 2 +- src/components/ScrollerManager.vue | 4 +- src/components/SelectionManager.vue | 4 +- src/components/Settings.vue | 2 +- src/components/Sidebar.vue | 2 +- src/components/SplitTimeline.vue | 8 +++- src/components/Timeline.vue | 7 ++- src/components/admin/AdminMixin.ts | 4 +- src/components/admin/sections/Indexing.vue | 6 +-- src/components/admin/sections/Performance.vue | 2 +- src/components/admin/sections/Places.vue | 6 +-- src/components/admin/sections/Video.vue | 2 +- src/components/admin/sections/VideoAccel.vue | 6 +-- .../admin/sections/VideoTranscoder.vue | 2 +- src/components/frame/Photo.vue | 13 +++-- src/components/modal/AlbumCollaborators.vue | 2 +- src/components/modal/AlbumDeleteModal.vue | 2 +- src/components/modal/EditDate.vue | 2 +- src/components/modal/EditMetadataModal.vue | 8 ++-- src/components/modal/EditTags.vue | 2 +- src/components/modal/FaceDeleteModal.vue | 4 +- src/components/modal/FaceEditModal.vue | 4 +- src/components/modal/FaceMergeModal.vue | 4 +- src/components/modal/FaceMoveModal.vue | 2 +- src/components/modal/MoveToFolderModal.vue | 2 +- src/components/top-matter/AlbumTopMatter.vue | 2 +- src/components/viewer/ImageEditor.vue | 2 +- .../viewer/ImageEditorTranslations.ts | 2 +- src/components/viewer/PsLivePhoto.ts | 5 +- src/components/viewer/PsVideo.ts | 4 +- src/native/Setup.vue | 8 ++-- src/native/days.ts | 2 +- src/service-worker.js | 6 +-- src/services/API.ts | 2 +- src/services/dav/albums.ts | 10 ++-- src/services/dav/base.ts | 12 ++--- src/services/dav/face.ts | 4 +- src/services/dav/favorites.ts | 2 +- src/services/dav/tags.ts | 2 +- src/services/layout.ts | 2 +- src/services/static-config.ts | 2 +- src/services/utils/date.ts | 2 +- src/services/utils/dialog.ts | 4 +- src/services/utils/helpers.ts | 2 +- src/styles/livephoto.scss | 9 +++- 48 files changed, 141 insertions(+), 96 deletions(-) diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index 6dcaf5e80..ded00151b 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -53,7 +53,7 @@ jobs: uses: actions/checkout@v3 - name: Install Pretter - run: npm install -g prettier + run: npm install --no-save "prettier@$(cat ./package.json | jq -r '.devDependencies["prettier"]')" - name: Run Prettier run: npx prettier src --check diff --git a/package-lock.json b/package-lock.json index 8feadd67a..1f6cb5482 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,6 +43,7 @@ "@types/url-parse": "^1.4.9", "@types/videojs-contrib-quality-levels": "^2.0.2", "playwright": "^1.39.0", + "prettier": "^3.0.3", "typescript": "^5.2.2", "workbox-webpack-plugin": "^7.0.0" }, @@ -2880,6 +2881,23 @@ "url": "https://opencollective.com/postcss/" } }, + "node_modules/@vue/component-compiler-utils/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/@vueuse/components": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/@vueuse/components/-/components-10.1.2.tgz", @@ -8430,17 +8448,15 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true, - "optional": true, - "peer": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -14012,6 +14028,14 @@ "picocolors": "^0.2.1", "source-map": "^0.6.1" } + }, + "prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "optional": true, + "peer": true } } }, @@ -18093,12 +18117,10 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", - "dev": true, - "optional": true, - "peer": true + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "dev": true }, "pretty-bytes": { "version": "5.6.0", diff --git a/package.json b/package.json index 5d620cace..b852fe880 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "@types/url-parse": "^1.4.9", "@types/videojs-contrib-quality-levels": "^2.0.2", "playwright": "^1.39.0", + "prettier": "^3.0.3", "typescript": "^5.2.2", "workbox-webpack-plugin": "^7.0.0" } diff --git a/src/App.vue b/src/App.vue index 3dce2235c..dddc0607b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -294,7 +294,7 @@ export default defineComponent({ this.metadataComponent?.$destroy?.(); this.metadataComponent = null; }, - }) + }), ); // Check for native interface diff --git a/src/components/ScrollerManager.vue b/src/components/ScrollerManager.vue index 83028906b..6162986e9 100644 --- a/src/components/ScrollerManager.vue +++ b/src/components/ScrollerManager.vue @@ -604,7 +604,9 @@ export default defineComponent({ z-index: 100; // below top-matter and top-bar cursor: ns-resize; opacity: 0; - transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out; + transition: + opacity 0.2s ease-in-out, + visibility 0.2s ease-in-out; // Show on hover or scroll of main window &:hover, diff --git a/src/components/SelectionManager.vue b/src/components/SelectionManager.vue index 017a15ff0..0375e596d 100644 --- a/src/components/SelectionManager.vue +++ b/src/components/SelectionManager.vue @@ -462,7 +462,7 @@ export default defineComponent({ } else { this.touchScrollDelta = Math.min( (touch.clientY - _m.window.innerHeight + TOUCH_SELECT_CLAMP.bottom) / 3, - TOUCH_SELECT_CLAMP.maxDelta + TOUCH_SELECT_CLAMP.maxDelta, ); } @@ -501,7 +501,7 @@ export default defineComponent({ const recyclerRect = this.recycler?.getBoundingClientRect(); const clampedY = Math.max( (recyclerRect?.top ?? 0) + TOUCH_SELECT_CLAMP.bufferPx, - Math.min((recyclerRect?.bottom ?? 0) - TOUCH_SELECT_CLAMP.bufferPx, touch.clientY) + Math.min((recyclerRect?.bottom ?? 0) - TOUCH_SELECT_CLAMP.bufferPx, touch.clientY), ); // Which photo is the cursor over, if any diff --git a/src/components/Settings.vue b/src/components/Settings.vue index 444063c5e..3ac58806a 100644 --- a/src/components/Settings.vue +++ b/src/components/Settings.vue @@ -245,7 +245,7 @@ export default defineComponent({ async chooseFoldersPath() { const newPath = await utils.chooseNcFolder( this.t('memories', 'Choose the root for the folders view'), - this.config.folders_path + this.config.folders_path, ); if (newPath !== this.config.folders_path) { diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 4c795cb88..f06ddd308 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -68,7 +68,7 @@ export default defineComponent({ }, }, }, - globalThis.OCA.Files + globalThis.OCA.Files, ); } }, diff --git a/src/components/SplitTimeline.vue b/src/components/SplitTimeline.vue index d3896d406..5d84a5828 100644 --- a/src/components/SplitTimeline.vue +++ b/src/components/SplitTimeline.vue @@ -233,7 +233,9 @@ export default defineComponent({ opacity: 0.1; cursor: col-resize; margin: 0 0 0 auto; - transition: opacity 0.4s ease-out, background-color 0.4s ease-out; + transition: + opacity 0.4s ease-out, + background-color 0.4s ease-out; } > .separator:hover { @@ -273,7 +275,9 @@ export default defineComponent({ // Note: you can't use transforms to animate the top // because it causes the viewer to be rendered incorrectly - transition: top 0.2s ease, height 0.2s ease; + transition: + top 0.2s ease, + height 0.2s ease; > .timeline-header { height: 58px; diff --git a/src/components/Timeline.vue b/src/components/Timeline.vue index e54f60f2b..3ad58ce3e 100644 --- a/src/components/Timeline.vue +++ b/src/components/Timeline.vue @@ -1069,7 +1069,7 @@ export default defineComponent({ numCols: this.numCols, allowBreakout: this.allowBreakout(), seed: dayId, - } + }, ); // Check if some rows were added @@ -1359,7 +1359,10 @@ export default defineComponent({ left: 0; cursor: pointer; height: 100%; - transition: width 0.2s ease-in-out, height 0.2s ease-in-out, transform 0.2s ease-in-out; // reflow + transition: + width 0.2s ease-in-out, + height 0.2s ease-in-out, + transform 0.2s ease-in-out; // reflow } /** Dynamic top matter */ diff --git a/src/components/admin/AdminMixin.ts b/src/components/admin/AdminMixin.ts index e02aacca3..f4c03f629 100644 --- a/src/components/admin/AdminMixin.ts +++ b/src/components/admin/AdminMixin.ts @@ -62,7 +62,7 @@ export default defineComponent({ info: status.substring(10), }, 0, - noescape + noescape, ); } else if (status.startsWith('test_ok')) { return this.t( @@ -73,7 +73,7 @@ export default defineComponent({ info: status.substring(8), }, 0, - noescape + noescape, ); } else { return this.t('memories', '{name} binary status: {status}.', { diff --git a/src/components/admin/sections/Indexing.vue b/src/components/admin/sections/Indexing.vue index fd4be65f5..35f06ec7c 100644 --- a/src/components/admin/sections/Indexing.vue +++ b/src/components/admin/sections/Indexing.vue @@ -35,7 +35,7 @@ {{ t( 'memories', - 'Looks like it has been more than an hour since the last index job was run. Make sure Nextcloud cron is configured correctly.' + 'Looks like it has been more than an hour since the last index job was run. Make sure Nextcloud cron is configured correctly.', ) }} @@ -43,7 +43,7 @@ {{ t( 'memories', - 'Only server-side encryption (OC_DEFAULT_MODULE) is supported, but another encryption module is enabled.' + 'Only server-side encryption (OC_DEFAULT_MODULE) is supported, but another encryption module is enabled.', ) }} @@ -53,7 +53,7 @@ {{ t( 'memories', - 'The EXIF indexes are built and checked in a periodic background task. Be careful when selecting anything other than automatic indexing. For example, setting the indexing to only timeline folders may cause delays before media becomes available to users, since the user configures the timeline only after logging in.' + 'The EXIF indexes are built and checked in a periodic background task. Be careful when selecting anything other than automatic indexing. For example, setting the indexing to only timeline folders may cause delays before media becomes available to users, since the user configures the timeline only after logging in.', ) }} {{ t('memories', 'Folders with a ".nomedia" or a ".nomemories" file are always excluded from indexing.') }} diff --git a/src/components/admin/sections/Performance.vue b/src/components/admin/sections/Performance.vue index 834271179..b861b9cff 100644 --- a/src/components/admin/sections/Performance.vue +++ b/src/components/admin/sections/Performance.vue @@ -9,7 +9,7 @@ ? t('memories', 'HTTPS is enabled') : t( 'memories', - 'You are accessing this page over an insecure context. Several browser APIs are not available, which will make Memories very slow. Enable HTTPS on your server to improve performance.' + 'You are accessing this page over an insecure context. Several browser APIs are not available, which will make Memories very slow. Enable HTTPS on your server to improve performance.', ) }} diff --git a/src/components/admin/sections/Places.vue b/src/components/admin/sections/Places.vue index ae3d244db..476d9bf0c 100644 --- a/src/components/admin/sections/Places.vue +++ b/src/components/admin/sections/Places.vue @@ -39,14 +39,14 @@ {{ t( 'memories', - 'Memories supports offline reverse geocoding using the OpenStreetMaps data on MySQL and Postgres.' + 'Memories supports offline reverse geocoding using the OpenStreetMaps data on MySQL and Postgres.', ) }}
{{ t( 'memories', - 'You need to download the planet data into your database. This is highly recommended and has low overhead.' + 'You need to download the planet data into your database. This is highly recommended and has low overhead.', ) }}
@@ -116,7 +116,7 @@ export default defineComponent({ // construct warning const warnSetup = this.t( 'memories', - 'Looks like the database is already setup. Are you sure you want to redownload planet data?' + 'Looks like the database is already setup. Are you sure you want to redownload planet data?', ); const warnLong = this.t('memories', 'You are about to download the planet database. This may take a while.'); const warnReindex = this.t('memories', 'This may also cause all photos to be re-indexed!'); diff --git a/src/components/admin/sections/Video.vue b/src/components/admin/sections/Video.vue index 1649d71d8..45a825826 100644 --- a/src/components/admin/sections/Video.vue +++ b/src/components/admin/sections/Video.vue @@ -8,7 +8,7 @@ {{ t( 'memories', - 'Note that this may be very CPU intensive without hardware acceleration, and transcoding will not be used for external storage.' + 'Note that this may be very CPU intensive without hardware acceleration, and transcoding will not be used for external storage.', ) }} diff --git a/src/components/admin/sections/VideoAccel.vue b/src/components/admin/sections/VideoAccel.vue index f5e6c7132..a132b7ab9 100644 --- a/src/components/admin/sections/VideoAccel.vue +++ b/src/components/admin/sections/VideoAccel.vue @@ -15,7 +15,7 @@ {{ t( 'memories', - 'Intel processors supporting QuickSync Video (QSV) as well as some AMD GPUs can be used for transcoding using VA-API acceleration.' + 'Intel processors supporting QuickSync Video (QSV) as well as some AMD GPUs can be used for transcoding using VA-API acceleration.', ) }} {{ t('memories', 'For more details on driver installation, check the documentation:') }} @@ -52,7 +52,7 @@ {{ t( 'memories', - 'Depending on the versions of the installed SDK and ffmpeg, you need to specify the scaler to use' + 'Depending on the versions of the installed SDK and ffmpeg, you need to specify the scaler to use', ) }} @@ -102,7 +102,7 @@ {{ t( 'memories', - 'Due to a bug in certain hardware drivers, videos may appear in incorrect orientations when streaming. This can be resolved in some cases by rotating the video on the accelerator.' + 'Due to a bug in certain hardware drivers, videos may appear in incorrect orientations when streaming. This can be resolved in some cases by rotating the video on the accelerator.', ) }}
diff --git a/src/components/admin/sections/VideoTranscoder.vue b/src/components/admin/sections/VideoTranscoder.vue index 19ebfc98a..f52d80ab2 100644 --- a/src/components/admin/sections/VideoTranscoder.vue +++ b/src/components/admin/sections/VideoTranscoder.vue @@ -5,7 +5,7 @@ {{ t( 'memories', - 'Memories uses the go-vod transcoder. You can run go-vod exernally (e.g. in a separate Docker container for hardware acceleration) or use the built-in transcoder. To use an external transcoder, enable the following option and follow the instructions in the documentation:' + 'Memories uses the go-vod transcoder. You can run go-vod exernally (e.g. in a separate Docker container for hardware acceleration) or use the built-in transcoder. To use an external transcoder, enable the following option and follow the instructions in the documentation:', ) }} diff --git a/src/components/frame/Photo.vue b/src/components/frame/Photo.vue index 0fe97a9d5..e08759714 100644 --- a/src/components/frame/Photo.vue +++ b/src/components/frame/Photo.vue @@ -207,7 +207,7 @@ export default defineComponent({ this.data.facerect.x * img.naturalWidth, this.data.facerect.y * img.naturalHeight, this.data.facerect.w * img.naturalWidth, - this.data.facerect.h * img.naturalHeight + this.data.facerect.h * img.naturalHeight, ); canvas.toBlob( @@ -216,7 +216,7 @@ export default defineComponent({ this.faceSrc = URL.createObjectURL(blob); }, 'image/jpeg', - 0.95 + 0.95, ); }, @@ -263,7 +263,10 @@ export default defineComponent({ padding: 1px; } - transition: background-color 0.15s ease, opacity 0.2s ease-in, transform 0.2s ease-in; + transition: + background-color 0.15s ease, + opacity 0.2s ease-in, + transform 0.2s ease-in; &.leaving { transform: scale(0.9); @@ -390,7 +393,9 @@ div.img-outer { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; pointer-events: none; - transition: border-radius 0.1s ease-in, transform 0.3s ease-in-out; + transition: + border-radius 0.1s ease-in, + transform 0.3s ease-in-out; .p-outer.placeholder > & { display: none; diff --git a/src/components/modal/AlbumCollaborators.vue b/src/components/modal/AlbumCollaborators.vue index b16a07614..8459dad3b 100644 --- a/src/components/modal/AlbumCollaborators.vue +++ b/src/components/modal/AlbumCollaborators.vue @@ -215,7 +215,7 @@ export default defineComponent({ listableSelectedCollaboratorsKeys(): string[] { return this.selectedCollaboratorsKeys.filter( - (collaboratorKey) => this.availableCollaborators[collaboratorKey].type !== Type.SHARE_TYPE_LINK + (collaboratorKey) => this.availableCollaborators[collaboratorKey].type !== Type.SHARE_TYPE_LINK, ); }, diff --git a/src/components/modal/AlbumDeleteModal.vue b/src/components/modal/AlbumDeleteModal.vue index 22fa396a9..e5bf0aa03 100644 --- a/src/components/modal/AlbumDeleteModal.vue +++ b/src/components/modal/AlbumDeleteModal.vue @@ -87,7 +87,7 @@ export default defineComponent({ showError( this.t('photos', 'Failed to delete {name}.', { name: this.name, - }) + }), ); } }, diff --git a/src/components/modal/EditDate.vue b/src/components/modal/EditDate.vue index 728b92e4f..1c8ee79e9 100644 --- a/src/components/modal/EditDate.vue +++ b/src/components/modal/EditDate.vue @@ -178,7 +178,7 @@ export default defineComponent({ this.dayLast, this.hourLast, this.minuteLast, - this.secondLast + this.secondLast, ); }, diff --git a/src/components/modal/EditMetadataModal.vue b/src/components/modal/EditMetadataModal.vue index 01b224718..763479ea9 100644 --- a/src/components/modal/EditMetadataModal.vue +++ b/src/components/modal/EditMetadataModal.vue @@ -202,13 +202,13 @@ export default defineComponent({ (p) => !p.imageInfo?.exif?.DateTimeOriginal && !p.imageInfo?.exif?.CreateDate && - !exifs.get(p.fileid)!.DateTimeOriginal + !exifs.get(p.fileid)!.DateTimeOriginal, ) && (await utils.confirmDestructive({ title: this.t('memories', 'Missing date metadata'), message: this.t( 'memories', - 'Some items may be missing the date metadata. Do you want to attempt copying the currently known timestamp to the metadata (recommended)? Othewise, the timestamp may be reset to the current time.' + 'Some items may be missing the date metadata. Do you want to attempt copying the currently known timestamp to the metadata (recommended)? Othewise, the timestamp may be reset to the current time.', ), })) ) { @@ -280,7 +280,7 @@ export default defineComponent({ showError( this.t('memories', 'Failed to load metadata for {n} photos.', { n: photos.length - valid.length, - }) + }), ); } @@ -290,7 +290,7 @@ export default defineComponent({ showError( this.t('memories', '{n} photos cannot be edited (permissions error).', { n: valid.length - updatable.length, - }) + }), ); } diff --git a/src/components/modal/EditTags.vue b/src/components/modal/EditTags.vue index 718bce1dd..4a18943bb 100644 --- a/src/components/modal/EditTags.vue +++ b/src/components/modal/EditTags.vue @@ -130,7 +130,7 @@ export default defineComponent({ // replace the temporary tag ID with the real one const i = add.findIndex((y) => y === x.id); add[i] = tag.id; - }) + }), ); } diff --git a/src/components/modal/FaceDeleteModal.vue b/src/components/modal/FaceDeleteModal.vue index cfff4c976..8946c8d99 100644 --- a/src/components/modal/FaceDeleteModal.vue +++ b/src/components/modal/FaceDeleteModal.vue @@ -63,7 +63,7 @@ export default defineComponent({ showError( this.t('memories', 'Only user "{user}" can delete this person', { user, - }) + }), ); return; } @@ -89,7 +89,7 @@ export default defineComponent({ showError( this.t('photos', 'Failed to delete {name}.', { name: this.name, - }) + }), ); } }, diff --git a/src/components/modal/FaceEditModal.vue b/src/components/modal/FaceEditModal.vue index 4b49e2d78..75c757028 100644 --- a/src/components/modal/FaceEditModal.vue +++ b/src/components/modal/FaceEditModal.vue @@ -80,7 +80,7 @@ export default defineComponent({ showError( this.t('memories', 'Only user "{user}" can update this person', { user, - }) + }), ); return; } @@ -118,7 +118,7 @@ export default defineComponent({ this.t('photos', 'Failed to rename {oldName} to {name}.', { oldName: this.oldName, name: this.name, - }) + }), ); } }, diff --git a/src/components/modal/FaceMergeModal.vue b/src/components/modal/FaceMergeModal.vue index 333a5e2ed..f6b5ecf14 100644 --- a/src/components/modal/FaceMergeModal.vue +++ b/src/components/modal/FaceMergeModal.vue @@ -66,7 +66,7 @@ export default defineComponent({ showError( this.t('memories', 'Only user "{user}" can update this person', { user, - }) + }), ); return; } @@ -116,7 +116,7 @@ export default defineComponent({ try { await client.moveFile( `/recognize/${user}/faces/${name}/${p.basename}`, - `/recognize/${face.user_id}/faces/${newName}/${p.basename}` + `/recognize/${face.user_id}/faces/${newName}/${p.basename}`, ); } catch (e) { console.error(e); diff --git a/src/components/modal/FaceMoveModal.vue b/src/components/modal/FaceMoveModal.vue index 7198637fd..35202fe32 100644 --- a/src/components/modal/FaceMoveModal.vue +++ b/src/components/modal/FaceMoveModal.vue @@ -64,7 +64,7 @@ export default defineComponent({ showError( this.t('memories', 'Only user "{user}" can update this person', { user, - }) + }), ); return; } diff --git a/src/components/modal/MoveToFolderModal.vue b/src/components/modal/MoveToFolderModal.vue index 0b9c6d9fa..f347a1475 100644 --- a/src/components/modal/MoveToFolderModal.vue +++ b/src/components/modal/MoveToFolderModal.vue @@ -64,7 +64,7 @@ export default defineComponent({ let destination = await utils.chooseNcFolder( this.t('memories', 'Choose a folder'), this.config.folders_path, - FilePickerType.Move + FilePickerType.Move, ); // Fails if the target exists, same behavior with Nextcloud files implementation. const gen = dav.movePhotos(this.photos, destination, false); diff --git a/src/components/top-matter/AlbumTopMatter.vue b/src/components/top-matter/AlbumTopMatter.vue index dfa97f9df..f818924c4 100644 --- a/src/components/top-matter/AlbumTopMatter.vue +++ b/src/components/top-matter/AlbumTopMatter.vue @@ -173,7 +173,7 @@ export default defineComponent({ async downloadAlbum() { const res = await axios.post( - API.ALBUM_DOWNLOAD(this.$route.params.user, this.$route.params.name) + API.ALBUM_DOWNLOAD(this.$route.params.user, this.$route.params.name), ); if (res.status === 200 && res.data.handle) { downloadWithHandle(res.data.handle); diff --git a/src/components/viewer/ImageEditor.vue b/src/components/viewer/ImageEditor.vue index e420733a2..6b3ef7abb 100644 --- a/src/components/viewer/ImageEditor.vue +++ b/src/components/viewer/ImageEditor.vue @@ -233,7 +233,7 @@ export default defineComponent({ fullName?: string; imageBase64?: string; }, - state: any + state: any, ): Promise { // Copy state state = JSON.parse(JSON.stringify(state)); diff --git a/src/components/viewer/ImageEditorTranslations.ts b/src/components/viewer/ImageEditorTranslations.ts index 22fb45b17..6fe28d476 100644 --- a/src/components/viewer/ImageEditorTranslations.ts +++ b/src/components/viewer/ImageEditorTranslations.ts @@ -101,7 +101,7 @@ export default { imageDimensionsHoverTitle: t('memories', 'Saved image size (width x height)'), cropSizeLowerThanResizedWarning: t( 'memories', - 'Note that the selected crop area is lower than the applied resize which might cause quality decrease' + 'Note that the selected crop area is lower than the applied resize which might cause quality decrease', ), actualSize: t('memories', 'Actual size (100%)'), fitSize: t('memories', 'Fit size'), diff --git a/src/components/viewer/PsLivePhoto.ts b/src/components/viewer/PsLivePhoto.ts index d7a0b003d..b260c44ff 100644 --- a/src/components/viewer/PsLivePhoto.ts +++ b/src/components/viewer/PsLivePhoto.ts @@ -15,7 +15,10 @@ export function isLiveContent(content: PsContent): boolean { } class LivePhotoContentSetup { - constructor(lightbox: PhotoSwipe, private psImage: PsImage) { + constructor( + lightbox: PhotoSwipe, + private psImage: PsImage, + ) { lightbox.on('contentLoad', this.onContentLoad.bind(this)); lightbox.on('contentActivate', this.onContentActivate.bind(this)); lightbox.on('contentDeactivate', this.onContentDeactivate.bind(this)); diff --git a/src/components/viewer/PsVideo.ts b/src/components/viewer/PsVideo.ts index bec10feb3..06095e2fa 100644 --- a/src/components/viewer/PsVideo.ts +++ b/src/components/viewer/PsVideo.ts @@ -38,7 +38,7 @@ class VideoContentSetup { lightbox: PhotoSwipe, private options: { preventDragOffset: number; - } + }, ) { this.initLightboxEvents(lightbox); lightbox.on('init', () => { @@ -142,7 +142,7 @@ class VideoContentSetup { // Remote videos are played back via HLS / Direct nativex.playVideo( content.data.photo, - sources.map((s) => s.src) + sources.map((s) => s.src), ); return; } diff --git a/src/native/Setup.vue b/src/native/Setup.vue index 522fb5f41..6713ae05f 100644 --- a/src/native/Setup.vue +++ b/src/native/Setup.vue @@ -8,7 +8,7 @@ {{ t( 'memories', - 'You can set up automatic uploads from this device using the Nextcloud mobile app. Click the button below to download the app, or skip this step and continue.' + 'You can set up automatic uploads from this device using the Nextcloud mobile app. Click the button below to download the app, or skip this step and continue.', ) }}
@@ -32,7 +32,7 @@ {{ t( 'memories', - 'Memories can show local media on your device alongside the media on your server. This requires access to the media on this device.' + 'Memories can show local media on your device alongside the media on your server. This requires access to the media on this device.', ) }}

@@ -41,7 +41,7 @@ ? t('memories', 'Access to media has been granted.') : t( 'memories', - 'Access to media is not available yet. If the button below does not work, grant the permission through settings.' + 'Access to media is not available yet. If the button below does not work, grant the permission through settings.', ) }} @@ -65,7 +65,7 @@ {{ t( 'memories', - 'If no folders are visible here, you may need to grant the app storage permissions, or wait for the app to index your files.' + 'If no folders are visible here, you may need to grant the app storage permissions, or wait for the app to index your files.', ) }}

diff --git a/src/native/days.ts b/src/native/days.ts index 014690d6a..043198759 100644 --- a/src/native/days.ts +++ b/src/native/days.ts @@ -136,7 +136,7 @@ export function processFreshServerDay(this: any, dayId: number, photos: IPhoto[] auids.clear(); buids.clear(); }, - 1000 + 1000, ); } diff --git a/src/service-worker.js b/src/service-worker.js index 580b389a7..f3bcfad5e 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -16,7 +16,7 @@ registerRoute( maxEntries: 1000, // 1k videos }), ], - }) + }), ); // Important: Using the NetworkOnly strategy and not registering @@ -31,7 +31,7 @@ registerRoute( ({ url }) => url.origin === self.location.origin && url.pathname.endsWith('/apps/memories/'), new NetworkFirst({ cacheName: 'memories-pages', - }) + }), ); // Cache pages for same-origin requests only @@ -45,7 +45,7 @@ registerRoute( maxEntries: 2000, // assets }), ], - }) + }), ); self.addEventListener('activate', (event) => { diff --git a/src/services/API.ts b/src/services/API.ts index 33d2c7e8a..ba90d5c0a 100644 --- a/src/services/API.ts +++ b/src/services/API.ts @@ -150,7 +150,7 @@ export class API { client: _m.video.clientId, fileid, file, - }) + }), ); } diff --git a/src/services/dav/albums.ts b/src/services/dav/albums.ts index c4f165254..ab4513c0d 100644 --- a/src/services/dav/albums.ts +++ b/src/services/dav/albums.ts @@ -71,7 +71,7 @@ export async function* addToAlbum(user: string, name: string, photos: IPhoto[]) showError( t('memories', 'Failed to add {filename} to album.', { filename: f.filename, - }) + }), ); console.error('DAV COPY error', e.response?.data); @@ -104,7 +104,7 @@ export async function* removeFromAlbum(user: string, name: string, photos: IPhot showError( t('memories', 'Failed to remove {filename}.', { filename: f.basename ?? f.fileid, - }) + }), ); return 0; } @@ -170,7 +170,7 @@ export async function updateAlbum(album: any, { albumName, properties }: any) { t('photos', 'Failed to update properties of {albumName} with {properties}.', { albumName, properties: JSON.stringify(properties), - }) + }), ); return album; } @@ -217,7 +217,7 @@ export async function renameAlbum(album: any, currentAlbumName: string, newAlbum try { await client.moveFile( `/photos/${utils.uid}/albums/${currentAlbumName}`, - `/photos/${utils.uid}/albums/${newAlbumName}` + `/photos/${utils.uid}/albums/${newAlbumName}`, ); return newAlbum; } catch (error) { @@ -226,7 +226,7 @@ export async function renameAlbum(album: any, currentAlbumName: string, newAlbum t('photos', 'Failed to rename {currentAlbumName} to {newAlbumName}.', { currentAlbumName, newAlbumName, - }) + }), ); return album; } diff --git a/src/services/dav/base.ts b/src/services/dav/base.ts index 2bfa15e57..87d0061ab 100644 --- a/src/services/dav/base.ts +++ b/src/services/dav/base.ts @@ -135,7 +135,7 @@ export async function* runInParallel(promises: (() => Promise)[], n: numbe // remove the promise from the running list running.splice(running.indexOf(task), 1); - })()) + })()), ); } @@ -173,7 +173,7 @@ async function extendWithLivePhotos(photos: IPhoto[]) { console.error(error); return null; } - }) + }), ) ).filter((p) => p !== null) as IPhoto[]; @@ -251,7 +251,7 @@ export async function* deletePhotos(photos: IPhoto[], confirm: boolean = true) { showError( t('memories', 'Failed to delete {fileName}.', { fileName: fileInfo.filename, - }) + }), ); return 0; } @@ -302,7 +302,7 @@ export async function* movePhotos(photos: IPhoto[], destination: string, overwri fileInfo.originalFilename, targetPath + fileInfo.basename, // @ts-ignore - https://github.com/perry-mitchell/webdav-client/issues/329 - { headers: { Overwrite: overwrite ? 'T' : 'F' } } + { headers: { Overwrite: overwrite ? 'T' : 'F' } }, ); return fileInfo.fileid; } catch (error) { @@ -312,7 +312,7 @@ export async function* movePhotos(photos: IPhoto[], destination: string, overwri showError( t('memories', 'Could not move {fileName}, target exists.', { fileName: fileInfo.filename, - }) + }), ); return 0; } @@ -320,7 +320,7 @@ export async function* movePhotos(photos: IPhoto[], destination: string, overwri showError( t('memories', 'Failed to move {fileName}.', { fileName: fileInfo.filename, - }) + }), ); return 0; } diff --git a/src/services/dav/face.ts b/src/services/dav/face.ts index 7bb631a22..a77d6ae7c 100644 --- a/src/services/dav/face.ts +++ b/src/services/dav/face.ts @@ -66,7 +66,7 @@ export async function* recognizeDeleteFaceImages(user: string, name: string, pho showError( t('memories', 'Failed to remove {filename} from face.', { filename: p.basename ?? p.fileid, - }) + }), ); return 0; } @@ -104,7 +104,7 @@ export async function* recognizeMoveFaceImages(user: string, face: string, targe showError( t('memories', 'Failed to move {filename} from face.', { filename: p.basename ?? p.fileid, - }) + }), ); return 0; } diff --git a/src/services/dav/favorites.ts b/src/services/dav/favorites.ts index f5e3dfadc..7d7e60fb9 100644 --- a/src/services/dav/favorites.ts +++ b/src/services/dav/favorites.ts @@ -67,7 +67,7 @@ export async function* favoritePhotos(photos: IPhoto[], favoriteState: boolean) showError( t('memories', 'Failed to favorite {fileName}.', { fileName: fileInfo.originalFilename, - }) + }), ); return 0; } diff --git a/src/services/dav/tags.ts b/src/services/dav/tags.ts index 85b4ac9dc..840be7b45 100644 --- a/src/services/dav/tags.ts +++ b/src/services/dav/tags.ts @@ -60,7 +60,7 @@ export async function createTag(tag: ITag): Promise { t('memories', 'Failed to create tag {name}: {error}', { name: tag.displayName, error: error.message, - }) + }), ); } } diff --git a/src/services/layout.ts b/src/services/layout.ts index fed70601d..accbb38d9 100644 --- a/src/services/layout.ts +++ b/src/services/layout.ts @@ -19,7 +19,7 @@ export function getLayout( numCols: number; allowBreakout: boolean; seed: number; - } + }, ): { top: number; left: number; diff --git a/src/services/static-config.ts b/src/services/static-config.ts index 5a35ba521..d458271c3 100644 --- a/src/services/static-config.ts +++ b/src/services/static-config.ts @@ -39,7 +39,7 @@ class StaticConfig { showInfo( t('memories', 'Memories has been updated to {version}. Reload to get the new version.', { version: this.config.version, - }) + }), ); } diff --git a/src/services/utils/date.ts b/src/services/utils/date.ts index d84e06a30..6f9bc22a7 100644 --- a/src/services/utils/date.ts +++ b/src/services/utils/date.ts @@ -26,7 +26,7 @@ export function getShortDateStr(date: Date): string { month: 'short', year: 'numeric', timeZone: 'UTC', - }) + }), ); } return shortDateStrMemo.get(dayId)!; diff --git a/src/services/utils/dialog.ts b/src/services/utils/dialog.ts index 485f790db..a77cdd527 100644 --- a/src/services/utils/dialog.ts +++ b/src/services/utils/dialog.ts @@ -30,7 +30,7 @@ export function confirmDestructive(options: ConfirmOptions): Promise { confirmClasses: 'error', cancel: t('memories', 'No'), }, - options ?? {} + options ?? {}, ); // Observer to focus the confirm button when the dialog is shown @@ -79,7 +79,7 @@ export async function prompt(opts: PromptOptions): Promise { (success: boolean, value: string) => resolve(success ? value : null), opts.modal, opts.name, - opts.password + opts.password, ); }); } diff --git a/src/services/utils/helpers.ts b/src/services/utils/helpers.ts index c6da3c3e2..45a312fe6 100644 --- a/src/services/utils/helpers.ts +++ b/src/services/utils/helpers.ts @@ -217,7 +217,7 @@ export function getViewerRoute(photo: IPhoto) { export async function chooseNcFolder( title: string, initial: string = '/', - type: FilePickerType = FilePickerType.Choose + type: FilePickerType = FilePickerType.Choose, ) { const picker = getFilePickerBuilder(title) .setMultiSelect(false) diff --git a/src/styles/livephoto.scss b/src/styles/livephoto.scss index fc127d07d..3344800ee 100644 --- a/src/styles/livephoto.scss +++ b/src/styles/livephoto.scss @@ -13,7 +13,10 @@ height: 100%; display: block; z-index: 1; - transition: transform 0.3s ease-in-out, visibility 0.3s ease-in-out, opacity 0.3s ease-in-out; + transition: + transform 0.3s ease-in-out, + visibility 0.3s ease-in-out, + opacity 0.3s ease-in-out; } video { @@ -26,7 +29,9 @@ video { opacity: 1; visibility: visible; - transition: opacity 0.3s ease-in-out, visibility 0s ease-in-out; + transition: + opacity 0.3s ease-in-out, + visibility 0s ease-in-out; } img { transform: scale(1.05);