Compare commits

..

3 Commits

Author SHA1 Message Date
Daimolean
be2eae79ca Merge branch 'main' into edit-date-time-action 2025-07-24 02:12:56 +08:00
wuzihao051119
c580c13e3e add test 2025-07-23 21:28:16 +08:00
wuzihao051119
d0e0c24690 feat(mobile): edit date time action 2025-07-23 20:34:00 +08:00
1223 changed files with 49604 additions and 47917 deletions

View File

@@ -11,8 +11,8 @@ services:
- open_api_node_modules:/workspaces/immich/open-api/typescript-sdk/node_modules - open_api_node_modules:/workspaces/immich/open-api/typescript-sdk/node_modules
- server_node_modules:/workspaces/immich/server/node_modules - server_node_modules:/workspaces/immich/server/node_modules
- web_node_modules:/workspaces/immich/web/node_modules - web_node_modules:/workspaces/immich/web/node_modules
- ${UPLOAD_LOCATION}/photos:/data - ${UPLOAD_LOCATION}/photos:/usr/src/app/upload
- ${UPLOAD_LOCATION}/photos/upload:/data/upload - ${UPLOAD_LOCATION}/photos/upload:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
database: database:

View File

@@ -13,8 +13,8 @@ services:
- open_api_node_modules:/workspaces/immich/open-api/typescript-sdk/node_modules - open_api_node_modules:/workspaces/immich/open-api/typescript-sdk/node_modules
- server_node_modules:/workspaces/immich/server/node_modules - server_node_modules:/workspaces/immich/server/node_modules
- web_node_modules:/workspaces/immich/web/node_modules - web_node_modules:/workspaces/immich/web/node_modules
- ${UPLOAD_LOCATION:-upload1-devcontainer-volume}${UPLOAD_LOCATION:+/photos}:/data - ${UPLOAD_LOCATION:-upload1-devcontainer-volume}${UPLOAD_LOCATION:+/photos}:/usr/src/app/upload
- ${UPLOAD_LOCATION:-upload2-devcontainer-volume}${UPLOAD_LOCATION:+/photos/upload}:/data/upload - ${UPLOAD_LOCATION:-upload2-devcontainer-volume}${UPLOAD_LOCATION:+/photos/upload}:/usr/src/app/upload/upload
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
immich-web: immich-web:

View File

@@ -122,17 +122,17 @@ jobs:
IS_MAIN: ${{ github.ref == 'refs/heads/main' }} IS_MAIN: ${{ github.ref == 'refs/heads/main' }}
run: | run: |
if [[ $IS_MAIN == 'true' ]]; then if [[ $IS_MAIN == 'true' ]]; then
flutter build apk --release flutter build apk --release --flavor production
flutter build apk --release --split-per-abi --target-platform android-arm,android-arm64,android-x64 flutter build apk --release --flavor production --split-per-abi --target-platform android-arm,android-arm64,android-x64
else else
flutter build apk --debug --split-per-abi --target-platform android-arm64 flutter build apk --debug --flavor production --split-per-abi --target-platform android-arm64
fi fi
- name: Publish Android Artifact - name: Publish Android Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with: with:
name: release-apk-signed name: release-apk-signed
path: mobile/build/app/outputs/flutter-apk/*.apk path: mobile/build/app/outputs/flutter-apk/**/*.apk
- name: Save Gradle Cache - name: Save Gradle Cache
id: cache-gradle-save id: cache-gradle-save

View File

@@ -50,7 +50,7 @@ jobs:
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file. # If you wish to specify custom queries, you can do so here or in a config file.
@@ -63,7 +63,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below) # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 uses: github/codeql-action/autobuild@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
# Command-line programs to run using the OS shell. # Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -76,6 +76,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh # ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with: with:
category: '/language:${{matrix.language}}' category: '/language:${{matrix.language}}'

View File

@@ -90,7 +90,7 @@ jobs:
env: env:
CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }} CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }}
run: | run: |
echo "ERROR: Generated files not up to date! Run 'make build' and 'make pigeon' inside the mobile directory" echo "ERROR: Generated files not up to date! Run make_build inside the mobile directory"
echo "Changed files: ${CHANGED_FILES}" echo "Changed files: ${CHANGED_FILES}"
exit 1 exit 1
@@ -98,7 +98,7 @@ jobs:
run: dart analyze --fatal-infos run: dart analyze --fatal-infos
- name: Run dart format - name: Run dart format
run: make format run: dart format lib/ --set-exit-if-changed
- name: Run dart custom_lint - name: Run dart custom_lint
run: dart run custom_lint run: dart run custom_lint
@@ -129,7 +129,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload SARIF file - name: Upload SARIF file
uses: github/codeql-action/upload-sarif@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with: with:
sarif_file: results.sarif sarif_file: results.sarif
category: zizmor category: zizmor

View File

@@ -668,7 +668,7 @@ jobs:
contents: read contents: read
services: services:
postgres: postgres:
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3@sha256:ec713143dca1a426eba2e03707c319e2ec3cc9d304ef767f777f8e297dee820c image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3@sha256:1f5583fe3397210a0fbc7f11b0cec18bacc4a99e3e8ea0548e9bd6bcf26ec37a
env: env:
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres POSTGRES_USER: postgres

View File

@@ -38,7 +38,7 @@ jobs:
exit 1 exit 1
fi fi
- name: Find Pull Request - name: Find Pull Request
uses: juliangruber/find-pull-request-action@952b3bb1ddb2dcc0aa3479e98bb1c2d1a922f096 # v1.10.0 uses: juliangruber/find-pull-request-action@48b6133aa6c826f267ebd33aa2d29470f9d9e7d0 # v1.9.0
id: find-pr id: find-pr
with: with:
branch: chore/translations branch: chore/translations

23
.vscode/launch.json vendored
View File

@@ -7,7 +7,7 @@
"restart": true, "restart": true,
"port": 9231, "port": 9231,
"name": "Immich API Server", "name": "Immich API Server",
"remoteRoot": "/usr/src/app/server", "remoteRoot": "/usr/src/app",
"localRoot": "${workspaceFolder}/server" "localRoot": "${workspaceFolder}/server"
}, },
{ {
@@ -16,8 +16,27 @@
"restart": true, "restart": true,
"port": 9230, "port": 9230,
"name": "Immich Workers", "name": "Immich Workers",
"remoteRoot": "/usr/src/app/server", "remoteRoot": "/usr/src/app",
"localRoot": "${workspaceFolder}/server" "localRoot": "${workspaceFolder}/server"
},
{
"name": "Flavor - Production",
"request": "launch",
"type": "dart",
"codeLens": {
"for": [
"run-test",
"run-test-file",
"run-file",
"debug-test",
"debug-test-file",
"debug-file",
],
"title": "${debugType}",
},
"args": [
"--flavor", "production"
],
} }
] ]
} }

154
cli/package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@immich/cli", "name": "@immich/cli",
"version": "2.2.73", "version": "2.2.72",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@immich/cli", "name": "@immich/cli",
"version": "2.2.73", "version": "2.2.72",
"license": "GNU Affero General Public License version 3", "license": "GNU Affero General Public License version 3",
"dependencies": { "dependencies": {
"chokidar": "^4.0.3", "chokidar": "^4.0.3",
@@ -27,13 +27,13 @@
"@types/lodash-es": "^4.17.12", "@types/lodash-es": "^4.17.12",
"@types/micromatch": "^4.0.9", "@types/micromatch": "^4.0.9",
"@types/mock-fs": "^4.13.1", "@types/mock-fs": "^4.13.1",
"@types/node": "^22.16.5", "@types/node": "^22.16.4",
"@vitest/coverage-v8": "^3.0.0", "@vitest/coverage-v8": "^3.0.0",
"byte-size": "^9.0.0", "byte-size": "^9.0.0",
"cli-progress": "^3.12.0", "cli-progress": "^3.12.0",
"commander": "^12.0.0", "commander": "^12.0.0",
"eslint": "^9.14.0", "eslint": "^9.14.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.0.0",
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unicorn": "^59.0.0", "eslint-plugin-unicorn": "^59.0.0",
"globals": "^16.0.0", "globals": "^16.0.0",
@@ -54,14 +54,14 @@
}, },
"../open-api/typescript-sdk": { "../open-api/typescript-sdk": {
"name": "@immich/sdk", "name": "@immich/sdk",
"version": "1.136.0", "version": "1.135.3",
"dev": true, "dev": true,
"license": "GNU Affero General Public License version 3", "license": "GNU Affero General Public License version 3",
"dependencies": { "dependencies": {
"@oazapfts/runtime": "^1.0.2" "@oazapfts/runtime": "^1.0.2"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^22.16.5", "@types/node": "^22.16.4",
"typescript": "^5.3.3" "typescript": "^5.3.3"
} }
}, },
@@ -1365,17 +1365,17 @@
} }
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.37.0.tgz",
"integrity": "sha512-CPoznzpuAnIOl4nhj4tRr4gIPj5AfKgkiJmGQDaq+fQnRJTYlcBjbX3wbciGmpoPf8DREufuPRe1tNMZnGdanA==", "integrity": "sha512-jsuVWeIkb6ggzB+wPCsR4e6loj+rM72ohW6IBn2C+5NCvfUVY8s33iFPySSVXqtm5Hu29Ne/9bnA0JmyLmgenA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.10.0", "@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "8.38.0", "@typescript-eslint/scope-manager": "8.37.0",
"@typescript-eslint/type-utils": "8.38.0", "@typescript-eslint/type-utils": "8.37.0",
"@typescript-eslint/utils": "8.38.0", "@typescript-eslint/utils": "8.37.0",
"@typescript-eslint/visitor-keys": "8.38.0", "@typescript-eslint/visitor-keys": "8.37.0",
"graphemer": "^1.4.0", "graphemer": "^1.4.0",
"ignore": "^7.0.0", "ignore": "^7.0.0",
"natural-compare": "^1.4.0", "natural-compare": "^1.4.0",
@@ -1389,7 +1389,7 @@
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"@typescript-eslint/parser": "^8.38.0", "@typescript-eslint/parser": "^8.37.0",
"eslint": "^8.57.0 || ^9.0.0", "eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <5.9.0" "typescript": ">=4.8.4 <5.9.0"
} }
@@ -1405,16 +1405,16 @@
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.37.0.tgz",
"integrity": "sha512-Zhy8HCvBUEfBECzIl1PKqF4p11+d0aUJS1GeUiuqK9WmOug8YCmC4h4bjyBvMyAMI9sbRczmrYL5lKg/YMbrcQ==", "integrity": "sha512-kVIaQE9vrN9RLCQMQ3iyRlVJpTiDUY6woHGb30JDkfJErqrQEmtdWH3gV0PBAfGZgQXoqzXOO0T3K6ioApbbAA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "8.38.0", "@typescript-eslint/scope-manager": "8.37.0",
"@typescript-eslint/types": "8.38.0", "@typescript-eslint/types": "8.37.0",
"@typescript-eslint/typescript-estree": "8.38.0", "@typescript-eslint/typescript-estree": "8.37.0",
"@typescript-eslint/visitor-keys": "8.38.0", "@typescript-eslint/visitor-keys": "8.37.0",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
@@ -1430,14 +1430,14 @@
} }
}, },
"node_modules/@typescript-eslint/project-service": { "node_modules/@typescript-eslint/project-service": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.37.0.tgz",
"integrity": "sha512-dbK7Jvqcb8c9QfH01YB6pORpqX1mn5gDZc9n63Ak/+jD67oWXn3Gs0M6vddAN+eDXBCS5EmNWzbSxsn9SzFWWg==", "integrity": "sha512-BIUXYsbkl5A1aJDdYJCBAo8rCEbAvdquQ8AnLb6z5Lp1u3x5PNgSSx9A/zqYc++Xnr/0DVpls8iQ2cJs/izTXA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.38.0", "@typescript-eslint/tsconfig-utils": "^8.37.0",
"@typescript-eslint/types": "^8.38.0", "@typescript-eslint/types": "^8.37.0",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
@@ -1452,14 +1452,14 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.37.0.tgz",
"integrity": "sha512-WJw3AVlFFcdT9Ri1xs/lg8LwDqgekWXWhH3iAF+1ZM+QPd7oxQ6jvtW/JPwzAScxitILUIFs0/AnQ/UWHzbATQ==", "integrity": "sha512-0vGq0yiU1gbjKob2q691ybTg9JX6ShiVXAAfm2jGf3q0hdP6/BruaFjL/ManAR/lj05AvYCH+5bbVo0VtzmjOA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.38.0", "@typescript-eslint/types": "8.37.0",
"@typescript-eslint/visitor-keys": "8.38.0" "@typescript-eslint/visitor-keys": "8.37.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1470,9 +1470,9 @@
} }
}, },
"node_modules/@typescript-eslint/tsconfig-utils": { "node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.37.0.tgz",
"integrity": "sha512-Lum9RtSE3EroKk/bYns+sPOodqb2Fv50XOl/gMviMKNvanETUuUcC9ObRbzrJ4VSd2JalPqgSAavwrPiPvnAiQ==", "integrity": "sha512-1/YHvAVTimMM9mmlPvTec9NP4bobA1RkDbMydxG8omqwJJLEW/Iy2C4adsAESIXU3WGLXFHSZUU+C9EoFWl4Zg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -1487,15 +1487,15 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.37.0.tgz",
"integrity": "sha512-c7jAvGEZVf0ao2z+nnz8BUaHZD09Agbh+DY7qvBQqLiz8uJzRgVPj5YvOh8I8uEiH8oIUGIfHzMwUcGVco/SJg==", "integrity": "sha512-SPkXWIkVZxhgwSwVq9rqj/4VFo7MnWwVaRNznfQDc/xPYHjXnPfLWn+4L6FF1cAz6e7dsqBeMawgl7QjUMj4Ow==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.38.0", "@typescript-eslint/types": "8.37.0",
"@typescript-eslint/typescript-estree": "8.38.0", "@typescript-eslint/typescript-estree": "8.37.0",
"@typescript-eslint/utils": "8.38.0", "@typescript-eslint/utils": "8.37.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"ts-api-utils": "^2.1.0" "ts-api-utils": "^2.1.0"
}, },
@@ -1512,9 +1512,9 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.37.0.tgz",
"integrity": "sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==", "integrity": "sha512-ax0nv7PUF9NOVPs+lmQ7yIE7IQmAf8LGcXbMvHX5Gm+YJUYNAl340XkGnrimxZ0elXyoQJuN5sbg6C4evKA4SQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -1526,16 +1526,16 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.37.0.tgz",
"integrity": "sha512-fooELKcAKzxux6fA6pxOflpNS0jc+nOQEEOipXFNjSlBS6fqrJOVY/whSn70SScHrcJ2LDsxWrneFoWYSVfqhQ==", "integrity": "sha512-zuWDMDuzMRbQOM+bHyU4/slw27bAUEcKSKKs3hcv2aNnc/tvE/h7w60dwVw8vnal2Pub6RT1T7BI8tFZ1fE+yg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/project-service": "8.38.0", "@typescript-eslint/project-service": "8.37.0",
"@typescript-eslint/tsconfig-utils": "8.38.0", "@typescript-eslint/tsconfig-utils": "8.37.0",
"@typescript-eslint/types": "8.38.0", "@typescript-eslint/types": "8.37.0",
"@typescript-eslint/visitor-keys": "8.38.0", "@typescript-eslint/visitor-keys": "8.37.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"fast-glob": "^3.3.2", "fast-glob": "^3.3.2",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
@@ -1581,16 +1581,16 @@
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.37.0.tgz",
"integrity": "sha512-hHcMA86Hgt+ijJlrD8fX0j1j8w4C92zue/8LOPAFioIno+W0+L7KqE8QZKCcPGc/92Vs9x36w/4MPTJhqXdyvg==", "integrity": "sha512-TSFvkIW6gGjN2p6zbXo20FzCABbyUAuq6tBvNRGsKdsSQ6a7rnV6ADfZ7f4iI3lIiXc4F4WWvtUfDw9CJ9pO5A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.7.0", "@eslint-community/eslint-utils": "^4.7.0",
"@typescript-eslint/scope-manager": "8.38.0", "@typescript-eslint/scope-manager": "8.37.0",
"@typescript-eslint/types": "8.38.0", "@typescript-eslint/types": "8.37.0",
"@typescript-eslint/typescript-estree": "8.38.0" "@typescript-eslint/typescript-estree": "8.37.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1605,13 +1605,13 @@
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.37.0.tgz",
"integrity": "sha512-pWrTcoFNWuwHlA9CvlfSsGWs14JxfN1TH25zM5L7o0pRLhsoZkDnTsXfQRJBEWJoV5DL0jf+Z+sxiud+K0mq1g==", "integrity": "sha512-YzfhzcTnZVPiLfP/oeKtDp2evwvHLMe0LOy7oe+hb9KKIumLNohYS9Hgp1ifwpu42YWxhZE8yieggz6JpqO/1w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.38.0", "@typescript-eslint/types": "8.37.0",
"eslint-visitor-keys": "^4.2.1" "eslint-visitor-keys": "^4.2.1"
}, },
"engines": { "engines": {
@@ -2367,9 +2367,9 @@
} }
}, },
"node_modules/eslint-config-prettier": { "node_modules/eslint-config-prettier": {
"version": "10.1.8", "version": "10.1.5",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz",
"integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "integrity": "sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"bin": { "bin": {
@@ -2383,9 +2383,9 @@
} }
}, },
"node_modules/eslint-plugin-prettier": { "node_modules/eslint-plugin-prettier": {
"version": "5.5.3", "version": "5.5.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.3.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.1.tgz",
"integrity": "sha512-NAdMYww51ehKfDyDhv59/eIItUVzU0Io9H2E8nHNGKEeeqlnci+1gCvrHib6EmZdf6GxF+LCV5K7UC65Ezvw7w==", "integrity": "sha512-dobTkHT6XaEVOo8IO90Q4DOSxnm3Y151QxPJlM/vKC0bVy+d6cVWQZLlFiuZPP0wS6vZwSKeJgKkcS+KfMBlRw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -3548,15 +3548,15 @@
} }
}, },
"node_modules/prettier-plugin-organize-imports": { "node_modules/prettier-plugin-organize-imports": {
"version": "4.2.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.2.0.tgz", "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.1.0.tgz",
"integrity": "sha512-Zdy27UhlmyvATZi67BTnLcKTo8fm6Oik59Sz6H64PgZJVs6NJpPD1mT240mmJn62c98/QaL+r3kx9Q3gRpDajg==", "integrity": "sha512-5aWRdCgv645xaa58X8lOxzZoiHAldAPChljr/MT0crXVOWTZ+Svl4hIWlz+niYSlO6ikE5UXkN1JrRvIP2ut0A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peerDependencies": { "peerDependencies": {
"prettier": ">=2.0", "prettier": ">=2.0",
"typescript": ">=2.9", "typescript": ">=2.9",
"vue-tsc": "^2.1.0 || 3" "vue-tsc": "^2.1.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"vue-tsc": { "vue-tsc": {
@@ -4139,16 +4139,16 @@
} }
}, },
"node_modules/typescript-eslint": { "node_modules/typescript-eslint": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.38.0.tgz", "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.37.0.tgz",
"integrity": "sha512-FsZlrYK6bPDGoLeZRuvx2v6qrM03I0U0SnfCLPs/XCCPCFD80xU9Pg09H/K+XFa68uJuZo7l/Xhs+eDRg2l3hg==", "integrity": "sha512-TnbEjzkE9EmcO0Q2zM+GE8NQLItNAJpMmED1BdgoBMYNdqMhzlbqfdSwiRlAzEK2pA9UzVW0gzaaIzXWg2BjfA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/eslint-plugin": "8.38.0", "@typescript-eslint/eslint-plugin": "8.37.0",
"@typescript-eslint/parser": "8.38.0", "@typescript-eslint/parser": "8.37.0",
"@typescript-eslint/typescript-estree": "8.38.0", "@typescript-eslint/typescript-estree": "8.37.0",
"@typescript-eslint/utils": "8.38.0" "@typescript-eslint/utils": "8.37.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@immich/cli", "name": "@immich/cli",
"version": "2.2.73", "version": "2.2.72",
"description": "Command Line Interface (CLI) for Immich", "description": "Command Line Interface (CLI) for Immich",
"type": "module", "type": "module",
"exports": "./dist/index.js", "exports": "./dist/index.js",
@@ -21,13 +21,13 @@
"@types/lodash-es": "^4.17.12", "@types/lodash-es": "^4.17.12",
"@types/micromatch": "^4.0.9", "@types/micromatch": "^4.0.9",
"@types/mock-fs": "^4.13.1", "@types/mock-fs": "^4.13.1",
"@types/node": "^22.16.5", "@types/node": "^22.16.4",
"@vitest/coverage-v8": "^3.0.0", "@vitest/coverage-v8": "^3.0.0",
"byte-size": "^9.0.0", "byte-size": "^9.0.0",
"cli-progress": "^3.12.0", "cli-progress": "^3.12.0",
"commander": "^12.0.0", "commander": "^12.0.0",
"eslint": "^9.14.0", "eslint": "^9.14.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.0.0",
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unicorn": "^59.0.0", "eslint-plugin-unicorn": "^59.0.0",
"globals": "^16.0.0", "globals": "^16.0.0",

View File

@@ -2,37 +2,37 @@
# Manual edits may be lost in future updates. # Manual edits may be lost in future updates.
provider "registry.opentofu.org/cloudflare/cloudflare" { provider "registry.opentofu.org/cloudflare/cloudflare" {
version = "4.52.1" version = "4.52.0"
constraints = "4.52.1" constraints = "4.52.0"
hashes = [ hashes = [
"h1:2lHvafwGbLdmc9lYkuJFw3nsInaQjRpjX/JfIRKmq/M=", "h1:2BEJyXJtYC4B4nda/WCYUmuJYDaYk88F8t1pwPzr0iQ=",
"h1:596JomwjrtUrOSreq9NNCS+rj70+jOV+0pfja5MXiTI=", "h1:4IASk5SESeWKQ7JU0+M7KApuF5mZyklvwMXPBabim3c=",
"h1:7mBOA5TVAIt3qAwPXKCtE0RSYeqij9v30mnksuBbpEg=", "h1:5ImZxxALSnWfH/4EXw/wFirSmk5Tr0ACmcysy51AafE=",
"h1:ELVgzh4kHKBCYdL+2A8JjWS0E1snLUN3Mmz3Vo6qSfw=", "h1:6TJ3dxLSin4ZKBJLsZDn95H2ZYnGm8S7GGHvvXuuMQU=",
"h1:FGGM5yLFf72g3kSXM3LAN64Gf/AkXr5WCmhixgnP+l4=", "h1:IzTUjg9kQ4N3qizP9CjYLeHwjsuGgtxwXvfUQWyOLcA=",
"h1:JupkJbQALcIVoMhHImrLeLDsQR1ET7VJLGC7ONxjqGU=", "h1:NTaOQfYINA0YTG/V1/9+SYtgX1it63+cBugj4WK4FWc=",
"h1:KsaE4JNq+1uV1nJsuTcYar/8lyY6zKS5UBEpfYg3wvc=", "h1:PXH48LuJn329sCfMXprdMDk51EZaWFyajVvS03qhQLs=",
"h1:NHZ5RJIzQDLhie/ykl3uI6UPfNQR9Lu5Ti7JPR6X904=", "h1:Pi5M+GeoMSN2eJ6QnIeXjBf19O+rby/74CfB2ocpv20=",
"h1:NfAuMbn6LQPLDtJhbzO1MX9JMIGLMa8K6CpekvtsuX8=", "h1:ShXZ2ZjBvm3thfoPPzPT8+OhyismnydQVkUAfI8X12w=",
"h1:e+vNKokamDsp/kJvFr2pRudzwEz2r49iZ/oSggw+1LY=", "h1:WQ9hu0Wge2msBbODfottCSKgu8oKUrw4Opz+fDPVVHk=",
"h1:jnb4VdfNZ79I3yj7Q8x+JmOT+FxbfjjRfrF0dL0yCW8=", "h1:Z5yXML2DE0uH9UU+M0ut9JMQAORcwVZz1CxBHzeBmao=",
"h1:kmF//O539d7NuHU7qIxDj7Wz4eJmLKFiI5glwQivldU=", "h1:jqI2qKknpleS3JDSplyGYHMu0u9K/tor1ZOjFwDgEMk=",
"h1:s6XriaKwOgV4jvKAGPXkrxhhOQxpNU5dceZwi9Z/1k8=", "h1:kgfutDh14Q5nw4eg6qGFamFxIiY8Ae0FPKRBLDOzpcI=",
"h1:wt3WBEBAeSGTlC9OlnTlAALxRiK4SQgLy0KgBIS7qzs=", "h1:zCAO7GZmfYhWb+i6TfqlqhMeDyPZWGio2IzEzAh3YTs=",
"zh:2fb95e1d3229b9b6c704e1a413c7481c60f139780d9641f657b6eb9b633b90f2", "zh:19be1a91c982b902c42aba47766860dfa5dc151eed1e95fd39ca642229381ef0",
"zh:379c7680983383862236e9e6e720c3114195c40526172188e88d0ffcf50dfe2e", "zh:1de451c4d1ecf7efbe67b6dace3426ba810711afdd644b0f1b870364c8ae91f8",
"zh:55533beb6cfc02d22ffda8cba8027bc2c841bb172cd637ed0d28323d41395f8f", "zh:352b4a2120173298622e669258744554339d959ac3a95607b117a48ee4a83238",
"zh:5abd70760e4eb1f37a1c307cbd2989ea7c9ba0afb93818c67c1d363a31f75703", "zh:3c6f1346d9154afbd2d558fabb4b0150fc8d559aa961254144fe1bc17fe6032f",
"zh:699f1c8cd66129176fe659ebf0e6337632a8967a28d2630b6ae5948665c0c2ae", "zh:4c4c92d53fb535b1e0eff26f222bbd627b97d3b4c891ec9c321268676d06152f",
"zh:69c15acd73c451e89de6477059cda2f3ec200b48ae4b9ff3646c4d389fd3205e", "zh:53276f68006c9ceb7cdb10a6ccf91a5c1eadd1407a28edb5741e84e88d7e29e8",
"zh:6e02b687de21b844f8266dff99e93e7c61fc8eb688f4bbb23803caceb251839e", "zh:7925a97773948171a63d4f65bb81ee92fd6d07a447e36012977313293a5435c9",
"zh:7a51d17b87ed87b7bebf2ad9fc7c3a74f16a1b44eee92c779c08eb89258c0496", "zh:7dfb0a4496cfe032437386d0a2cd9229a1956e9c30bd920923c141b0f0440060",
"zh:88ad84436837b0f55302f22748505972634e87400d6902260fd6b7ba1610f937",
"zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f", "zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f",
"zh:8d46c3d9f4f7ad20ac6ef01daa63f4e30a2d16dcb1bb5c7c7ee3dc6be38e9ca1", "zh:8d4aa79f0a414bb4163d771063c70cd991c8fac6c766e685bac2ee12903c5bd6",
"zh:913d64e72a4929dae1d4793e2004f4f9a58b138ea337d9d94fa35cafbf06550a", "zh:a67540c13565616a7e7e51ee9366e88b0dc60046e1d75c72680e150bd02725bb",
"zh:c8d93cf86e2e49f6cec665cfe78b82c144cce15a8b2e30f343385fadd1251849", "zh:a936383a4767f5393f38f622e92bf2d0c03fe04b69c284951f27345766c7b31b",
"zh:cc4f69397d9bc34a528a5609a024c3a48f54f21616c0008792dd417297add955", "zh:d4887d73c466ff036eecf50ad6404ba38fd82ea4855296b1846d244b0f13c380",
"zh:df99cdb8b064aad35ffea77e645cf6541d0b1b2ebc51b6d26c42031de60ab69e", "zh:e9093c8bd5b6cd99c81666e315197791781b8f93afa14fc2e0f732d1bb2a44b7",
"zh:efd3b3f1ec59a37f635aa1d4efcf178734c2fcf8ddb0d56ea690bec342da8672",
] ]
} }

View File

@@ -5,7 +5,7 @@ terraform {
required_providers { required_providers {
cloudflare = { cloudflare = {
source = "cloudflare/cloudflare" source = "cloudflare/cloudflare"
version = "4.52.1" version = "4.52.0"
} }
} }
} }

View File

@@ -2,37 +2,37 @@
# Manual edits may be lost in future updates. # Manual edits may be lost in future updates.
provider "registry.opentofu.org/cloudflare/cloudflare" { provider "registry.opentofu.org/cloudflare/cloudflare" {
version = "4.52.1" version = "4.52.0"
constraints = "4.52.1" constraints = "4.52.0"
hashes = [ hashes = [
"h1:2lHvafwGbLdmc9lYkuJFw3nsInaQjRpjX/JfIRKmq/M=", "h1:2BEJyXJtYC4B4nda/WCYUmuJYDaYk88F8t1pwPzr0iQ=",
"h1:596JomwjrtUrOSreq9NNCS+rj70+jOV+0pfja5MXiTI=", "h1:4IASk5SESeWKQ7JU0+M7KApuF5mZyklvwMXPBabim3c=",
"h1:7mBOA5TVAIt3qAwPXKCtE0RSYeqij9v30mnksuBbpEg=", "h1:5ImZxxALSnWfH/4EXw/wFirSmk5Tr0ACmcysy51AafE=",
"h1:ELVgzh4kHKBCYdL+2A8JjWS0E1snLUN3Mmz3Vo6qSfw=", "h1:6TJ3dxLSin4ZKBJLsZDn95H2ZYnGm8S7GGHvvXuuMQU=",
"h1:FGGM5yLFf72g3kSXM3LAN64Gf/AkXr5WCmhixgnP+l4=", "h1:IzTUjg9kQ4N3qizP9CjYLeHwjsuGgtxwXvfUQWyOLcA=",
"h1:JupkJbQALcIVoMhHImrLeLDsQR1ET7VJLGC7ONxjqGU=", "h1:NTaOQfYINA0YTG/V1/9+SYtgX1it63+cBugj4WK4FWc=",
"h1:KsaE4JNq+1uV1nJsuTcYar/8lyY6zKS5UBEpfYg3wvc=", "h1:PXH48LuJn329sCfMXprdMDk51EZaWFyajVvS03qhQLs=",
"h1:NHZ5RJIzQDLhie/ykl3uI6UPfNQR9Lu5Ti7JPR6X904=", "h1:Pi5M+GeoMSN2eJ6QnIeXjBf19O+rby/74CfB2ocpv20=",
"h1:NfAuMbn6LQPLDtJhbzO1MX9JMIGLMa8K6CpekvtsuX8=", "h1:ShXZ2ZjBvm3thfoPPzPT8+OhyismnydQVkUAfI8X12w=",
"h1:e+vNKokamDsp/kJvFr2pRudzwEz2r49iZ/oSggw+1LY=", "h1:WQ9hu0Wge2msBbODfottCSKgu8oKUrw4Opz+fDPVVHk=",
"h1:jnb4VdfNZ79I3yj7Q8x+JmOT+FxbfjjRfrF0dL0yCW8=", "h1:Z5yXML2DE0uH9UU+M0ut9JMQAORcwVZz1CxBHzeBmao=",
"h1:kmF//O539d7NuHU7qIxDj7Wz4eJmLKFiI5glwQivldU=", "h1:jqI2qKknpleS3JDSplyGYHMu0u9K/tor1ZOjFwDgEMk=",
"h1:s6XriaKwOgV4jvKAGPXkrxhhOQxpNU5dceZwi9Z/1k8=", "h1:kgfutDh14Q5nw4eg6qGFamFxIiY8Ae0FPKRBLDOzpcI=",
"h1:wt3WBEBAeSGTlC9OlnTlAALxRiK4SQgLy0KgBIS7qzs=", "h1:zCAO7GZmfYhWb+i6TfqlqhMeDyPZWGio2IzEzAh3YTs=",
"zh:2fb95e1d3229b9b6c704e1a413c7481c60f139780d9641f657b6eb9b633b90f2", "zh:19be1a91c982b902c42aba47766860dfa5dc151eed1e95fd39ca642229381ef0",
"zh:379c7680983383862236e9e6e720c3114195c40526172188e88d0ffcf50dfe2e", "zh:1de451c4d1ecf7efbe67b6dace3426ba810711afdd644b0f1b870364c8ae91f8",
"zh:55533beb6cfc02d22ffda8cba8027bc2c841bb172cd637ed0d28323d41395f8f", "zh:352b4a2120173298622e669258744554339d959ac3a95607b117a48ee4a83238",
"zh:5abd70760e4eb1f37a1c307cbd2989ea7c9ba0afb93818c67c1d363a31f75703", "zh:3c6f1346d9154afbd2d558fabb4b0150fc8d559aa961254144fe1bc17fe6032f",
"zh:699f1c8cd66129176fe659ebf0e6337632a8967a28d2630b6ae5948665c0c2ae", "zh:4c4c92d53fb535b1e0eff26f222bbd627b97d3b4c891ec9c321268676d06152f",
"zh:69c15acd73c451e89de6477059cda2f3ec200b48ae4b9ff3646c4d389fd3205e", "zh:53276f68006c9ceb7cdb10a6ccf91a5c1eadd1407a28edb5741e84e88d7e29e8",
"zh:6e02b687de21b844f8266dff99e93e7c61fc8eb688f4bbb23803caceb251839e", "zh:7925a97773948171a63d4f65bb81ee92fd6d07a447e36012977313293a5435c9",
"zh:7a51d17b87ed87b7bebf2ad9fc7c3a74f16a1b44eee92c779c08eb89258c0496", "zh:7dfb0a4496cfe032437386d0a2cd9229a1956e9c30bd920923c141b0f0440060",
"zh:88ad84436837b0f55302f22748505972634e87400d6902260fd6b7ba1610f937",
"zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f", "zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f",
"zh:8d46c3d9f4f7ad20ac6ef01daa63f4e30a2d16dcb1bb5c7c7ee3dc6be38e9ca1", "zh:8d4aa79f0a414bb4163d771063c70cd991c8fac6c766e685bac2ee12903c5bd6",
"zh:913d64e72a4929dae1d4793e2004f4f9a58b138ea337d9d94fa35cafbf06550a", "zh:a67540c13565616a7e7e51ee9366e88b0dc60046e1d75c72680e150bd02725bb",
"zh:c8d93cf86e2e49f6cec665cfe78b82c144cce15a8b2e30f343385fadd1251849", "zh:a936383a4767f5393f38f622e92bf2d0c03fe04b69c284951f27345766c7b31b",
"zh:cc4f69397d9bc34a528a5609a024c3a48f54f21616c0008792dd417297add955", "zh:d4887d73c466ff036eecf50ad6404ba38fd82ea4855296b1846d244b0f13c380",
"zh:df99cdb8b064aad35ffea77e645cf6541d0b1b2ebc51b6d26c42031de60ab69e", "zh:e9093c8bd5b6cd99c81666e315197791781b8f93afa14fc2e0f732d1bb2a44b7",
"zh:efd3b3f1ec59a37f635aa1d4efcf178734c2fcf8ddb0d56ea690bec342da8672",
] ]
} }

View File

@@ -5,7 +5,7 @@ terraform {
required_providers { required_providers {
cloudflare = { cloudflare = {
source = "cloudflare/cloudflare" source = "cloudflare/cloudflare"
version = "4.52.1" version = "4.52.0"
} }
} }
} }

View File

@@ -29,8 +29,8 @@ services:
volumes: volumes:
- ../server:/usr/src/app/server - ../server:/usr/src/app/server
- ../open-api:/usr/src/app/open-api - ../open-api:/usr/src/app/open-api
- ${UPLOAD_LOCATION}/photos:/data - ${UPLOAD_LOCATION}/photos:/usr/src/app/upload
- ${UPLOAD_LOCATION}/photos/upload:/data/upload - ${UPLOAD_LOCATION}/photos/upload:/usr/src/app/upload/upload
- /usr/src/app/server/node_modules - /usr/src/app/server/node_modules
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
env_file: env_file:
@@ -123,7 +123,7 @@ services:
database: database:
container_name: immich_postgres container_name: immich_postgres
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:5f6a838e4e44c8e0e019d0ebfe3ee8952b69afc2809b2c25f7b0119641978e91
env_file: env_file:
- .env - .env
environment: environment:

View File

@@ -20,7 +20,7 @@ services:
context: ../ context: ../
dockerfile: server/Dockerfile dockerfile: server/Dockerfile
volumes: volumes:
- ${UPLOAD_LOCATION}/photos:/data - ${UPLOAD_LOCATION}/photos:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
env_file: env_file:
- .env - .env
@@ -63,7 +63,7 @@ services:
database: database:
container_name: immich_postgres container_name: immich_postgres
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:5f6a838e4e44c8e0e019d0ebfe3ee8952b69afc2809b2c25f7b0119641978e91
env_file: env_file:
- .env - .env
environment: environment:

View File

@@ -18,7 +18,7 @@ services:
# service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
volumes: volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
- ${UPLOAD_LOCATION}:/data - ${UPLOAD_LOCATION}:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
env_file: env_file:
- .env - .env
@@ -56,7 +56,7 @@ services:
database: database:
container_name: immich_postgres container_name: immich_postgres
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:5f6a838e4e44c8e0e019d0ebfe3ee8952b69afc2809b2c25f7b0119641978e91
environment: environment:
POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME} POSTGRES_USER: ${DB_USERNAME}

View File

@@ -180,7 +180,7 @@ services:
... ...
volumes: volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
- ${UPLOAD_LOCATION}:/data - ${UPLOAD_LOCATION}:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
+ - originals:/usr/src/app/originals + - originals:/usr/src/app/originals
... ...

View File

@@ -94,16 +94,19 @@ Change media location
``` ```
immich-admin change-media-location immich-admin change-media-location
? Enter the previous value of IMMICH_MEDIA_LOCATION: /data ? Enter the previous value of IMMICH_MEDIA_LOCATION: /usr/src/app/upload
? Enter the new value of IMMICH_MEDIA_LOCATION: /my-data ? Enter the new value of IMMICH_MEDIA_LOCATION: /data
...
Previous value: /data
Current value: /my-data
Changing database paths from "/data/*" to "/my-data/*" Previous value: /usr/src/app/upload
Current value: /data
Changing database paths from "/usr/src/app/upload/*" to "/data/*"
? Do you want to proceed? [Y/n] y ? Do you want to proceed? [Y/n] y
Database file paths updated successfully! 🎉 Database file paths updated successfully! 🎉
...
You may now set IMMICH_MEDIA_LOCATION=/data and restart!
(please remember to update applicable volume mounts e.g. ${UPLOAD_LOCATION}:/data)
``` ```

View File

@@ -38,19 +38,6 @@ Run all server checks with `npm run check:all`
You can use `npm run __:fix` to potentially correct some issues automatically for `npm run format` and `lint`. You can use `npm run __:fix` to potentially correct some issues automatically for `npm run format` and `lint`.
::: :::
## Mobile Checks
The following commands must be executed from within the mobile app directory of the codebase.
- [ ] `make build` (auto-generate files using build_runner)
- [ ] `make analyze` (static analysis via Dart Analyzer and DCM)
- [ ] `make format` (formatting via Dart Formatter)
- [ ] `make test` (unit tests)
:::info Auto Fix
You can use `dart fix --apply` and `dcm fix lib` to potentially correct some issues automatically for `make analyze`.
:::
## OpenAPI ## OpenAPI
The OpenAPI client libraries need to be regenerated whenever there are changes to the `immich-openapi-specs.json` file. Note that you should not modify this file directly as it is auto-generated. See [OpenAPI](/docs/developer/open-api.md) for more details. The OpenAPI client libraries need to be regenerated whenever there are changes to the `immich-openapi-specs.json` file. Note that you should not modify this file directly as it is auto-generated. See [OpenAPI](/docs/developer/open-api.md) for more details.

View File

@@ -58,7 +58,7 @@ Internally, Immich uses the [glob](https://www.npmjs.com/package/glob) package t
This feature is considered experimental and for advanced users only. If enabled, it will allow automatic watching of the filesystem which means new assets are automatically imported to Immich without needing to rescan. This feature is considered experimental and for advanced users only. If enabled, it will allow automatic watching of the filesystem which means new assets are automatically imported to Immich without needing to rescan.
If your photos are on a network drive, automatic file watching likely won't work. In that case, you will have to rely on a [periodic library refresh](#set-custom-scan-interval) to pull in your changes. If your photos are on a network drive, automatic file watching likely won't work. In that case, you will have to rely on a periodic library refresh to pull in your changes.
#### Troubleshooting #### Troubleshooting
@@ -72,9 +72,7 @@ In rare cases, the library watcher can hang, preventing Immich from starting up.
### Nightly job ### Nightly job
There is an automatic scan job that is scheduled to run once a day. Its schedule is configurable, see [Set Custom Scan Interval](#set-custom-scan-interval). There is an automatic scan job that is scheduled to run once a day. This job also cleans up any libraries stuck in deletion. It is possible to trigger the cleanup by clicking "Scan all libraries" in the library management page.
This job also cleans up any libraries stuck in deletion. It is possible to trigger the cleanup by clicking "Scan all libraries" in the library management page.
## Usage ## Usage
@@ -93,7 +91,7 @@ The `immich-server` container will need access to the gallery. Modify your docke
```diff title="docker-compose.yml" ```diff title="docker-compose.yml"
immich-server: immich-server:
volumes: volumes:
- ${UPLOAD_LOCATION}:/data - ${UPLOAD_LOCATION}:/usr/src/app/upload
+ - /mnt/nas/christmas-trip:/mnt/media/christmas-trip:ro + - /mnt/nas/christmas-trip:/mnt/media/christmas-trip:ro
+ - /home/user/old-pics:/mnt/media/old-pics:ro + - /home/user/old-pics:/mnt/media/old-pics:ro
+ - /mnt/media/videos:/mnt/media/videos:ro + - /mnt/media/videos:/mnt/media/videos:ro

View File

@@ -27,11 +27,11 @@ After defining the locations of these files, we will edit the `docker-compose.ym
services: services:
immich-server: immich-server:
volumes: volumes:
- ${UPLOAD_LOCATION}:/data - ${UPLOAD_LOCATION}:/usr/src/app/upload
+ - ${THUMB_LOCATION}:/data/thumbs + - ${THUMB_LOCATION}:/usr/src/app/upload/thumbs
+ - ${ENCODED_VIDEO_LOCATION}:/data/encoded-video + - ${ENCODED_VIDEO_LOCATION}:/usr/src/app/upload/encoded-video
+ - ${PROFILE_LOCATION}:/data/profile + - ${PROFILE_LOCATION}:/usr/src/app/upload/profile
+ - ${BACKUP_LOCATION}:/data/backups + - ${BACKUP_LOCATION}:/usr/src/app/upload/backups
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
``` ```
@@ -44,7 +44,7 @@ docker compose up -d
:::note :::note
Because of the underlying properties of docker bind mounts, it is not recommended to mount the `upload/` and `library/` folders as separate bind mounts if they are on the same device. Because of the underlying properties of docker bind mounts, it is not recommended to mount the `upload/` and `library/` folders as separate bind mounts if they are on the same device.
For this reason, we mount the HDD or the network storage (NAS) to `/data` and then mount the folders we want to access under that folder. For this reason, we mount the HDD or the network storage (NAS) to `/usr/src/app/upload` and then mount the folders we want to access under that folder.
The `thumbs/` folder contains both the small thumbnails displayed in the timeline and the larger previews shown when clicking into an image. These cannot be separated. The `thumbs/` folder contains both the small thumbnails displayed in the timeline and the larger previews shown when clicking into an image. These cannot be separated.

View File

@@ -12,131 +12,105 @@ Run `docker exec -it immich_postgres psql --dbname=<DB_DATABASE_NAME> --username
## Assets ## Assets
### Name
:::note :::note
The `"originalFileName"` column is the name of the file at time of upload, including the extension. The `"originalFileName"` column is the name of the file at time of upload, including the extension.
::: :::
```sql title="Find by original filename" ```sql title="Find by original filename"
SELECT * FROM "asset" WHERE "originalFileName" = 'PXL_20230903_232542848.jpg'; SELECT * FROM "assets" WHERE "originalFileName" = 'PXL_20230903_232542848.jpg';
SELECT * FROM "asset" WHERE "originalFileName" LIKE 'PXL_%'; -- all files starting with PXL_ SELECT * FROM "assets" WHERE "originalFileName" LIKE 'PXL_%'; -- all files starting with PXL_
SELECT * FROM "asset" WHERE "originalFileName" LIKE '%_2023_%'; -- all files with _2023_ in the middle SELECT * FROM "assets" WHERE "originalFileName" LIKE '%_2023_%'; -- all files with _2023_ in the middle
``` ```
```sql title="Find by path" ```sql title="Find by path"
SELECT * FROM "asset" WHERE "originalPath" = 'upload/library/admin/2023/2023-09-03/PXL_2023.jpg'; SELECT * FROM "assets" WHERE "originalPath" = 'upload/library/admin/2023/2023-09-03/PXL_2023.jpg';
SELECT * FROM "asset" WHERE "originalPath" LIKE 'upload/library/admin/2023/%'; SELECT * FROM "assets" WHERE "originalPath" LIKE 'upload/library/admin/2023/%';
``` ```
### ID
```sql title="Find by ID" ```sql title="Find by ID"
SELECT * FROM "asset" WHERE "id" = '9f94e60f-65b6-47b7-ae44-a4df7b57f0e9'; SELECT * FROM "assets" WHERE "id" = '9f94e60f-65b6-47b7-ae44-a4df7b57f0e9';
``` ```
```sql title="Find by partial ID" ```sql title="Find by partial ID"
SELECT * FROM "asset" WHERE "id"::text LIKE '%ab431d3a%'; SELECT * FROM "assets" WHERE "id"::text LIKE '%ab431d3a%';
``` ```
### Checksum
:::note :::note
You can calculate the checksum for a particular file by using the command `sha1sum <filename>`. You can calculate the checksum for a particular file by using the command `sha1sum <filename>`.
::: :::
```sql title="Find by checksum (SHA-1)" ```sql title="Find by checksum (SHA-1)"
SELECT encode("checksum", 'hex') FROM "asset"; SELECT encode("checksum", 'hex') FROM "assets";
SELECT * FROM "asset" WHERE "checksum" = decode('69de19c87658c4c15d9cacb9967b8e033bf74dd1', 'hex'); SELECT * FROM "assets" WHERE "checksum" = decode('69de19c87658c4c15d9cacb9967b8e033bf74dd1', 'hex');
SELECT * FROM "asset" WHERE "checksum" = '\x69de19c87658c4c15d9cacb9967b8e033bf74dd1'; -- alternate notation SELECT * FROM "assets" WHERE "checksum" = '\x69de19c87658c4c15d9cacb9967b8e033bf74dd1'; -- alternate notation
``` ```
```sql title="Find duplicate assets with identical checksum (SHA-1) (excluding trashed files)" ```sql title="Find duplicate assets with identical checksum (SHA-1) (excluding trashed files)"
SELECT T1."checksum", array_agg(T2."id") ids FROM "asset" T1 SELECT T1."checksum", array_agg(T2."id") ids FROM "assets" T1
INNER JOIN "asset" T2 ON T1."checksum" = T2."checksum" AND T1."id" != T2."id" AND T2."deletedAt" IS NULL INNER JOIN "assets" T2 ON T1."checksum" = T2."checksum" AND T1."id" != T2."id" AND T2."deletedAt" IS NULL
WHERE T1."deletedAt" IS NULL GROUP BY T1."checksum"; WHERE T1."deletedAt" IS NULL GROUP BY T1."checksum";
``` ```
### Metadata
```sql title="Live photos" ```sql title="Live photos"
SELECT * FROM "asset" WHERE "livePhotoVideoId" IS NOT NULL; SELECT * FROM "assets" WHERE "livePhotoVideoId" IS NOT NULL;
``` ```
```sql title="By description" ```sql title="By description"
SELECT "asset".*, "asset_exif"."description" FROM "asset_exif" SELECT "assets".*, "exif"."description" FROM "exif"
JOIN "asset" ON "asset"."id" = "asset_exif"."assetId" JOIN "assets" ON "assets"."id" = "exif"."assetId"
WHERE TRIM("asset_exif"."description") <> ''; -- all files with a description WHERE TRIM("exif"."description") <> ''; -- all files with a description
SELECT "asset".*, "asset_exif"."description" FROM "asset_exif" SELECT "assets".*, "exif"."description" FROM "exif"
JOIN "asset" ON "asset"."id" = "asset_exif"."assetId" JOIN "assets" ON "assets"."id" = "exif"."assetId"
WHERE "asset_exif"."description" ILIKE '%string to match%'; -- search by string WHERE "exif"."description" ILIKE '%string to match%'; -- search by string
``` ```
```sql title="Without metadata" ```sql title="Without metadata"
SELECT "asset".* FROM "asset_exif" SELECT "assets".* FROM "exif"
LEFT JOIN "asset" ON "asset"."id" = "asset_exif"."assetId" LEFT JOIN "assets" ON "assets"."id" = "exif"."assetId"
WHERE "asset_exif"."assetId" IS NULL; WHERE "exif"."assetId" IS NULL;
``` ```
```sql title="size < 100,000 bytes, smallest to largest" ```sql title="size < 100,000 bytes, smallest to largest"
SELECT * FROM "asset" SELECT * FROM "assets"
JOIN "asset_exif" ON "asset"."id" = "asset_exif"."assetId" JOIN "exif" ON "assets"."id" = "exif"."assetId"
WHERE "asset_exif"."fileSizeInByte" < 100000 WHERE "exif"."fileSizeInByte" < 100000
ORDER BY "asset_exif"."fileSizeInByte" ASC; ORDER BY "exif"."fileSizeInByte" ASC;
``` ```
### Type ```sql title="Without thumbnails"
SELECT * FROM "assets" WHERE "assets"."previewPath" IS NULL OR "assets"."thumbnailPath" IS NULL;
```
```sql title="By type" ```sql title="By type"
SELECT * FROM "asset" WHERE "asset"."type" = 'VIDEO'; SELECT * FROM "assets" WHERE "assets"."type" = 'VIDEO';
SELECT * FROM "asset" WHERE "asset"."type" = 'IMAGE'; SELECT * FROM "assets" WHERE "assets"."type" = 'IMAGE';
``` ```
```sql title="Count by type" ```sql title="Count by type"
SELECT "asset"."type", COUNT(*) FROM "asset" GROUP BY "asset"."type"; SELECT "assets"."type", COUNT(*) FROM "assets" GROUP BY "assets"."type";
``` ```
```sql title="Count by type (per user)" ```sql title="Count by type (per user)"
SELECT "user"."email", "asset"."type", COUNT(*) FROM "asset" SELECT "users"."email", "assets"."type", COUNT(*) FROM "assets"
JOIN "user" ON "asset"."ownerId" = "user"."id" JOIN "users" ON "assets"."ownerId" = "users"."id"
GROUP BY "asset"."type", "user"."email" ORDER BY "user"."email"; GROUP BY "assets"."type", "users"."email" ORDER BY "users"."email";
``` ```
## Tags ```sql title="Failed file movements"
SELECT * FROM "move_history";
```sql title="Count by tag"
SELECT "t"."value" AS "tag_name", COUNT(*) AS "number_assets" FROM "tag" "t"
JOIN "tag_asset" "ta" ON "t"."id" = "ta"."tagsId" JOIN "asset" "a" ON "ta"."assetsId" = "a"."id"
WHERE "a"."visibility" != 'hidden'
GROUP BY "t"."value" ORDER BY "number_assets" DESC;
```
```sql title="Count by tag (per user)"
SELECT "t"."value" AS "tag_name", "u"."email" as "user_email", COUNT(*) AS "number_assets" FROM "tag" "t"
JOIN "tag_asset" "ta" ON "t"."id" = "ta"."tagsId" JOIN "asset" "a" ON "ta"."assetsId" = "a"."id" JOIN "user" "u" ON "a"."ownerId" = "u"."id"
WHERE "a"."visibility" != 'hidden'
GROUP BY "t"."value", "u"."email" ORDER BY "number_assets" DESC;
``` ```
## Users ## Users
```sql title="List all users" ```sql title="List all users"
SELECT * FROM "user"; SELECT * FROM "users";
``` ```
```sql title="Get owner info from asset ID" ```sql title="Get owner info from asset ID"
SELECT "user".* FROM "user" JOIN "asset" ON "user"."id" = "asset"."ownerId" WHERE "asset"."id" = 'fa310b01-2f26-4b7a-9042-d578226e021f'; SELECT "users".* FROM "users" JOIN "assets" ON "users"."id" = "assets"."ownerId" WHERE "assets"."id" = 'fa310b01-2f26-4b7a-9042-d578226e021f';
``` ```
## Persons ## System Config
```sql title="Delete person and unset it for the faces it was associated with"
DELETE FROM "person" WHERE "name" = 'PersonNameHere';
```
## System
### Config
```sql title="Custom settings" ```sql title="Custom settings"
SELECT "key", "value" FROM "system_metadata" WHERE "key" = 'system-config'; SELECT "key", "value" FROM "system_metadata" WHERE "key" = 'system-config';
@@ -144,14 +118,10 @@ SELECT "key", "value" FROM "system_metadata" WHERE "key" = 'system-config';
(Only used when not using the [config file](/docs/install/config-file)) (Only used when not using the [config file](/docs/install/config-file))
### File properties ## Persons
```sql title="Without thumbnails" ```sql title="Delete person and unset it for the faces it was associated with"
SELECT * FROM "asset" WHERE "asset"."previewPath" IS NULL OR "asset"."thumbnailPath" IS NULL; DELETE FROM "person" WHERE "name" = 'PersonNameHere';
```
```sql title="Failed file movements"
SELECT * FROM "move_history";
``` ```
## Postgres internal ## Postgres internal

View File

@@ -12,7 +12,7 @@ If you want Immich to be able to delete the images in the external library or ad
```diff ```diff
immich-server: immich-server:
volumes: volumes:
- ${UPLOAD_LOCATION}:/data - ${UPLOAD_LOCATION}:/usr/src/app/upload
+ - /home/user/photos1:/home/user/photos1:ro + - /home/user/photos1:/home/user/photos1:ro
+ - /mnt/photos2:/mnt/photos2:ro # you can delete this line if you only have one mount point, or you can add more lines if you have more than two + - /mnt/photos2:/mnt/photos2:ro # you can delete this line if you only have one mount point, or you can add more lines if you have more than two
``` ```

View File

@@ -29,26 +29,29 @@ These environment variables are used by the `docker-compose.yml` file and do **N
## General ## General
| Variable | Description | Default | Containers | Workers | | Variable | Description | Default | Containers | Workers |
| :---------------------------------- | :---------------------------------------------------------------------------------------- | :--------------------------: | :----------------------- | :----------------- | | :---------------------------------- | :---------------------------------------------------------------------------------------- | :---------------------------------: | :----------------------- | :----------------- |
| `TZ` | Timezone | <sup>\*1</sup> | server | microservices | | `TZ` | Timezone | <sup>\*1</sup> | server | microservices |
| `IMMICH_ENV` | Environment (production, development) | `production` | server, machine learning | api, microservices | | `IMMICH_ENV` | Environment (production, development) | `production` | server, machine learning | api, microservices |
| `IMMICH_LOG_LEVEL` | Log level (verbose, debug, log, warn, error) | `log` | server, machine learning | api, microservices | | `IMMICH_LOG_LEVEL` | Log level (verbose, debug, log, warn, error) | `log` | server, machine learning | api, microservices |
| `IMMICH_MEDIA_LOCATION` | Media location inside the container ⚠️**You probably shouldn't set this**<sup>\*2</sup>⚠️ | `/data` | server | api, microservices | | `IMMICH_MEDIA_LOCATION` | Media location inside the container ⚠️**You probably shouldn't set this**<sup>\*2</sup>⚠️ | `/usr/src/app/upload`<sup>\*3</sup> | server | api, microservices |
| `IMMICH_CONFIG_FILE` | Path to config file | | server | api, microservices | | `IMMICH_CONFIG_FILE` | Path to config file | | server | api, microservices |
| `NO_COLOR` | Set to `true` to disable color-coded log output | `false` | server, machine learning | | | `NO_COLOR` | Set to `true` to disable color-coded log output | `false` | server, machine learning | |
| `CPU_CORES` | Number of cores available to the Immich server | auto-detected CPU core count | server | | | `CPU_CORES` | Number of cores available to the Immich server | auto-detected CPU core count | server | |
| `IMMICH_API_METRICS_PORT` | Port for the OTEL metrics | `8081` | server | api | | `IMMICH_API_METRICS_PORT` | Port for the OTEL metrics | `8081` | server | api |
| `IMMICH_MICROSERVICES_METRICS_PORT` | Port for the OTEL metrics | `8082` | server | microservices | | `IMMICH_MICROSERVICES_METRICS_PORT` | Port for the OTEL metrics | `8082` | server | microservices |
| `IMMICH_PROCESS_INVALID_IMAGES` | When `true`, generate thumbnails for invalid images | | server | microservices | | `IMMICH_PROCESS_INVALID_IMAGES` | When `true`, generate thumbnails for invalid images | | server | microservices |
| `IMMICH_TRUSTED_PROXIES` | List of comma-separated IPs set as trusted proxies | | server | api | | `IMMICH_TRUSTED_PROXIES` | List of comma-separated IPs set as trusted proxies | | server | api |
| `IMMICH_IGNORE_MOUNT_CHECK_ERRORS` | See [System Integrity](/docs/administration/system-integrity) | | server | api, microservices | | `IMMICH_IGNORE_MOUNT_CHECK_ERRORS` | See [System Integrity](/docs/administration/system-integrity) | | server | api, microservices |
\*1: `TZ` should be set to a `TZ identifier` from [this list][tz-list]. For example, `TZ="Etc/UTC"`. \*1: `TZ` should be set to a `TZ identifier` from [this list][tz-list]. For example, `TZ="Etc/UTC"`.
`TZ` is used by `exiftool` as a fallback in case the timezone cannot be determined from the image metadata. It is also used for logfile timestamps and cron job execution. `TZ` is used by `exiftool` as a fallback in case the timezone cannot be determined from the image metadata. It is also used for logfile timestamps and cron job execution.
\*2: This path is where the Immich code looks for the files, which is internal to the docker container. Setting it to a path on your host will certainly break things, you should use the `UPLOAD_LOCATION` variable instead. \*2: This path is where the Immich code looks for the files, which is internal to the docker container. Setting it to a path on your host will certainly break things, you should use the `UPLOAD_LOCATION` variable instead.
\*3: With the default `WORKDIR` of `/usr/src/app`, this path will resolve to `/usr/src/app/upload`.
It only needs to be set if the Immich deployment method is changing.
## Workers ## Workers
| Variable | Description | Default | Containers | | Variable | Description | Default | Containers |
@@ -199,11 +202,12 @@ Additional machine learning parameters can be tuned from the admin UI.
| `IMMICH_TELEMETRY_INCLUDE` | Collect these telemetries. List of `host`, `api`, `io`, `repo`, `job`. Note: You can also specify `all` to enable all | | server | api, microservices | | `IMMICH_TELEMETRY_INCLUDE` | Collect these telemetries. List of `host`, `api`, `io`, `repo`, `job`. Note: You can also specify `all` to enable all | | server | api, microservices |
| `IMMICH_TELEMETRY_EXCLUDE` | Do not collect these telemetries. List of `host`, `api`, `io`, `repo`, `job` | | server | api, microservices | | `IMMICH_TELEMETRY_EXCLUDE` | Do not collect these telemetries. List of `host`, `api`, `io`, `repo`, `job` | | server | api, microservices |
## Secrets ## Docker Secrets
The following variables support reading from files, either via [Systemd Credentials][systemd-creds] or [Docker secrets][docker-secrets] for additional security. The following variables support the use of [Docker secrets][docker-secrets] for additional security.
To use any of these, either set `CREDENTIALS_DIRECTORY` to a directory that contains files whose name is the regular variable” name, and whose content is the secret. If using Docker Secrets, setting `CREDENTIALS_DIRECTORY=/run/secrets` will cause all secrets present to be used. Alternatively, replace the regular variable with the equivalent `_FILE` environment variable as below. The value of the `_FILE` variable should be set to the path of a file containing the variable value. To use any of these, replace the regular environment variable with the equivalent `_FILE` environment variable. The value of
the `_FILE` variable should be set to the path of a file containing the variable value.
| Regular Variable | Equivalent Docker Secrets '\_FILE' Variable | | Regular Variable | Equivalent Docker Secrets '\_FILE' Variable |
| :----------------- | :------------------------------------------ | | :----------------- | :------------------------------------------ |
@@ -225,4 +229,3 @@ to use a Docker secret for the password in the Redis container.
[docker-secrets-docs]: https://github.com/docker-library/docs/tree/master/postgres#docker-secrets [docker-secrets-docs]: https://github.com/docker-library/docs/tree/master/postgres#docker-secrets
[docker-secrets]: https://docs.docker.com/engine/swarm/secrets/ [docker-secrets]: https://docs.docker.com/engine/swarm/secrets/
[ioredis]: https://ioredis.readthedocs.io/en/latest/README/#connect-to-redis [ioredis]: https://ioredis.readthedocs.io/en/latest/README/#connect-to-redis
[systemd-creds]: https://systemd.io/CREDENTIALS/

View File

@@ -100,11 +100,6 @@ const projects: CommunityProjectProps[] = [
description: 'Automatically optimize files uploaded to Immich in order to save storage space', description: 'Automatically optimize files uploaded to Immich in order to save storage space',
url: 'https://github.com/miguelangel-nubla/immich-upload-optimizer', url: 'https://github.com/miguelangel-nubla/immich-upload-optimizer',
}, },
{
title: 'Immich Machine Learning Load Balancer',
description: 'Speed up your machine learning by load balancing your requests to multiple computers',
url: 'https://github.com/apetersson/immich_ml_balancer',
},
]; ];
function CommunityProject({ title, description, url }: CommunityProjectProps): JSX.Element { function CommunityProject({ title, description, url }: CommunityProjectProps): JSX.Element {

View File

@@ -2,23 +2,4 @@
## TypeORM Upgrade ## TypeORM Upgrade
In order to update to Immich to `v1.137.0` (or above), the application must be started at least once on a version in the range between `1.132.0` and `1.136.0`. Doing so will complete database schema upgrades that are required for `v1.137.0` (and above). After Immich has successfully updated to a version in this range, you can now attempt to update to v1.137.0 (or above). We recommend users upgrade to `1.132.0` since it does not have any other breaking changes. The upgrade to Immich `v2.x.x` has a required upgrade path to `v1.132.0+`. This means it is required to start up the application at least once on version `1.132.0` (or later). Doing so will complete database schema upgrades that are required for `v2.0.0`. After Immich has successfully booted on this version, shut the system down and try the `v2.x.x` upgrade again.
## Inconsistent Media Location
:::caution
This error is related to the location of media files _inside the container_. Never move files on the host system when you run into this error message.
:::
Immich automatically tries to detect where your Immich data is located. On start up, it compares the detected media location with the file paths in the database and throws an Inconsistent Media Location error when they do not match.
To fix this issue, verify that the `IMMICH_MEDIA_LOCATION` environment variable and `UPLOAD_LOCATION` volume mount are in sync with the database paths.
If you would like to migrate from one media location to another, simply successfully start Immich on `v1.136.0` or later, then do the following steps:
1. Stop Immich
2. Update `IMMICH_MEDIA_LOCATION` to the new location
3. Update the right-hand side of the `UPLOAD_LOCATION` volume mount to the new location
4. Start up Immich
After version `1.136.0`, Immich can detect when a media location has moved and will automatically update the database paths to keep them in sync.

View File

@@ -1,8 +1,4 @@
[ [
{
"label": "v1.136.0",
"url": "https://v1.136.0.archive.immich.app"
},
{ {
"label": "v1.135.3", "label": "v1.135.3",
"url": "https://v1.135.3.archive.immich.app" "url": "https://v1.135.3.archive.immich.app"

View File

@@ -38,7 +38,7 @@ services:
image: redis:6.2-alpine@sha256:7fe72c486b910f6b1a9769c937dad5d63648ddee82e056f47417542dd40825bb image: redis:6.2-alpine@sha256:7fe72c486b910f6b1a9769c937dad5d63648ddee82e056f47417542dd40825bb
database: database:
image: ghcr.io/immich-app/postgres:14-vectorchord0.3.0@sha256:0e763a2383d56f90364fcd72767ac41400cd30d2627f407f7e7960c9f1923c21 image: ghcr.io/immich-app/postgres:14-vectorchord0.3.0@sha256:3aef84a0a4fabbda17ef115c3019ba0c914ec73e9f6e59203674322d858b8eea
command: -c fsync=off -c shared_preload_libraries=vchord.so -c config_file=/var/lib/postgresql/data/postgresql.conf command: -c fsync=off -c shared_preload_libraries=vchord.so -c config_file=/var/lib/postgresql/data/postgresql.conf
environment: environment:
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: postgres

189
e2e/package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "immich-e2e", "name": "immich-e2e",
"version": "1.136.0", "version": "1.135.3",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "immich-e2e", "name": "immich-e2e",
"version": "1.136.0", "version": "1.135.3",
"license": "GNU Affero General Public License version 3", "license": "GNU Affero General Public License version 3",
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3.1.0", "@eslint/eslintrc": "^3.1.0",
@@ -16,14 +16,14 @@
"@playwright/test": "^1.44.1", "@playwright/test": "^1.44.1",
"@socket.io/component-emitter": "^3.1.2", "@socket.io/component-emitter": "^3.1.2",
"@types/luxon": "^3.4.2", "@types/luxon": "^3.4.2",
"@types/node": "^22.16.5", "@types/node": "^22.16.4",
"@types/oidc-provider": "^9.0.0", "@types/oidc-provider": "^9.0.0",
"@types/pg": "^8.15.1", "@types/pg": "^8.15.1",
"@types/pngjs": "^6.0.4", "@types/pngjs": "^6.0.4",
"@types/supertest": "^6.0.2", "@types/supertest": "^6.0.2",
"@vitest/coverage-v8": "^3.0.0", "@vitest/coverage-v8": "^3.0.0",
"eslint": "^9.14.0", "eslint": "^9.14.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.0.0",
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unicorn": "^59.0.0", "eslint-plugin-unicorn": "^59.0.0",
"exiftool-vendored": "^28.3.1", "exiftool-vendored": "^28.3.1",
@@ -46,7 +46,7 @@
}, },
"../cli": { "../cli": {
"name": "@immich/cli", "name": "@immich/cli",
"version": "2.2.73", "version": "2.2.72",
"dev": true, "dev": true,
"license": "GNU Affero General Public License version 3", "license": "GNU Affero General Public License version 3",
"dependencies": { "dependencies": {
@@ -68,13 +68,13 @@
"@types/lodash-es": "^4.17.12", "@types/lodash-es": "^4.17.12",
"@types/micromatch": "^4.0.9", "@types/micromatch": "^4.0.9",
"@types/mock-fs": "^4.13.1", "@types/mock-fs": "^4.13.1",
"@types/node": "^22.16.5", "@types/node": "^22.16.4",
"@vitest/coverage-v8": "^3.0.0", "@vitest/coverage-v8": "^3.0.0",
"byte-size": "^9.0.0", "byte-size": "^9.0.0",
"cli-progress": "^3.12.0", "cli-progress": "^3.12.0",
"commander": "^12.0.0", "commander": "^12.0.0",
"eslint": "^9.14.0", "eslint": "^9.14.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.0.0",
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unicorn": "^59.0.0", "eslint-plugin-unicorn": "^59.0.0",
"globals": "^16.0.0", "globals": "^16.0.0",
@@ -95,14 +95,14 @@
}, },
"../open-api/typescript-sdk": { "../open-api/typescript-sdk": {
"name": "@immich/sdk", "name": "@immich/sdk",
"version": "1.136.0", "version": "1.135.3",
"dev": true, "dev": true,
"license": "GNU Affero General Public License version 3", "license": "GNU Affero General Public License version 3",
"dependencies": { "dependencies": {
"@oazapfts/runtime": "^1.0.2" "@oazapfts/runtime": "^1.0.2"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^22.16.5", "@types/node": "^22.16.4",
"typescript": "^5.3.3" "typescript": "^5.3.3"
} }
}, },
@@ -2125,17 +2125,17 @@
} }
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.37.0.tgz",
"integrity": "sha512-CPoznzpuAnIOl4nhj4tRr4gIPj5AfKgkiJmGQDaq+fQnRJTYlcBjbX3wbciGmpoPf8DREufuPRe1tNMZnGdanA==", "integrity": "sha512-jsuVWeIkb6ggzB+wPCsR4e6loj+rM72ohW6IBn2C+5NCvfUVY8s33iFPySSVXqtm5Hu29Ne/9bnA0JmyLmgenA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.10.0", "@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "8.38.0", "@typescript-eslint/scope-manager": "8.37.0",
"@typescript-eslint/type-utils": "8.38.0", "@typescript-eslint/type-utils": "8.37.0",
"@typescript-eslint/utils": "8.38.0", "@typescript-eslint/utils": "8.37.0",
"@typescript-eslint/visitor-keys": "8.38.0", "@typescript-eslint/visitor-keys": "8.37.0",
"graphemer": "^1.4.0", "graphemer": "^1.4.0",
"ignore": "^7.0.0", "ignore": "^7.0.0",
"natural-compare": "^1.4.0", "natural-compare": "^1.4.0",
@@ -2149,7 +2149,7 @@
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"@typescript-eslint/parser": "^8.38.0", "@typescript-eslint/parser": "^8.37.0",
"eslint": "^8.57.0 || ^9.0.0", "eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <5.9.0" "typescript": ">=4.8.4 <5.9.0"
} }
@@ -2165,16 +2165,16 @@
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.37.0.tgz",
"integrity": "sha512-Zhy8HCvBUEfBECzIl1PKqF4p11+d0aUJS1GeUiuqK9WmOug8YCmC4h4bjyBvMyAMI9sbRczmrYL5lKg/YMbrcQ==", "integrity": "sha512-kVIaQE9vrN9RLCQMQ3iyRlVJpTiDUY6woHGb30JDkfJErqrQEmtdWH3gV0PBAfGZgQXoqzXOO0T3K6ioApbbAA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "8.38.0", "@typescript-eslint/scope-manager": "8.37.0",
"@typescript-eslint/types": "8.38.0", "@typescript-eslint/types": "8.37.0",
"@typescript-eslint/typescript-estree": "8.38.0", "@typescript-eslint/typescript-estree": "8.37.0",
"@typescript-eslint/visitor-keys": "8.38.0", "@typescript-eslint/visitor-keys": "8.37.0",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
@@ -2190,14 +2190,14 @@
} }
}, },
"node_modules/@typescript-eslint/project-service": { "node_modules/@typescript-eslint/project-service": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.37.0.tgz",
"integrity": "sha512-dbK7Jvqcb8c9QfH01YB6pORpqX1mn5gDZc9n63Ak/+jD67oWXn3Gs0M6vddAN+eDXBCS5EmNWzbSxsn9SzFWWg==", "integrity": "sha512-BIUXYsbkl5A1aJDdYJCBAo8rCEbAvdquQ8AnLb6z5Lp1u3x5PNgSSx9A/zqYc++Xnr/0DVpls8iQ2cJs/izTXA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.38.0", "@typescript-eslint/tsconfig-utils": "^8.37.0",
"@typescript-eslint/types": "^8.38.0", "@typescript-eslint/types": "^8.37.0",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
@@ -2212,14 +2212,14 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.37.0.tgz",
"integrity": "sha512-WJw3AVlFFcdT9Ri1xs/lg8LwDqgekWXWhH3iAF+1ZM+QPd7oxQ6jvtW/JPwzAScxitILUIFs0/AnQ/UWHzbATQ==", "integrity": "sha512-0vGq0yiU1gbjKob2q691ybTg9JX6ShiVXAAfm2jGf3q0hdP6/BruaFjL/ManAR/lj05AvYCH+5bbVo0VtzmjOA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.38.0", "@typescript-eslint/types": "8.37.0",
"@typescript-eslint/visitor-keys": "8.38.0" "@typescript-eslint/visitor-keys": "8.37.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2230,9 +2230,9 @@
} }
}, },
"node_modules/@typescript-eslint/tsconfig-utils": { "node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.37.0.tgz",
"integrity": "sha512-Lum9RtSE3EroKk/bYns+sPOodqb2Fv50XOl/gMviMKNvanETUuUcC9ObRbzrJ4VSd2JalPqgSAavwrPiPvnAiQ==", "integrity": "sha512-1/YHvAVTimMM9mmlPvTec9NP4bobA1RkDbMydxG8omqwJJLEW/Iy2C4adsAESIXU3WGLXFHSZUU+C9EoFWl4Zg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -2247,15 +2247,15 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.37.0.tgz",
"integrity": "sha512-c7jAvGEZVf0ao2z+nnz8BUaHZD09Agbh+DY7qvBQqLiz8uJzRgVPj5YvOh8I8uEiH8oIUGIfHzMwUcGVco/SJg==", "integrity": "sha512-SPkXWIkVZxhgwSwVq9rqj/4VFo7MnWwVaRNznfQDc/xPYHjXnPfLWn+4L6FF1cAz6e7dsqBeMawgl7QjUMj4Ow==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.38.0", "@typescript-eslint/types": "8.37.0",
"@typescript-eslint/typescript-estree": "8.38.0", "@typescript-eslint/typescript-estree": "8.37.0",
"@typescript-eslint/utils": "8.38.0", "@typescript-eslint/utils": "8.37.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"ts-api-utils": "^2.1.0" "ts-api-utils": "^2.1.0"
}, },
@@ -2272,9 +2272,9 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.37.0.tgz",
"integrity": "sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==", "integrity": "sha512-ax0nv7PUF9NOVPs+lmQ7yIE7IQmAf8LGcXbMvHX5Gm+YJUYNAl340XkGnrimxZ0elXyoQJuN5sbg6C4evKA4SQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -2286,16 +2286,16 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.37.0.tgz",
"integrity": "sha512-fooELKcAKzxux6fA6pxOflpNS0jc+nOQEEOipXFNjSlBS6fqrJOVY/whSn70SScHrcJ2LDsxWrneFoWYSVfqhQ==", "integrity": "sha512-zuWDMDuzMRbQOM+bHyU4/slw27bAUEcKSKKs3hcv2aNnc/tvE/h7w60dwVw8vnal2Pub6RT1T7BI8tFZ1fE+yg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/project-service": "8.38.0", "@typescript-eslint/project-service": "8.37.0",
"@typescript-eslint/tsconfig-utils": "8.38.0", "@typescript-eslint/tsconfig-utils": "8.37.0",
"@typescript-eslint/types": "8.38.0", "@typescript-eslint/types": "8.37.0",
"@typescript-eslint/visitor-keys": "8.38.0", "@typescript-eslint/visitor-keys": "8.37.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"fast-glob": "^3.3.2", "fast-glob": "^3.3.2",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
@@ -2341,16 +2341,16 @@
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.37.0.tgz",
"integrity": "sha512-hHcMA86Hgt+ijJlrD8fX0j1j8w4C92zue/8LOPAFioIno+W0+L7KqE8QZKCcPGc/92Vs9x36w/4MPTJhqXdyvg==", "integrity": "sha512-TSFvkIW6gGjN2p6zbXo20FzCABbyUAuq6tBvNRGsKdsSQ6a7rnV6ADfZ7f4iI3lIiXc4F4WWvtUfDw9CJ9pO5A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.7.0", "@eslint-community/eslint-utils": "^4.7.0",
"@typescript-eslint/scope-manager": "8.38.0", "@typescript-eslint/scope-manager": "8.37.0",
"@typescript-eslint/types": "8.38.0", "@typescript-eslint/types": "8.37.0",
"@typescript-eslint/typescript-estree": "8.38.0" "@typescript-eslint/typescript-estree": "8.37.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2365,13 +2365,13 @@
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.38.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.37.0.tgz",
"integrity": "sha512-pWrTcoFNWuwHlA9CvlfSsGWs14JxfN1TH25zM5L7o0pRLhsoZkDnTsXfQRJBEWJoV5DL0jf+Z+sxiud+K0mq1g==", "integrity": "sha512-YzfhzcTnZVPiLfP/oeKtDp2evwvHLMe0LOy7oe+hb9KKIumLNohYS9Hgp1ifwpu42YWxhZE8yieggz6JpqO/1w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.38.0", "@typescript-eslint/types": "8.37.0",
"eslint-visitor-keys": "^4.2.1" "eslint-visitor-keys": "^4.2.1"
}, },
"engines": { "engines": {
@@ -3525,9 +3525,9 @@
} }
}, },
"node_modules/eslint-config-prettier": { "node_modules/eslint-config-prettier": {
"version": "10.1.8", "version": "10.1.5",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz",
"integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "integrity": "sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"bin": { "bin": {
@@ -3541,9 +3541,9 @@
} }
}, },
"node_modules/eslint-plugin-prettier": { "node_modules/eslint-plugin-prettier": {
"version": "5.5.3", "version": "5.5.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.3.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.1.tgz",
"integrity": "sha512-NAdMYww51ehKfDyDhv59/eIItUVzU0Io9H2E8nHNGKEeeqlnci+1gCvrHib6EmZdf6GxF+LCV5K7UC65Ezvw7w==", "integrity": "sha512-dobTkHT6XaEVOo8IO90Q4DOSxnm3Y151QxPJlM/vKC0bVy+d6cVWQZLlFiuZPP0wS6vZwSKeJgKkcS+KfMBlRw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -3983,16 +3983,15 @@
} }
}, },
"node_modules/form-data": { "node_modules/form-data": {
"version": "4.0.4", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz",
"integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"asynckit": "^0.4.0", "asynckit": "^0.4.0",
"combined-stream": "^1.0.8", "combined-stream": "^1.0.8",
"es-set-tostringtag": "^2.1.0", "es-set-tostringtag": "^2.1.0",
"hasown": "^2.0.2",
"mime-types": "^2.1.12" "mime-types": "^2.1.12"
}, },
"engines": { "engines": {
@@ -5709,15 +5708,15 @@
} }
}, },
"node_modules/prettier-plugin-organize-imports": { "node_modules/prettier-plugin-organize-imports": {
"version": "4.2.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.2.0.tgz", "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.1.0.tgz",
"integrity": "sha512-Zdy27UhlmyvATZi67BTnLcKTo8fm6Oik59Sz6H64PgZJVs6NJpPD1mT240mmJn62c98/QaL+r3kx9Q3gRpDajg==", "integrity": "sha512-5aWRdCgv645xaa58X8lOxzZoiHAldAPChljr/MT0crXVOWTZ+Svl4hIWlz+niYSlO6ikE5UXkN1JrRvIP2ut0A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peerDependencies": { "peerDependencies": {
"prettier": ">=2.0", "prettier": ">=2.0",
"typescript": ">=2.9", "typescript": ">=2.9",
"vue-tsc": "^2.1.0 || 3" "vue-tsc": "^2.1.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"vue-tsc": { "vue-tsc": {
@@ -6470,35 +6469,35 @@
} }
}, },
"node_modules/superagent": { "node_modules/superagent": {
"version": "10.2.3", "version": "10.2.2",
"resolved": "https://registry.npmjs.org/superagent/-/superagent-10.2.3.tgz", "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.2.2.tgz",
"integrity": "sha512-y/hkYGeXAj7wUMjxRbB21g/l6aAEituGXM9Rwl4o20+SX3e8YOSV6BxFXl+dL3Uk0mjSL3kCbNkwURm8/gEDig==", "integrity": "sha512-vWMq11OwWCC84pQaFPzF/VO3BrjkCeewuvJgt1jfV0499Z1QSAWN4EqfMM5WlFDDX9/oP8JjlDKpblrmEoyu4Q==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"component-emitter": "^1.3.1", "component-emitter": "^1.3.0",
"cookiejar": "^2.1.4", "cookiejar": "^2.1.4",
"debug": "^4.3.7", "debug": "^4.3.4",
"fast-safe-stringify": "^2.1.1", "fast-safe-stringify": "^2.1.1",
"form-data": "^4.0.4", "form-data": "^4.0.0",
"formidable": "^3.5.4", "formidable": "^3.5.4",
"methods": "^1.1.2", "methods": "^1.1.2",
"mime": "2.6.0", "mime": "2.6.0",
"qs": "^6.11.2" "qs": "^6.11.0"
}, },
"engines": { "engines": {
"node": ">=14.18.0" "node": ">=14.18.0"
} }
}, },
"node_modules/supertest": { "node_modules/supertest": {
"version": "7.1.4", "version": "7.1.3",
"resolved": "https://registry.npmjs.org/supertest/-/supertest-7.1.4.tgz", "resolved": "https://registry.npmjs.org/supertest/-/supertest-7.1.3.tgz",
"integrity": "sha512-tjLPs7dVyqgItVFirHYqe2T+MfWc2VOBQ8QFKKbWTA3PU7liZR8zoSpAi/C1k1ilm9RsXIKYf197oap9wXGVYg==", "integrity": "sha512-ORY0gPa6ojmg/C74P/bDoS21WL6FMXq5I8mawkEz30/zkwdu0gOeqstFy316vHG6OKxqQ+IbGneRemHI8WraEw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"methods": "^1.1.2", "methods": "^1.1.2",
"superagent": "^10.2.3" "superagent": "^10.2.2"
}, },
"engines": { "engines": {
"node": ">=14.18.0" "node": ">=14.18.0"
@@ -6818,16 +6817,16 @@
} }
}, },
"node_modules/typescript-eslint": { "node_modules/typescript-eslint": {
"version": "8.38.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.38.0.tgz", "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.37.0.tgz",
"integrity": "sha512-FsZlrYK6bPDGoLeZRuvx2v6qrM03I0U0SnfCLPs/XCCPCFD80xU9Pg09H/K+XFa68uJuZo7l/Xhs+eDRg2l3hg==", "integrity": "sha512-TnbEjzkE9EmcO0Q2zM+GE8NQLItNAJpMmED1BdgoBMYNdqMhzlbqfdSwiRlAzEK2pA9UzVW0gzaaIzXWg2BjfA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/eslint-plugin": "8.38.0", "@typescript-eslint/eslint-plugin": "8.37.0",
"@typescript-eslint/parser": "8.38.0", "@typescript-eslint/parser": "8.37.0",
"@typescript-eslint/typescript-estree": "8.38.0", "@typescript-eslint/typescript-estree": "8.37.0",
"@typescript-eslint/utils": "8.38.0" "@typescript-eslint/utils": "8.37.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"

View File

@@ -1,6 +1,6 @@
{ {
"name": "immich-e2e", "name": "immich-e2e",
"version": "1.136.0", "version": "1.135.3",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"type": "module", "type": "module",
@@ -26,14 +26,14 @@
"@playwright/test": "^1.44.1", "@playwright/test": "^1.44.1",
"@socket.io/component-emitter": "^3.1.2", "@socket.io/component-emitter": "^3.1.2",
"@types/luxon": "^3.4.2", "@types/luxon": "^3.4.2",
"@types/node": "^22.16.5", "@types/node": "^22.16.4",
"@types/oidc-provider": "^9.0.0", "@types/oidc-provider": "^9.0.0",
"@types/pg": "^8.15.1", "@types/pg": "^8.15.1",
"@types/pngjs": "^6.0.4", "@types/pngjs": "^6.0.4",
"@types/supertest": "^6.0.2", "@types/supertest": "^6.0.2",
"@vitest/coverage-v8": "^3.0.0", "@vitest/coverage-v8": "^3.0.0",
"eslint": "^9.14.0", "eslint": "^9.14.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.0.0",
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unicorn": "^59.0.0", "eslint-plugin-unicorn": "^59.0.0",
"exiftool-vendored": "^28.3.1", "exiftool-vendored": "^28.3.1",

View File

@@ -470,7 +470,7 @@ describe('/albums', () => {
.send({ ids: [asset.id] }); .send({ ids: [asset.id] });
expect(status).toBe(400); expect(status).toBe(400);
expect(body).toEqual(errorDto.badRequest('Not found or no albumAsset.create access')); expect(body).toEqual(errorDto.badRequest('Not found or no album.addAsset access'));
}); });
it('should add duplicate assets only once', async () => { it('should add duplicate assets only once', async () => {
@@ -599,7 +599,7 @@ describe('/albums', () => {
.send({ ids: [user1Asset1.id] }); .send({ ids: [user1Asset1.id] });
expect(status).toBe(400); expect(status).toBe(400);
expect(body).toEqual(errorDto.badRequest('Not found or no albumAsset.delete access')); expect(body).toEqual(errorDto.badRequest('Not found or no album.removeAsset access'));
}); });
it('should remove duplicate assets only once', async () => { it('should remove duplicate assets only once', async () => {

View File

@@ -186,6 +186,18 @@ export const utils = {
} }
}, },
resetFilesystem: async () => {
const mediaInternal = '/usr/src/app/upload';
const dirs = [
`"${mediaInternal}/thumbs"`,
`"${mediaInternal}/upload"`,
`"${mediaInternal}/library"`,
`"${mediaInternal}/encoded-video"`,
].join(' ');
await execPromise(`docker exec -i "immich-e2e-server" /bin/bash -c "rm -rf ${dirs} && mkdir ${dirs}"`);
},
unzip: async (input: string, output: string) => { unzip: async (input: string, output: string) => {
await execPromise(`unzip -o -d "${output}" "${input}"`); await execPromise(`unzip -o -d "${output}" "${input}"`);
}, },

View File

@@ -37,7 +37,6 @@ test.describe('Registration', () => {
await page.getByRole('button', { name: 'Server Privacy' }).click(); await page.getByRole('button', { name: 'Server Privacy' }).click();
await page.getByRole('button', { name: 'User Privacy' }).click(); await page.getByRole('button', { name: 'User Privacy' }).click();
await page.getByRole('button', { name: 'Storage Template' }).click(); await page.getByRole('button', { name: 'Storage Template' }).click();
await page.getByRole('button', { name: 'Backups' }).click();
await page.getByRole('button', { name: 'Done' }).click(); await page.getByRole('button', { name: 'Done' }).click();
// success // success

View File

@@ -14,7 +14,6 @@
"add_a_location": "Add a location", "add_a_location": "Add a location",
"add_a_name": "Add a name", "add_a_name": "Add a name",
"add_a_title": "Add a title", "add_a_title": "Add a title",
"add_birthday": "Add a birthday",
"add_endpoint": "Add endpoint", "add_endpoint": "Add endpoint",
"add_exclusion_pattern": "Add exclusion pattern", "add_exclusion_pattern": "Add exclusion pattern",
"add_import_path": "Add import path", "add_import_path": "Add import path",
@@ -45,13 +44,6 @@
"backup_database": "Create Database Dump", "backup_database": "Create Database Dump",
"backup_database_enable_description": "Enable database dumps", "backup_database_enable_description": "Enable database dumps",
"backup_keep_last_amount": "Amount of previous dumps to keep", "backup_keep_last_amount": "Amount of previous dumps to keep",
"backup_onboarding_1_description": "offsite copy in the cloud or at another physical location.",
"backup_onboarding_2_description": "local copies on different devices. This includes the main files and a backup of those files locally.",
"backup_onboarding_3_description": "total copies of your data, including the original files. This includes 1 offsite copy and 2 local copies.",
"backup_onboarding_description": "A <backblaze-link>3-2-1 backup strategy</backblaze-link> is recommended to protect your data. You should keep copies of your uploaded photos/videos as well as the Immich database for a comprehensive backup solution.",
"backup_onboarding_footer": "For more information about backing up Immich, please refer to the <link>documentation</link>.",
"backup_onboarding_parts_title": "A 3-2-1 backup includes:",
"backup_onboarding_title": "Backups",
"backup_settings": "Database Dump Settings", "backup_settings": "Database Dump Settings",
"backup_settings_description": "Manage database dump settings.", "backup_settings_description": "Manage database dump settings.",
"cleared_jobs": "Cleared jobs for: {job}", "cleared_jobs": "Cleared jobs for: {job}",
@@ -405,7 +397,6 @@
"album_cover_updated": "Album cover updated", "album_cover_updated": "Album cover updated",
"album_delete_confirmation": "Are you sure you want to delete the album {album}?", "album_delete_confirmation": "Are you sure you want to delete the album {album}?",
"album_delete_confirmation_description": "If this album is shared, other users will not be able to access it anymore.", "album_delete_confirmation_description": "If this album is shared, other users will not be able to access it anymore.",
"album_deleted": "Album deleted",
"album_info_card_backup_album_excluded": "EXCLUDED", "album_info_card_backup_album_excluded": "EXCLUDED",
"album_info_card_backup_album_included": "INCLUDED", "album_info_card_backup_album_included": "INCLUDED",
"album_info_updated": "Album info updated", "album_info_updated": "Album info updated",
@@ -519,7 +510,6 @@
"back_close_deselect": "Back, close, or deselect", "back_close_deselect": "Back, close, or deselect",
"background_location_permission": "Background location permission", "background_location_permission": "Background location permission",
"background_location_permission_content": "In order to switch networks when running in the background, Immich must *always* have precise location access so the app can read the Wi-Fi network's name", "background_location_permission_content": "In order to switch networks when running in the background, Immich must *always* have precise location access so the app can read the Wi-Fi network's name",
"backup": "Backup",
"backup_album_selection_page_albums_device": "Albums on device ({count})", "backup_album_selection_page_albums_device": "Albums on device ({count})",
"backup_album_selection_page_albums_tap": "Tap to include, double tap to exclude", "backup_album_selection_page_albums_tap": "Tap to include, double tap to exclude",
"backup_album_selection_page_assets_scatter": "Assets can scatter across multiple albums. Thus, albums can be included or excluded during the backup process.", "backup_album_selection_page_assets_scatter": "Assets can scatter across multiple albums. Thus, albums can be included or excluded during the backup process.",
@@ -733,7 +723,6 @@
"current_server_address": "Current server address", "current_server_address": "Current server address",
"custom_locale": "Custom Locale", "custom_locale": "Custom Locale",
"custom_locale_description": "Format dates and numbers based on the language and the region", "custom_locale_description": "Format dates and numbers based on the language and the region",
"custom_url": "Custom URL",
"daily_title_text_date": "E, MMM dd", "daily_title_text_date": "E, MMM dd",
"daily_title_text_date_year": "E, MMM dd, yyyy", "daily_title_text_date_year": "E, MMM dd, yyyy",
"dark": "Dark", "dark": "Dark",
@@ -753,8 +742,7 @@
"default_locale": "Default Locale", "default_locale": "Default Locale",
"default_locale_description": "Format dates and numbers based on your browser locale", "default_locale_description": "Format dates and numbers based on your browser locale",
"delete": "Delete", "delete": "Delete",
"delete_action_confirmation_message": "Are you sure you want to delete this asset? This action will move the asset to the server's trash and will prompt if you want to delete it locally", "delete_action_prompt": "{count} deleted permanently",
"delete_action_prompt": "{count} deleted",
"delete_album": "Delete album", "delete_album": "Delete album",
"delete_api_key_prompt": "Are you sure you want to delete this API key?", "delete_api_key_prompt": "Are you sure you want to delete this API key?",
"delete_dialog_alert": "These items will be permanently deleted from Immich and from your device", "delete_dialog_alert": "These items will be permanently deleted from Immich and from your device",
@@ -772,8 +760,6 @@
"delete_local_dialog_ok_backed_up_only": "Delete Backed Up Only", "delete_local_dialog_ok_backed_up_only": "Delete Backed Up Only",
"delete_local_dialog_ok_force": "Delete Anyway", "delete_local_dialog_ok_force": "Delete Anyway",
"delete_others": "Delete others", "delete_others": "Delete others",
"delete_permanently": "Delete permanently",
"delete_permanently_action_prompt": "{count} deleted permanently",
"delete_shared_link": "Delete shared link", "delete_shared_link": "Delete shared link",
"delete_shared_link_dialog_title": "Delete Shared Link", "delete_shared_link_dialog_title": "Delete Shared Link",
"delete_tag": "Delete tag", "delete_tag": "Delete tag",
@@ -829,9 +815,9 @@
"edit": "Edit", "edit": "Edit",
"edit_album": "Edit album", "edit_album": "Edit album",
"edit_avatar": "Edit avatar", "edit_avatar": "Edit avatar",
"edit_birthday": "Edit Birthday",
"edit_date": "Edit date", "edit_date": "Edit date",
"edit_date_and_time": "Edit date and time", "edit_date_and_time": "Edit date and time",
"edit_date_time_action_prompt": "{count} date and time edited",
"edit_description": "Edit description", "edit_description": "Edit description",
"edit_description_prompt": "Please select a new description:", "edit_description_prompt": "Please select a new description:",
"edit_exclusion_pattern": "Edit exclusion pattern", "edit_exclusion_pattern": "Edit exclusion pattern",
@@ -997,7 +983,6 @@
}, },
"exif": "Exif", "exif": "Exif",
"exif_bottom_sheet_description": "Add Description...", "exif_bottom_sheet_description": "Add Description...",
"exif_bottom_sheet_description_error": "Error updating description",
"exif_bottom_sheet_details": "DETAILS", "exif_bottom_sheet_details": "DETAILS",
"exif_bottom_sheet_location": "LOCATION", "exif_bottom_sheet_location": "LOCATION",
"exif_bottom_sheet_people": "PEOPLE", "exif_bottom_sheet_people": "PEOPLE",
@@ -1164,7 +1149,6 @@
"language_no_results_title": "No languages found", "language_no_results_title": "No languages found",
"language_search_hint": "Search languages...", "language_search_hint": "Search languages...",
"language_setting_description": "Select your preferred language", "language_setting_description": "Select your preferred language",
"large_files": "Large Files",
"last_seen": "Last seen", "last_seen": "Last seen",
"latest_version": "Latest Version", "latest_version": "Latest Version",
"latitude": "Latitude", "latitude": "Latitude",
@@ -1184,6 +1168,7 @@
"light": "Light", "light": "Light",
"like_deleted": "Like deleted", "like_deleted": "Like deleted",
"link_motion_video": "Link motion video", "link_motion_video": "Link motion video",
"link_options": "Link options",
"link_to_oauth": "Link to OAuth", "link_to_oauth": "Link to OAuth",
"linked_oauth_account": "Linked OAuth account", "linked_oauth_account": "Linked OAuth account",
"list": "List", "list": "List",
@@ -1248,7 +1233,8 @@
"manage_your_devices": "Manage your logged-in devices", "manage_your_devices": "Manage your logged-in devices",
"manage_your_oauth_connection": "Manage your OAuth connection", "manage_your_oauth_connection": "Manage your OAuth connection",
"map": "Map", "map": "Map",
"map_assets_in_bounds": "{count, plural, one {# photo} other {# photos}}", "map_assets_in_bound": "{count} photo",
"map_assets_in_bounds": "{count} photos",
"map_cannot_get_user_location": "Cannot get user's location", "map_cannot_get_user_location": "Cannot get user's location",
"map_location_dialog_yes": "Yes", "map_location_dialog_yes": "Yes",
"map_location_picker_page_use_location": "Use this location", "map_location_picker_page_use_location": "Use this location",
@@ -1599,7 +1585,6 @@
"resume": "Resume", "resume": "Resume",
"retry_upload": "Retry upload", "retry_upload": "Retry upload",
"review_duplicates": "Review duplicates", "review_duplicates": "Review duplicates",
"review_large_files": "Review large files",
"role": "Role", "role": "Role",
"role_editor": "Editor", "role_editor": "Editor",
"role_viewer": "Viewer", "role_viewer": "Viewer",
@@ -1757,7 +1742,6 @@
"shared_link_clipboard_copied_massage": "Copied to clipboard", "shared_link_clipboard_copied_massage": "Copied to clipboard",
"shared_link_clipboard_text": "Link: {link}\nPassword: {password}", "shared_link_clipboard_text": "Link: {link}\nPassword: {password}",
"shared_link_create_error": "Error while creating shared link", "shared_link_create_error": "Error while creating shared link",
"shared_link_custom_url_description": "Access this shared link with a custom URL",
"shared_link_edit_description_hint": "Enter the share description", "shared_link_edit_description_hint": "Enter the share description",
"shared_link_edit_expire_after_option_day": "1 day", "shared_link_edit_expire_after_option_day": "1 day",
"shared_link_edit_expire_after_option_days": "{count} days", "shared_link_edit_expire_after_option_days": "{count} days",
@@ -1783,7 +1767,6 @@
"shared_link_info_chip_metadata": "EXIF", "shared_link_info_chip_metadata": "EXIF",
"shared_link_manage_links": "Manage Shared links", "shared_link_manage_links": "Manage Shared links",
"shared_link_options": "Shared link options", "shared_link_options": "Shared link options",
"shared_link_password_description": "Require a password to access this shared link",
"shared_links": "Shared links", "shared_links": "Shared links",
"shared_links_description": "Share photos and videos with a link", "shared_links_description": "Share photos and videos with a link",
"shared_photos_and_videos_count": "{assetCount, plural, other {# shared photos & videos.}}", "shared_photos_and_videos_count": "{assetCount, plural, other {# shared photos & videos.}}",

View File

@@ -1,3 +1,3 @@
{ {
"flutter": "3.32.8" "flutter": "3.32.6"
} }

View File

@@ -1,9 +1,5 @@
{ {
"dart.flutterSdkPath": ".fvm/versions/3.32.8", "dart.flutterSdkPath": ".fvm/versions/3.32.6",
"dart.lineLength": 120,
"[dart]": {
"editor.rulers": [120],
},
"search.exclude": { "search.exclude": {
"**/.fvm": true "**/.fvm": true
}, },

View File

@@ -9,9 +9,6 @@
# packages, and plugins designed to encourage good coding practices. # packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml include: package:flutter_lints/flutter.yaml
formatter:
page_width: 120
linter: linter:
# The lint rules applied to this project can be customized in the # The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml` # section below to disable rules from the `package:flutter_lints/flutter.yaml`

View File

@@ -72,6 +72,20 @@ android {
} }
} }
flavorDimensions "default"
productFlavors {
production {
dimension "default"
applicationId "app.alextran.immich"
}
beta {
dimension "default"
applicationId "app.alextran.immich.beta"
versionNameSuffix "-BETA"
}
}
buildTypes { buildTypes {
debug { debug {
applicationIdSuffix '.debug' applicationIdSuffix '.debug'

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application android:label="Immich Beta" tools:replace="android:label" />
</manifest>

View File

@@ -88,8 +88,7 @@ data class PlatformAsset (
val width: Long? = null, val width: Long? = null,
val height: Long? = null, val height: Long? = null,
val durationInSeconds: Long, val durationInSeconds: Long,
val orientation: Long, val orientation: Long
val isFavorite: Boolean
) )
{ {
companion object { companion object {
@@ -103,8 +102,7 @@ data class PlatformAsset (
val height = pigeonVar_list[6] as Long? val height = pigeonVar_list[6] as Long?
val durationInSeconds = pigeonVar_list[7] as Long val durationInSeconds = pigeonVar_list[7] as Long
val orientation = pigeonVar_list[8] as Long val orientation = pigeonVar_list[8] as Long
val isFavorite = pigeonVar_list[9] as Boolean return PlatformAsset(id, name, type, createdAt, updatedAt, width, height, durationInSeconds, orientation)
return PlatformAsset(id, name, type, createdAt, updatedAt, width, height, durationInSeconds, orientation, isFavorite)
} }
} }
fun toList(): List<Any?> { fun toList(): List<Any?> {
@@ -118,7 +116,6 @@ data class PlatformAsset (
height, height,
durationInSeconds, durationInSeconds,
orientation, orientation,
isFavorite,
) )
} }
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {

View File

@@ -42,7 +42,6 @@ open class NativeSyncApiImplBase(context: Context) {
MediaStore.MediaColumns.HEIGHT, MediaStore.MediaColumns.HEIGHT,
MediaStore.MediaColumns.DURATION, MediaStore.MediaColumns.DURATION,
MediaStore.MediaColumns.ORIENTATION, MediaStore.MediaColumns.ORIENTATION,
MediaStore.MediaColumns.IS_FAVORITE,
) )
const val HASH_BUFFER_SIZE = 2 * 1024 * 1024 const val HASH_BUFFER_SIZE = 2 * 1024 * 1024
@@ -78,7 +77,6 @@ open class NativeSyncApiImplBase(context: Context) {
val durationColumn = c.getColumnIndexOrThrow(MediaStore.MediaColumns.DURATION) val durationColumn = c.getColumnIndexOrThrow(MediaStore.MediaColumns.DURATION)
val orientationColumn = val orientationColumn =
c.getColumnIndexOrThrow(MediaStore.MediaColumns.ORIENTATION) c.getColumnIndexOrThrow(MediaStore.MediaColumns.ORIENTATION)
val favoriteColumn = c.getColumnIndexOrThrow(MediaStore.MediaColumns.IS_FAVORITE)
while (c.moveToNext()) { while (c.moveToNext()) {
val id = c.getLong(idColumn).toString() val id = c.getLong(idColumn).toString()
@@ -107,7 +105,6 @@ open class NativeSyncApiImplBase(context: Context) {
else c.getLong(durationColumn) / 1000 else c.getLong(durationColumn) / 1000
val bucketId = c.getString(bucketIdColumn) val bucketId = c.getString(bucketIdColumn)
val orientation = c.getInt(orientationColumn) val orientation = c.getInt(orientationColumn)
val isFavorite = c.getInt(favoriteColumn) != 0;
val asset = PlatformAsset( val asset = PlatformAsset(
id, id,
@@ -119,7 +116,6 @@ open class NativeSyncApiImplBase(context: Context) {
height, height,
duration, duration,
orientation.toLong(), orientation.toLong(),
isFavorite,
) )
yield(AssetResult.ValidAsset(asset, bucketId)) yield(AssetResult.ValidAsset(asset, bucketId))
} }

View File

@@ -69,7 +69,7 @@ class ImageDownloadWorker(
.build() .build()
manager.enqueueUniqueWork( manager.enqueueUniqueWork(
"$uniqueWorkName-$appWidgetId-singleShot", "$uniqueWorkName-$appWidgetId",
ExistingWorkPolicy.REPLACE, ExistingWorkPolicy.REPLACE,
workRequest workRequest
) )

View File

@@ -28,19 +28,17 @@ class MemoryReceiver : GlanceAppWidgetReceiver() {
override fun onReceive(context: Context, intent: Intent) { override fun onReceive(context: Context, intent: Intent) {
val fromMainApp = intent.getBooleanExtra(HomeWidgetPlugin.TRIGGERED_FROM_HOME_WIDGET, false) val fromMainApp = intent.getBooleanExtra(HomeWidgetPlugin.TRIGGERED_FROM_HOME_WIDGET, false)
val provider = ComponentName(context, MemoryReceiver::class.java)
val glanceIds = AppWidgetManager.getInstance(context).getAppWidgetIds(provider)
// Launch coroutine to setup a single shot if the app requested the update // Launch coroutine to setup a single shot if the app requested the update
if (fromMainApp) { if (fromMainApp) {
glanceIds.forEach { widgetID -> CoroutineScope(Dispatchers.Default).launch {
ImageDownloadWorker.singleShot(context, widgetID, WidgetType.MEMORIES) val provider = ComponentName(context, MemoryReceiver::class.java)
} val glanceIds = AppWidgetManager.getInstance(context).getAppWidgetIds(provider)
}
// make sure the periodic jobs are running glanceIds.forEach { widgetID ->
glanceIds.forEach { widgetID -> ImageDownloadWorker.singleShot(context, widgetID, WidgetType.MEMORIES)
ImageDownloadWorker.enqueuePeriodic(context, widgetID, WidgetType.MEMORIES) }
}
} }
super.onReceive(context, intent) super.onReceive(context, intent)

View File

@@ -28,19 +28,17 @@ class RandomReceiver : GlanceAppWidgetReceiver() {
override fun onReceive(context: Context, intent: Intent) { override fun onReceive(context: Context, intent: Intent) {
val fromMainApp = intent.getBooleanExtra(HomeWidgetPlugin.TRIGGERED_FROM_HOME_WIDGET, false) val fromMainApp = intent.getBooleanExtra(HomeWidgetPlugin.TRIGGERED_FROM_HOME_WIDGET, false)
val provider = ComponentName(context, RandomReceiver::class.java)
val glanceIds = AppWidgetManager.getInstance(context).getAppWidgetIds(provider)
// Launch coroutine to setup a single shot if the app requested the update // Launch coroutine to setup a single shot if the app requested the update
if (fromMainApp) { if (fromMainApp) {
glanceIds.forEach { widgetID -> CoroutineScope(Dispatchers.Default).launch {
ImageDownloadWorker.singleShot(context, widgetID, WidgetType.RANDOM) val provider = ComponentName(context, RandomReceiver::class.java)
} val glanceIds = AppWidgetManager.getInstance(context).getAppWidgetIds(provider)
}
// make sure the periodic jobs are running glanceIds.forEach { widgetID ->
glanceIds.forEach { widgetID -> ImageDownloadWorker.singleShot(context, widgetID, WidgetType.RANDOM)
ImageDownloadWorker.enqueuePeriodic(context, widgetID, WidgetType.RANDOM) }
}
} }
super.onReceive(context, intent) super.onReceive(context, intent)

View File

@@ -35,8 +35,8 @@ platform :android do
task: 'bundle', task: 'bundle',
build_type: 'Release', build_type: 'Release',
properties: { properties: {
"android.injected.version.code" => 205, "android.injected.version.code" => 204,
"android.injected.version.name" => "1.136.0", "android.injected.version.name" => "1.135.3",
} }
) )
upload_to_play_store(skip_upload_apk: true, skip_upload_images: true, skip_upload_screenshots: true, aab: '../build/app/outputs/bundle/release/app-release.aab') upload_to_play_store(skip_upload_apk: true, skip_upload_images: true, skip_upload_screenshots: true, aab: '../build/app/outputs/bundle/release/app-release.aab')

File diff suppressed because one or more lines are too long

View File

@@ -139,7 +139,6 @@ struct PlatformAsset: Hashable {
var height: Int64? = nil var height: Int64? = nil
var durationInSeconds: Int64 var durationInSeconds: Int64
var orientation: Int64 var orientation: Int64
var isFavorite: Bool
// swift-format-ignore: AlwaysUseLowerCamelCase // swift-format-ignore: AlwaysUseLowerCamelCase
@@ -153,7 +152,6 @@ struct PlatformAsset: Hashable {
let height: Int64? = nilOrValue(pigeonVar_list[6]) let height: Int64? = nilOrValue(pigeonVar_list[6])
let durationInSeconds = pigeonVar_list[7] as! Int64 let durationInSeconds = pigeonVar_list[7] as! Int64
let orientation = pigeonVar_list[8] as! Int64 let orientation = pigeonVar_list[8] as! Int64
let isFavorite = pigeonVar_list[9] as! Bool
return PlatformAsset( return PlatformAsset(
id: id, id: id,
@@ -164,8 +162,7 @@ struct PlatformAsset: Hashable {
width: width, width: width,
height: height, height: height,
durationInSeconds: durationInSeconds, durationInSeconds: durationInSeconds,
orientation: orientation, orientation: orientation
isFavorite: isFavorite
) )
} }
func toList() -> [Any?] { func toList() -> [Any?] {
@@ -179,7 +176,6 @@ struct PlatformAsset: Hashable {
height, height,
durationInSeconds, durationInSeconds,
orientation, orientation,
isFavorite,
] ]
} }
static func == (lhs: PlatformAsset, rhs: PlatformAsset) -> Bool { static func == (lhs: PlatformAsset, rhs: PlatformAsset) -> Bool {

View File

@@ -28,8 +28,7 @@ extension PHAsset {
width: Int64(pixelWidth), width: Int64(pixelWidth),
height: Int64(pixelHeight), height: Int64(pixelHeight),
durationInSeconds: Int64(duration), durationInSeconds: Int64(duration),
orientation: 0, orientation: 0
isFavorite: isFavorite
) )
} }
} }
@@ -172,8 +171,7 @@ class NativeSyncApiImpl: NativeSyncApi {
name: "", name: "",
type: 0, type: 0,
durationInSeconds: 0, durationInSeconds: 0,
orientation: 0, orientation: 0
isFavorite: false
) )
if (updatedAssets.contains(AssetWrapper(with: predicate))) { if (updatedAssets.contains(AssetWrapper(with: predicate))) {
continue continue

View File

@@ -22,7 +22,7 @@ platform :ios do
path: "./Runner.xcodeproj", path: "./Runner.xcodeproj",
) )
increment_version_number( increment_version_number(
version_number: "1.136.0" version_number: "1.135.3"
) )
increment_build_number( increment_build_number(
build_number: latest_testflight_build_number + 1, build_number: latest_testflight_build_number + 1,

View File

@@ -1,6 +1,17 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
enum ImmichColorPreset { indigo, deepPurple, pink, red, orange, yellow, lime, green, cyan, slateGray } enum ImmichColorPreset {
indigo,
deepPurple,
pink,
red,
orange,
yellow,
lime,
green,
cyan,
slateGray
}
const ImmichColorPreset defaultColorPreset = ImmichColorPreset.indigo; const ImmichColorPreset defaultColorPreset = ImmichColorPreset.indigo;
const String defaultColorPresetName = "indigo"; const String defaultColorPresetName = "indigo";

View File

@@ -1,6 +1,13 @@
enum SortOrder { asc, desc } enum SortOrder {
asc,
desc,
}
enum TextSearchType { context, filename, description } enum TextSearchType {
context,
filename,
description,
}
enum AssetVisibilityEnum { timeline, hidden, archive, locked } enum AssetVisibilityEnum { timeline, hidden, archive, locked }

View File

@@ -2,49 +2,511 @@ import 'package:flutter/material.dart';
const List<ColorFilter> filters = [ const List<ColorFilter> filters = [
//Original //Original
ColorFilter.matrix([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
1,
0,
]),
//Vintage //Vintage
ColorFilter.matrix([0.8, 0.1, 0.1, 0, 20, 0.1, 0.8, 0.1, 0, 20, 0.1, 0.1, 0.8, 0, 20, 0, 0, 0, 1, 0]), ColorFilter.matrix([
0.8,
0.1,
0.1,
0,
20,
0.1,
0.8,
0.1,
0,
20,
0.1,
0.1,
0.8,
0,
20,
0,
0,
0,
1,
0,
]),
//Mood //Mood
ColorFilter.matrix([1.2, 0.1, 0.1, 0, 10, 0.1, 1, 0.1, 0, 10, 0.1, 0.1, 1, 0, 10, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.2,
0.1,
0.1,
0,
10,
0.1,
1,
0.1,
0,
10,
0.1,
0.1,
1,
0,
10,
0,
0,
0,
1,
0,
]),
//Crisp //Crisp
ColorFilter.matrix([1.2, 0, 0, 0, 0, 0, 1.2, 0, 0, 0, 0, 0, 1.2, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.2,
0,
0,
0,
0,
0,
1.2,
0,
0,
0,
0,
0,
1.2,
0,
0,
0,
0,
0,
1,
0,
]),
//Cool //Cool
ColorFilter.matrix([0.9, 0, 0.2, 0, 0, 0, 1, 0.1, 0, 0, 0.1, 0, 1.2, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
0.9,
0,
0.2,
0,
0,
0,
1,
0.1,
0,
0,
0.1,
0,
1.2,
0,
0,
0,
0,
0,
1,
0,
]),
//Blush //Blush
ColorFilter.matrix([1.1, 0.1, 0.1, 0, 10, 0.1, 1, 0.1, 0, 10, 0.1, 0.1, 1, 0, 5, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.1,
0.1,
0.1,
0,
10,
0.1,
1,
0.1,
0,
10,
0.1,
0.1,
1,
0,
5,
0,
0,
0,
1,
0,
]),
//Sunkissed //Sunkissed
ColorFilter.matrix([1.3, 0, 0.1, 0, 15, 0, 1.1, 0.1, 0, 10, 0, 0, 0.9, 0, 5, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.3,
0,
0.1,
0,
15,
0,
1.1,
0.1,
0,
10,
0,
0,
0.9,
0,
5,
0,
0,
0,
1,
0,
]),
//Fresh //Fresh
ColorFilter.matrix([1.2, 0, 0, 0, 20, 0, 1.2, 0, 0, 20, 0, 0, 1.1, 0, 20, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.2,
0,
0,
0,
20,
0,
1.2,
0,
0,
20,
0,
0,
1.1,
0,
20,
0,
0,
0,
1,
0,
]),
//Classic //Classic
ColorFilter.matrix([1.1, 0, -0.1, 0, 10, -0.1, 1.1, 0.1, 0, 5, 0, -0.1, 1.1, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.1,
0,
-0.1,
0,
10,
-0.1,
1.1,
0.1,
0,
5,
0,
-0.1,
1.1,
0,
0,
0,
0,
0,
1,
0,
]),
//Lomo-ish //Lomo-ish
ColorFilter.matrix([1.5, 0, 0.1, 0, 0, 0, 1.45, 0, 0, 0, 0.1, 0, 1.3, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.5,
0,
0.1,
0,
0,
0,
1.45,
0,
0,
0,
0.1,
0,
1.3,
0,
0,
0,
0,
0,
1,
0,
]),
//Nashville //Nashville
ColorFilter.matrix([1.2, 0.15, -0.15, 0, 15, 0.1, 1.1, 0.1, 0, 10, -0.05, 0.2, 1.25, 0, 5, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.2,
0.15,
-0.15,
0,
15,
0.1,
1.1,
0.1,
0,
10,
-0.05,
0.2,
1.25,
0,
5,
0,
0,
0,
1,
0,
]),
//Valencia //Valencia
ColorFilter.matrix([1.15, 0.1, 0.1, 0, 20, 0.1, 1.1, 0, 0, 10, 0.1, 0.1, 1.2, 0, 5, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.15,
0.1,
0.1,
0,
20,
0.1,
1.1,
0,
0,
10,
0.1,
0.1,
1.2,
0,
5,
0,
0,
0,
1,
0,
]),
//Clarendon //Clarendon
ColorFilter.matrix([1.2, 0, 0, 0, 10, 0, 1.25, 0, 0, 10, 0, 0, 1.3, 0, 10, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.2,
0,
0,
0,
10,
0,
1.25,
0,
0,
10,
0,
0,
1.3,
0,
10,
0,
0,
0,
1,
0,
]),
//Moon //Moon
ColorFilter.matrix([0.33, 0.33, 0.33, 0, 0, 0.33, 0.33, 0.33, 0, 0, 0.33, 0.33, 0.33, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
0.33,
0.33,
0.33,
0,
0,
0.33,
0.33,
0.33,
0,
0,
0.33,
0.33,
0.33,
0,
0,
0,
0,
0,
1,
0,
]),
//Willow //Willow
ColorFilter.matrix([0.5, 0.5, 0.5, 0, 20, 0.5, 0.5, 0.5, 0, 20, 0.5, 0.5, 0.5, 0, 20, 0, 0, 0, 1, 0]), ColorFilter.matrix([
0.5,
0.5,
0.5,
0,
20,
0.5,
0.5,
0.5,
0,
20,
0.5,
0.5,
0.5,
0,
20,
0,
0,
0,
1,
0,
]),
//Kodak //Kodak
ColorFilter.matrix([1.3, 0.1, -0.1, 0, 10, 0, 1.25, 0.1, 0, 10, 0, -0.1, 1.1, 0, 5, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.3,
0.1,
-0.1,
0,
10,
0,
1.25,
0.1,
0,
10,
0,
-0.1,
1.1,
0,
5,
0,
0,
0,
1,
0,
]),
//Frost //Frost
ColorFilter.matrix([0.8, 0.2, 0.1, 0, 0, 0.2, 1.1, 0.1, 0, 0, 0.1, 0.1, 1.2, 0, 10, 0, 0, 0, 1, 0]), ColorFilter.matrix([
0.8,
0.2,
0.1,
0,
0,
0.2,
1.1,
0.1,
0,
0,
0.1,
0.1,
1.2,
0,
10,
0,
0,
0,
1,
0,
]),
//Night Vision //Night Vision
ColorFilter.matrix([0.1, 0.95, 0.2, 0, 0, 0.1, 1.5, 0.1, 0, 0, 0.2, 0.7, 0, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
0.1,
0.95,
0.2,
0,
0,
0.1,
1.5,
0.1,
0,
0,
0.2,
0.7,
0,
0,
0,
0,
0,
0,
1,
0,
]),
//Sunset //Sunset
ColorFilter.matrix([1.5, 0.2, 0, 0, 0, 0.1, 0.9, 0.1, 0, 0, -0.1, -0.2, 1.3, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.5,
0.2,
0,
0,
0,
0.1,
0.9,
0.1,
0,
0,
-0.1,
-0.2,
1.3,
0,
0,
0,
0,
0,
1,
0,
]),
//Noir //Noir
ColorFilter.matrix([1.3, -0.3, 0.1, 0, 0, -0.1, 1.2, -0.1, 0, 0, 0.1, -0.2, 1.3, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.3,
-0.3,
0.1,
0,
0,
-0.1,
1.2,
-0.1,
0,
0,
0.1,
-0.2,
1.3,
0,
0,
0,
0,
0,
1,
0,
]),
//Dreamy //Dreamy
ColorFilter.matrix([1.1, 0.1, 0.1, 0, 0, 0.1, 1.1, 0.1, 0, 0, 0.1, 0.1, 1.1, 0, 15, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.1,
0.1,
0.1,
0,
0,
0.1,
1.1,
0.1,
0,
0,
0.1,
0.1,
1.1,
0,
15,
0,
0,
0,
1,
0,
]),
//Sepia //Sepia
ColorFilter.matrix([0.393, 0.769, 0.189, 0, 0, 0.349, 0.686, 0.168, 0, 0, 0.272, 0.534, 0.131, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
0.393,
0.769,
0.189,
0,
0,
0.349,
0.686,
0.168,
0,
0,
0.272,
0.534,
0.131,
0,
0,
0,
0,
0,
1,
0,
]),
//Radium //Radium
ColorFilter.matrix([ ColorFilter.matrix([
1.438, 1.438,
@@ -92,23 +554,212 @@ const List<ColorFilter> filters = [
0, 0,
]), ]),
//Purple Haze //Purple Haze
ColorFilter.matrix([1.3, 0, 1.2, 0, 0, 0, 1.1, 0, 0, 0, 0.2, 0, 1.3, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.3,
0,
1.2,
0,
0,
0,
1.1,
0,
0,
0,
0.2,
0,
1.3,
0,
0,
0,
0,
0,
1,
0,
]),
//Lemonade //Lemonade
ColorFilter.matrix([1.2, 0.1, 0, 0, 0, 0, 1.1, 0.2, 0, 0, 0.1, 0, 0.7, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.2,
0.1,
0,
0,
0,
0,
1.1,
0.2,
0,
0,
0.1,
0,
0.7,
0,
0,
0,
0,
0,
1,
0,
]),
//Caramel //Caramel
ColorFilter.matrix([1.6, 0.2, 0, 0, 0, 0.1, 1.3, 0.1, 0, 0, 0, 0.1, 0.9, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.6,
0.2,
0,
0,
0,
0.1,
1.3,
0.1,
0,
0,
0,
0.1,
0.9,
0,
0,
0,
0,
0,
1,
0,
]),
//Peachy //Peachy
ColorFilter.matrix([1.3, 0.5, 0, 0, 0, 0.2, 1.1, 0.3, 0, 0, 0.1, 0.1, 1.2, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.3,
0.5,
0,
0,
0,
0.2,
1.1,
0.3,
0,
0,
0.1,
0.1,
1.2,
0,
0,
0,
0,
0,
1,
0,
]),
//Neon //Neon
ColorFilter.matrix([1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1,
0,
1,
0,
0,
0,
2,
0,
0,
0,
0,
0,
3,
0,
0,
0,
0,
0,
1,
0,
]),
//Cold Morning //Cold Morning
ColorFilter.matrix([0.9, 0.1, 0.2, 0, 0, 0, 1, 0.1, 0, 0, 0.1, 0, 1.2, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
0.9,
0.1,
0.2,
0,
0,
0,
1,
0.1,
0,
0,
0.1,
0,
1.2,
0,
0,
0,
0,
0,
1,
0,
]),
//Lush //Lush
ColorFilter.matrix([0.9, 0.2, 0, 0, 0, 0, 1.2, 0, 0, 0, 0, 0, 1.1, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
0.9,
0.2,
0,
0,
0,
0,
1.2,
0,
0,
0,
0,
0,
1.1,
0,
0,
0,
0,
0,
1,
0,
]),
//Urban Neon //Urban Neon
ColorFilter.matrix([1.1, 0, 0.3, 0, 0, 0, 0.9, 0.3, 0, 0, 0.3, 0.1, 1.2, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
1.1,
0,
0.3,
0,
0,
0,
0.9,
0.3,
0,
0,
0.3,
0.1,
1.2,
0,
0,
0,
0,
0,
1,
0,
]),
//Monochrome //Monochrome
ColorFilter.matrix([0.6, 0.2, 0.2, 0, 0, 0.2, 0.6, 0.2, 0, 0, 0.2, 0.2, 0.7, 0, 0, 0, 0, 0, 1, 0]), ColorFilter.matrix([
0.6,
0.2,
0.2,
0,
0,
0.2,
0.6,
0.2,
0,
0,
0.2,
0.2,
0.7,
0,
0,
0,
0,
0,
1,
0,
]),
]; ];
const List<String> filterNames = [ const List<String> filterNames = [

View File

@@ -7,8 +7,10 @@ const Map<String, Locale> locales = {
'Arabic (ar)': Locale('ar'), 'Arabic (ar)': Locale('ar'),
'Bulgarian (bg)': Locale('bg'), 'Bulgarian (bg)': Locale('bg'),
'Catalan (ca)': Locale('ca'), 'Catalan (ca)': Locale('ca'),
'Chinese Simplified (zh_CN)': Locale.fromSubtags(languageCode: 'zh', scriptCode: 'SIMPLIFIED'), 'Chinese Simplified (zh_CN)':
'Chinese Traditional (zh_TW)': Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant'), Locale.fromSubtags(languageCode: 'zh', scriptCode: 'SIMPLIFIED'),
'Chinese Traditional (zh_TW)':
Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant'),
'Croatian (hr)': Locale('hr'), 'Croatian (hr)': Locale('hr'),
'Czech (cs)': Locale('cs'), 'Czech (cs)': Locale('cs'),
'Danish (da)': Locale('da'), 'Danish (da)': Locale('da'),
@@ -35,8 +37,10 @@ const Map<String, Locale> locales = {
'Portuguese (pt)': Locale('pt'), 'Portuguese (pt)': Locale('pt'),
'Romanian (ro)': Locale('ro'), 'Romanian (ro)': Locale('ro'),
'Russian (ru)': Locale('ru'), 'Russian (ru)': Locale('ru'),
'Serbian Cyrillic (sr_Cyrl)': Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Cyrl'), 'Serbian Cyrillic (sr_Cyrl)':
'Serbian Latin (sr_Latn)': Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Latn'), Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Cyrl'),
'Serbian Latin (sr_Latn)':
Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Latn'),
'Slovak (sk)': Locale('sk'), 'Slovak (sk)': Locale('sk'),
'Slovenian (sl)': Locale('sl'), 'Slovenian (sl)': Locale('sl'),
'Spanish (es)': Locale('es'), 'Spanish (es)': Locale('es'),
@@ -51,4 +55,7 @@ const Map<String, Locale> locales = {
const String translationsPath = 'assets/i18n'; const String translationsPath = 'assets/i18n';
const List<Locale> localesNotSupportedByOverpass = [Locale('el', 'GR'), Locale('sr', 'Cyrl')]; const List<Locale> localesNotSupportedByOverpass = [
Locale('el', 'GR'),
Locale('sr', 'Cyrl'),
];

View File

@@ -9,7 +9,11 @@ enum AssetType {
audio, audio,
} }
enum AssetState { local, remote, merged } enum AssetState {
local,
remote,
merged,
}
sealed class BaseAsset { sealed class BaseAsset {
final String name; final String name;
@@ -49,8 +53,10 @@ sealed class BaseAsset {
return const Duration(); return const Duration();
} }
bool get hasRemote => storage == AssetState.remote || storage == AssetState.merged; bool get hasRemote =>
bool get hasLocal => storage == AssetState.local || storage == AssetState.merged; storage == AssetState.remote || storage == AssetState.merged;
bool get hasLocal =>
storage == AssetState.local || storage == AssetState.merged;
bool get isLocalOnly => storage == AssetState.local; bool get isLocalOnly => storage == AssetState.local;
bool get isRemoteOnly => storage == AssetState.remote; bool get isRemoteOnly => storage == AssetState.remote;

View File

@@ -22,7 +22,8 @@ class LocalAsset extends BaseAsset {
}); });
@override @override
AssetState get storage => remoteId == null ? AssetState.local : AssetState.merged; AssetState get storage =>
remoteId == null ? AssetState.local : AssetState.merged;
@override @override
String get heroTag => '${id}_${remoteId ?? checksum}'; String get heroTag => '${id}_${remoteId ?? checksum}';
@@ -53,7 +54,8 @@ class LocalAsset extends BaseAsset {
} }
@override @override
int get hashCode => super.hashCode ^ id.hashCode ^ remoteId.hashCode ^ orientation.hashCode; int get hashCode =>
super.hashCode ^ id.hashCode ^ remoteId.hashCode ^ orientation.hashCode;
LocalAsset copyWith({ LocalAsset copyWith({
String? id, String? id,

View File

@@ -1,6 +1,11 @@
part of 'base_asset.model.dart'; part of 'base_asset.model.dart';
enum AssetVisibility { timeline, hidden, archive, locked } enum AssetVisibility {
timeline,
hidden,
archive,
locked,
}
// Model for an asset stored in the server // Model for an asset stored in the server
class RemoteAsset extends BaseAsset { class RemoteAsset extends BaseAsset {
@@ -8,6 +13,7 @@ class RemoteAsset extends BaseAsset {
final String? localId; final String? localId;
final String? thumbHash; final String? thumbHash;
final AssetVisibility visibility; final AssetVisibility visibility;
final DateTime? localDateTime;
final String ownerId; final String ownerId;
final String? stackId; final String? stackId;
@@ -26,12 +32,14 @@ class RemoteAsset extends BaseAsset {
super.isFavorite = false, super.isFavorite = false,
this.thumbHash, this.thumbHash,
this.visibility = AssetVisibility.timeline, this.visibility = AssetVisibility.timeline,
this.localDateTime,
super.livePhotoVideoId, super.livePhotoVideoId,
this.stackId, this.stackId,
}); });
@override @override
AssetState get storage => localId == null ? AssetState.remote : AssetState.merged; AssetState get storage =>
localId == null ? AssetState.remote : AssetState.merged;
@override @override
String get heroTag => '${localId ?? checksum}_$id'; String get heroTag => '${localId ?? checksum}_$id';
@@ -52,6 +60,7 @@ class RemoteAsset extends BaseAsset {
isFavorite: $isFavorite, isFavorite: $isFavorite,
thumbHash: ${thumbHash ?? "<NA>"}, thumbHash: ${thumbHash ?? "<NA>"},
visibility: $visibility, visibility: $visibility,
localDateTime: ${localDateTime ?? "<NA>"},
stackId: ${stackId ?? "<NA>"}, stackId: ${stackId ?? "<NA>"},
checksum: $checksum, checksum: $checksum,
livePhotoVideoId: ${livePhotoVideoId ?? "<NA>"}, livePhotoVideoId: ${livePhotoVideoId ?? "<NA>"},
@@ -68,6 +77,7 @@ class RemoteAsset extends BaseAsset {
ownerId == other.ownerId && ownerId == other.ownerId &&
thumbHash == other.thumbHash && thumbHash == other.thumbHash &&
visibility == other.visibility && visibility == other.visibility &&
localDateTime == other.localDateTime &&
stackId == other.stackId; stackId == other.stackId;
} }
@@ -79,6 +89,7 @@ class RemoteAsset extends BaseAsset {
localId.hashCode ^ localId.hashCode ^
thumbHash.hashCode ^ thumbHash.hashCode ^
visibility.hashCode ^ visibility.hashCode ^
localDateTime.hashCode ^
stackId.hashCode; stackId.hashCode;
RemoteAsset copyWith({ RemoteAsset copyWith({
@@ -96,6 +107,7 @@ class RemoteAsset extends BaseAsset {
bool? isFavorite, bool? isFavorite,
String? thumbHash, String? thumbHash,
AssetVisibility? visibility, AssetVisibility? visibility,
DateTime? localDateTime,
String? livePhotoVideoId, String? livePhotoVideoId,
String? stackId, String? stackId,
}) { }) {
@@ -114,6 +126,7 @@ class RemoteAsset extends BaseAsset {
isFavorite: isFavorite ?? this.isFavorite, isFavorite: isFavorite ?? this.isFavorite,
thumbHash: thumbHash ?? this.thumbHash, thumbHash: thumbHash ?? this.thumbHash,
visibility: visibility ?? this.visibility, visibility: visibility ?? this.visibility,
localDateTime: localDateTime ?? this.localDateTime,
livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId,
stackId: stackId ?? this.stackId, stackId: stackId ?? this.stackId,
); );

View File

@@ -5,13 +5,19 @@ class DeviceAsset {
final Uint8List hash; final Uint8List hash;
final DateTime modifiedTime; final DateTime modifiedTime;
const DeviceAsset({required this.assetId, required this.hash, required this.modifiedTime}); const DeviceAsset({
required this.assetId,
required this.hash,
required this.modifiedTime,
});
@override @override
bool operator ==(covariant DeviceAsset other) { bool operator ==(covariant DeviceAsset other) {
if (identical(this, other)) return true; if (identical(this, other)) return true;
return other.assetId == assetId && other.hash == hash && other.modifiedTime == modifiedTime; return other.assetId == assetId &&
other.hash == hash &&
other.modifiedTime == modifiedTime;
} }
@override @override
@@ -24,7 +30,11 @@ class DeviceAsset {
return 'DeviceAsset(assetId: $assetId, hash: $hash, modifiedTime: $modifiedTime)'; return 'DeviceAsset(assetId: $assetId, hash: $hash, modifiedTime: $modifiedTime)';
} }
DeviceAsset copyWith({String? assetId, Uint8List? hash, DateTime? modifiedTime}) { DeviceAsset copyWith({
String? assetId,
Uint8List? hash,
DateTime? modifiedTime,
}) {
return DeviceAsset( return DeviceAsset(
assetId: assetId ?? this.assetId, assetId: assetId ?? this.assetId,
hash: hash ?? this.hash, hash: hash ?? this.hash,

View File

@@ -25,7 +25,8 @@ class ExifInfo {
final int? iso; final int? iso;
final double? exposureSeconds; final double? exposureSeconds;
bool get hasCoordinates => latitude != null && longitude != null && latitude != 0 && longitude != 0; bool get hasCoordinates =>
latitude != null && longitude != null && latitude != 0 && longitude != 0;
String get exposureTime { String get exposureTime {
if (exposureSeconds == null) { if (exposureSeconds == null) {

View File

@@ -1,5 +1,16 @@
/// Log levels according to dart logging [Level] /// Log levels according to dart logging [Level]
enum LogLevel { all, finest, finer, fine, config, info, warning, severe, shout, off } enum LogLevel {
all,
finest,
finer,
fine,
config,
info,
warning,
severe,
shout,
off,
}
class LogMessage { class LogMessage {
final String message; final String message;
@@ -32,7 +43,12 @@ class LogMessage {
@override @override
int get hashCode { int get hashCode {
return message.hashCode ^ level.hashCode ^ createdAt.hashCode ^ logger.hashCode ^ error.hashCode ^ stack.hashCode; return message.hashCode ^
level.hashCode ^
createdAt.hashCode ^
logger.hashCode ^
error.hashCode ^
stack.hashCode;
} }
@override @override

View File

@@ -1,18 +0,0 @@
import 'package:maplibre_gl/maplibre_gl.dart';
class Marker {
final LatLng location;
final String assetId;
const Marker({required this.location, required this.assetId});
@override
bool operator ==(covariant Marker other) {
if (identical(this, other)) return true;
return other.location == location && other.assetId == assetId;
}
@override
int get hashCode => location.hashCode ^ assetId.hashCode;
}

View File

@@ -13,23 +13,34 @@ enum MemoryTypeEnum {
class MemoryData { class MemoryData {
final int year; final int year;
const MemoryData({required this.year}); const MemoryData({
required this.year,
});
MemoryData copyWith({int? year}) { MemoryData copyWith({
return MemoryData(year: year ?? this.year); int? year,
}) {
return MemoryData(
year: year ?? this.year,
);
} }
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
return <String, dynamic>{'year': year}; return <String, dynamic>{
'year': year,
};
} }
factory MemoryData.fromMap(Map<String, dynamic> map) { factory MemoryData.fromMap(Map<String, dynamic> map) {
return MemoryData(year: map['year'] as int); return MemoryData(
year: map['year'] as int,
);
} }
String toJson() => json.encode(toMap()); String toJson() => json.encode(toMap());
factory MemoryData.fromJson(String source) => MemoryData.fromMap(json.decode(source) as Map<String, dynamic>); factory MemoryData.fromJson(String source) =>
MemoryData.fromMap(json.decode(source) as Map<String, dynamic>);
@override @override
String toString() => 'MemoryData(year: $year)'; String toString() => 'MemoryData(year: $year)';

View File

@@ -55,17 +55,22 @@ class PersonDto {
factory PersonDto.fromMap(Map<String, dynamic> map) { factory PersonDto.fromMap(Map<String, dynamic> map) {
return PersonDto( return PersonDto(
id: map['id'] as String, id: map['id'] as String,
birthDate: map['birthDate'] != null ? DateTime.fromMillisecondsSinceEpoch(map['birthDate'] as int) : null, birthDate: map['birthDate'] != null
? DateTime.fromMillisecondsSinceEpoch(map['birthDate'] as int)
: null,
isHidden: map['isHidden'] as bool, isHidden: map['isHidden'] as bool,
name: map['name'] as String, name: map['name'] as String,
thumbnailPath: map['thumbnailPath'] as String, thumbnailPath: map['thumbnailPath'] as String,
updatedAt: map['updatedAt'] != null ? DateTime.fromMillisecondsSinceEpoch(map['updatedAt'] as int) : null, updatedAt: map['updatedAt'] != null
? DateTime.fromMillisecondsSinceEpoch(map['updatedAt'] as int)
: null,
); );
} }
String toJson() => json.encode(toMap()); String toJson() => json.encode(toMap());
factory PersonDto.fromJson(String source) => PersonDto.fromMap(json.decode(source) as Map<String, dynamic>); factory PersonDto.fromJson(String source) =>
PersonDto.fromMap(json.decode(source) as Map<String, dynamic>);
@override @override
bool operator ==(covariant PersonDto other) { bool operator ==(covariant PersonDto other) {
@@ -91,7 +96,7 @@ class PersonDto {
} }
// Model for a person stored in the server // Model for a person stored in the server
class DriftPerson { class Person {
final String id; final String id;
final DateTime createdAt; final DateTime createdAt;
final DateTime updatedAt; final DateTime updatedAt;
@@ -103,7 +108,7 @@ class DriftPerson {
final String? color; final String? color;
final DateTime? birthDate; final DateTime? birthDate;
const DriftPerson({ const Person({
required this.id, required this.id,
required this.createdAt, required this.createdAt,
required this.updatedAt, required this.updatedAt,
@@ -116,7 +121,7 @@ class DriftPerson {
this.birthDate, this.birthDate,
}); });
DriftPerson copyWith({ Person copyWith({
String? id, String? id,
DateTime? createdAt, DateTime? createdAt,
DateTime? updatedAt, DateTime? updatedAt,
@@ -128,7 +133,7 @@ class DriftPerson {
String? color, String? color,
DateTime? birthDate, DateTime? birthDate,
}) { }) {
return DriftPerson( return Person(
id: id ?? this.id, id: id ?? this.id,
createdAt: createdAt ?? this.createdAt, createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt, updatedAt: updatedAt ?? this.updatedAt,
@@ -159,7 +164,7 @@ class DriftPerson {
} }
@override @override
bool operator ==(covariant DriftPerson other) { bool operator ==(covariant Person other) {
if (identical(this, other)) return true; if (identical(this, other)) return true;
return other.id == id && return other.id == id &&

View File

@@ -5,12 +5,21 @@ class SearchResult {
final List<BaseAsset> assets; final List<BaseAsset> assets;
final int? nextPage; final int? nextPage;
const SearchResult({required this.assets, this.nextPage}); const SearchResult({
required this.assets,
this.nextPage,
});
int get totalAssets => assets.length; int get totalAssets => assets.length;
SearchResult copyWith({List<BaseAsset>? assets, int? nextPage}) { SearchResult copyWith({
return SearchResult(assets: assets ?? this.assets, nextPage: nextPage ?? this.nextPage); List<BaseAsset>? assets,
int? nextPage,
}) {
return SearchResult(
assets: assets ?? this.assets,
nextPage: nextPage ?? this.nextPage,
);
} }
@override @override

View File

@@ -8,7 +8,7 @@ enum Setting<T> {
loadOriginalVideo<bool>(StoreKey.loadOriginalVideo, false), loadOriginalVideo<bool>(StoreKey.loadOriginalVideo, false),
preferRemoteImage<bool>(StoreKey.preferRemoteImage, false), preferRemoteImage<bool>(StoreKey.preferRemoteImage, false),
advancedTroubleshooting<bool>(StoreKey.advancedTroubleshooting, false), advancedTroubleshooting<bool>(StoreKey.advancedTroubleshooting, false),
enableBackup<bool>(StoreKey.enableBackup, false); ;
const Setting(this.storeKey, this.defaultValue); const Setting(this.storeKey, this.defaultValue);

View File

@@ -14,7 +14,13 @@ class Stack {
required this.primaryAssetId, required this.primaryAssetId,
}); });
Stack copyWith({String? id, DateTime? createdAt, DateTime? updatedAt, String? ownerId, String? primaryAssetId}) { Stack copyWith({
String? id,
DateTime? createdAt,
DateTime? updatedAt,
String? ownerId,
String? primaryAssetId,
}) {
return Stack( return Stack(
id: id ?? this.id, id: id ?? this.id,
createdAt: createdAt ?? this.createdAt, createdAt: createdAt ?? this.createdAt,
@@ -48,7 +54,11 @@ class Stack {
@override @override
int get hashCode { int get hashCode {
return id.hashCode ^ createdAt.hashCode ^ updatedAt.hashCode ^ ownerId.hashCode ^ primaryAssetId.hashCode; return id.hashCode ^
createdAt.hashCode ^
updatedAt.hashCode ^
ownerId.hashCode ^
primaryAssetId.hashCode;
} }
} }
@@ -57,13 +67,19 @@ class StackResponse {
final String primaryAssetId; final String primaryAssetId;
final List<String> assetIds; final List<String> assetIds;
const StackResponse({required this.id, required this.primaryAssetId, required this.assetIds}); const StackResponse({
required this.id,
required this.primaryAssetId,
required this.assetIds,
});
@override @override
bool operator ==(covariant StackResponse other) { bool operator ==(covariant StackResponse other) {
if (identical(this, other)) return true; if (identical(this, other)) return true;
return other.id == id && other.primaryAssetId == primaryAssetId && other.assetIds == assetIds; return other.id == id &&
other.primaryAssetId == primaryAssetId &&
other.assetIds == assetIds;
} }
@override @override

View File

@@ -1,8 +1,17 @@
import 'package:immich_mobile/domain/utils/event_stream.dart'; import 'package:immich_mobile/domain/utils/event_stream.dart';
enum GroupAssetsBy { day, month, auto, none } enum GroupAssetsBy {
day,
month,
none;
}
enum HeaderType { none, month, day, monthAndDay } enum HeaderType {
none,
month,
day,
monthAndDay;
}
class Bucket { class Bucket {
final int assetCount; final int assetCount;
@@ -35,13 +44,3 @@ class TimeBucket extends Bucket {
class TimelineReloadEvent extends Event { class TimelineReloadEvent extends Event {
const TimelineReloadEvent(); const TimelineReloadEvent();
} }
class ScrollToTopEvent extends Event {
const ScrollToTopEvent();
}
class ScrollToDateEvent extends Event {
final DateTime date;
const ScrollToDateEvent(this.date);
}

View File

@@ -74,21 +74,22 @@ quotaSizeInBytes: $quotaSizeInBytes,
bool? isPartnerSharedWith, bool? isPartnerSharedWith,
int? quotaUsageInBytes, int? quotaUsageInBytes,
int? quotaSizeInBytes, int? quotaSizeInBytes,
}) => UserDto( }) =>
id: id ?? this.id, UserDto(
email: email ?? this.email, id: id ?? this.id,
name: name ?? this.name, email: email ?? this.email,
isAdmin: isAdmin ?? this.isAdmin, name: name ?? this.name,
updatedAt: updatedAt ?? this.updatedAt, isAdmin: isAdmin ?? this.isAdmin,
profileImagePath: profileImagePath ?? this.profileImagePath, updatedAt: updatedAt ?? this.updatedAt,
avatarColor: avatarColor ?? this.avatarColor, profileImagePath: profileImagePath ?? this.profileImagePath,
memoryEnabled: memoryEnabled ?? this.memoryEnabled, avatarColor: avatarColor ?? this.avatarColor,
inTimeline: inTimeline ?? this.inTimeline, memoryEnabled: memoryEnabled ?? this.memoryEnabled,
isPartnerSharedBy: isPartnerSharedBy ?? this.isPartnerSharedBy, inTimeline: inTimeline ?? this.inTimeline,
isPartnerSharedWith: isPartnerSharedWith ?? this.isPartnerSharedWith, isPartnerSharedBy: isPartnerSharedBy ?? this.isPartnerSharedBy,
quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, isPartnerSharedWith: isPartnerSharedWith ?? this.isPartnerSharedWith,
quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
); quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes,
);
@override @override
bool operator ==(covariant UserDto other) { bool operator ==(covariant UserDto other) {
@@ -142,7 +143,13 @@ class PartnerUserDto {
this.profileImagePath, this.profileImagePath,
}); });
PartnerUserDto copyWith({String? id, String? email, String? name, bool? inTimeline, String? profileImagePath}) { PartnerUserDto copyWith({
String? id,
String? email,
String? name,
bool? inTimeline,
String? profileImagePath,
}) {
return PartnerUserDto( return PartnerUserDto(
id: id ?? this.id, id: id ?? this.id,
email: email ?? this.email, email: email ?? this.email,
@@ -168,13 +175,16 @@ class PartnerUserDto {
email: map['email'] as String, email: map['email'] as String,
name: map['name'] as String, name: map['name'] as String,
inTimeline: map['inTimeline'] as bool, inTimeline: map['inTimeline'] as bool,
profileImagePath: map['profileImagePath'] != null ? map['profileImagePath'] as String : null, profileImagePath: map['profileImagePath'] != null
? map['profileImagePath'] as String
: null,
); );
} }
String toJson() => json.encode(toMap()); String toJson() => json.encode(toMap());
factory PartnerUserDto.fromJson(String source) => PartnerUserDto.fromMap(json.decode(source) as Map<String, dynamic>); factory PartnerUserDto.fromJson(String source) =>
PartnerUserDto.fromMap(json.decode(source) as Map<String, dynamic>);
@override @override
String toString() { String toString() {
@@ -194,6 +204,10 @@ class PartnerUserDto {
@override @override
int get hashCode { int get hashCode {
return id.hashCode ^ email.hashCode ^ name.hashCode ^ inTimeline.hashCode ^ profileImagePath.hashCode; return id.hashCode ^
email.hashCode ^
name.hashCode ^
inTimeline.hashCode ^
profileImagePath.hashCode;
} }
} }

View File

@@ -24,17 +24,18 @@ enum AvatarColor {
const AvatarColor(this.value); const AvatarColor(this.value);
Color toColor({bool isDarkTheme = false}) => switch (this) { Color toColor({bool isDarkTheme = false}) => switch (this) {
AvatarColor.primary => isDarkTheme ? const Color(0xFFABCBFA) : const Color(0xFF4250AF), AvatarColor.primary =>
AvatarColor.pink => const Color.fromARGB(255, 244, 114, 182), isDarkTheme ? const Color(0xFFABCBFA) : const Color(0xFF4250AF),
AvatarColor.red => const Color.fromARGB(255, 239, 68, 68), AvatarColor.pink => const Color.fromARGB(255, 244, 114, 182),
AvatarColor.yellow => const Color.fromARGB(255, 234, 179, 8), AvatarColor.red => const Color.fromARGB(255, 239, 68, 68),
AvatarColor.blue => const Color.fromARGB(255, 59, 130, 246), AvatarColor.yellow => const Color.fromARGB(255, 234, 179, 8),
AvatarColor.green => const Color.fromARGB(255, 22, 163, 74), AvatarColor.blue => const Color.fromARGB(255, 59, 130, 246),
AvatarColor.purple => const Color.fromARGB(255, 147, 51, 234), AvatarColor.green => const Color.fromARGB(255, 22, 163, 74),
AvatarColor.orange => const Color.fromARGB(255, 234, 88, 12), AvatarColor.purple => const Color.fromARGB(255, 147, 51, 234),
AvatarColor.gray => const Color.fromARGB(255, 75, 85, 99), AvatarColor.orange => const Color.fromARGB(255, 234, 88, 12),
AvatarColor.amber => const Color.fromARGB(255, 217, 119, 6), AvatarColor.gray => const Color.fromARGB(255, 75, 85, 99),
}; AvatarColor.amber => const Color.fromARGB(255, 217, 119, 6),
};
} }
class Onboarding { class Onboarding {
@@ -193,9 +194,17 @@ class License {
final String activationKey; final String activationKey;
final String licenseKey; final String licenseKey;
const License({required this.activatedAt, required this.activationKey, required this.licenseKey}); const License({
required this.activatedAt,
required this.activationKey,
required this.licenseKey,
});
License copyWith({DateTime? activatedAt, String? activationKey, String? licenseKey}) { License copyWith({
DateTime? activatedAt,
String? activationKey,
String? licenseKey,
}) {
return License( return License(
activatedAt: activatedAt ?? this.activatedAt, activatedAt: activatedAt ?? this.activatedAt,
activationKey: activationKey ?? this.activationKey, activationKey: activationKey ?? this.activationKey,
@@ -232,11 +241,14 @@ licenseKey: $licenseKey,
bool operator ==(covariant License other) { bool operator ==(covariant License other) {
if (identical(this, other)) return true; if (identical(this, other)) return true;
return activatedAt == other.activatedAt && activationKey == other.activationKey && licenseKey == other.licenseKey; return activatedAt == other.activatedAt &&
activationKey == other.activationKey &&
licenseKey == other.licenseKey;
} }
@override @override
int get hashCode => activatedAt.hashCode ^ activationKey.hashCode ^ licenseKey.hashCode; int get hashCode =>
activatedAt.hashCode ^ activationKey.hashCode ^ licenseKey.hashCode;
} }
// Model for a user metadata stored in the server // Model for a user metadata stored in the server
@@ -247,11 +259,16 @@ class UserMetadata {
final Preferences? preferences; final Preferences? preferences;
final License? license; final License? license;
const UserMetadata({required this.userId, required this.key, this.onboarding, this.preferences, this.license}) const UserMetadata({
: assert( required this.userId,
onboarding != null || preferences != null || license != null, required this.key,
'One of onboarding, preferences and license must be provided', this.onboarding,
); this.preferences,
this.license,
}) : assert(
onboarding != null || preferences != null || license != null,
'One of onboarding, preferences and license must be provided',
);
UserMetadata copyWith({ UserMetadata copyWith({
String? userId, String? userId,
@@ -293,6 +310,10 @@ license: ${license ?? "<NA>"},
@override @override
int get hashCode { int get hashCode {
return userId.hashCode ^ key.hashCode ^ onboarding.hashCode ^ preferences.hashCode ^ license.hashCode; return userId.hashCode ^
key.hashCode ^
onboarding.hashCode ^
preferences.hashCode ^
license.hashCode;
} }
} }

View File

@@ -13,17 +13,15 @@ class AssetService {
const AssetService({ const AssetService({
required RemoteAssetRepository remoteAssetRepository, required RemoteAssetRepository remoteAssetRepository,
required DriftLocalAssetRepository localAssetRepository, required DriftLocalAssetRepository localAssetRepository,
}) : _remoteAssetRepository = remoteAssetRepository, }) : _remoteAssetRepository = remoteAssetRepository,
_localAssetRepository = localAssetRepository, _localAssetRepository = localAssetRepository,
_platform = const LocalPlatform(); _platform = const LocalPlatform();
Stream<BaseAsset?> watchAsset(BaseAsset asset) { Stream<BaseAsset?> watchAsset(BaseAsset asset) {
final id = asset is LocalAsset ? asset.id : (asset as RemoteAsset).id; final id = asset is LocalAsset ? asset.id : (asset as RemoteAsset).id;
return asset is LocalAsset ? _localAssetRepository.watchAsset(id) : _remoteAssetRepository.watchAsset(id); return asset is LocalAsset
} ? _localAssetRepository.watchAsset(id)
: _remoteAssetRepository.watchAsset(id);
Future<RemoteAsset?> getRemoteAsset(String id) {
return _remoteAssetRepository.get(id);
} }
Future<List<RemoteAsset>> getStack(RemoteAsset asset) async { Future<List<RemoteAsset>> getStack(RemoteAsset asset) async {
@@ -42,7 +40,8 @@ class AssetService {
return null; return null;
} }
final id = asset is LocalAsset ? asset.remoteId! : (asset as RemoteAsset).id; final id =
asset is LocalAsset ? asset.remoteId! : (asset as RemoteAsset).id;
return _remoteAssetRepository.getExif(id); return _remoteAssetRepository.getExif(id);
} }
@@ -57,7 +56,8 @@ class AssetService {
width = exif?.width ?? asset.width?.toDouble(); width = exif?.width ?? asset.width?.toDouble();
height = exif?.height ?? asset.height?.toDouble(); height = exif?.height ?? asset.height?.toDouble();
} else if (asset is LocalAsset) { } else if (asset is LocalAsset) {
isFlipped = _platform.isAndroid && (asset.orientation == 90 || asset.orientation == 270); isFlipped = _platform.isAndroid &&
(asset.orientation == 90 || asset.orientation == 270);
width = asset.width?.toDouble(); width = asset.width?.toDouble();
height = asset.height?.toDouble(); height = asset.height?.toDouble();
} else { } else {
@@ -78,7 +78,10 @@ class AssetService {
} }
Future<(int local, int remote)> getAssetCounts() async { Future<(int local, int remote)> getAssetCounts() async {
return (await _localAssetRepository.getCount(), await _remoteAssetRepository.getCount()); return (
await _localAssetRepository.getCount(),
await _remoteAssetRepository.getCount()
);
} }
Future<int> getLocalHashedCount() { Future<int> getLocalHashedCount() {

View File

@@ -25,20 +25,24 @@ class HashService {
required NativeSyncApi nativeSyncApi, required NativeSyncApi nativeSyncApi,
this.batchSizeLimit = kBatchHashSizeLimit, this.batchSizeLimit = kBatchHashSizeLimit,
this.batchFileLimit = kBatchHashFileLimit, this.batchFileLimit = kBatchHashFileLimit,
}) : _localAlbumRepository = localAlbumRepository, }) : _localAlbumRepository = localAlbumRepository,
_localAssetRepository = localAssetRepository, _localAssetRepository = localAssetRepository,
_storageRepository = storageRepository, _storageRepository = storageRepository,
_nativeSyncApi = nativeSyncApi; _nativeSyncApi = nativeSyncApi;
Future<void> hashAssets() async { Future<void> hashAssets() async {
final Stopwatch stopwatch = Stopwatch()..start(); final Stopwatch stopwatch = Stopwatch()..start();
// Sorted by backupSelection followed by isCloud // Sorted by backupSelection followed by isCloud
final localAlbums = await _localAlbumRepository.getAll( final localAlbums = await _localAlbumRepository.getAll(
sortBy: {SortLocalAlbumsBy.backupSelection, SortLocalAlbumsBy.isIosSharedAlbum}, sortBy: {
SortLocalAlbumsBy.backupSelection,
SortLocalAlbumsBy.isIosSharedAlbum,
},
); );
for (final album in localAlbums) { for (final album in localAlbums) {
final assetsToHash = await _localAlbumRepository.getAssetsToHash(album.id); final assetsToHash =
await _localAlbumRepository.getAssetsToHash(album.id);
if (assetsToHash.isNotEmpty) { if (assetsToHash.isNotEmpty) {
await _hashAssets(assetsToHash); await _hashAssets(assetsToHash);
} }
@@ -84,7 +88,8 @@ class HashService {
_log.fine("Hashing ${toHash.length} files"); _log.fine("Hashing ${toHash.length} files");
final hashed = <LocalAsset>[]; final hashed = <LocalAsset>[];
final hashes = await _nativeSyncApi.hashPaths(toHash.map((e) => e.path).toList()); final hashes =
await _nativeSyncApi.hashPaths(toHash.map((e) => e.path).toList());
assert( assert(
hashes.length == toHash.length, hashes.length == toHash.length,
"Hashes length does not match toHash length: ${hashes.length} != ${toHash.length}", "Hashes length does not match toHash length: ${hashes.length} != ${toHash.length}",

View File

@@ -21,9 +21,9 @@ class LocalSyncService {
required DriftLocalAlbumRepository localAlbumRepository, required DriftLocalAlbumRepository localAlbumRepository,
required NativeSyncApi nativeSyncApi, required NativeSyncApi nativeSyncApi,
Platform? platform, Platform? platform,
}) : _localAlbumRepository = localAlbumRepository, }) : _localAlbumRepository = localAlbumRepository,
_nativeSyncApi = nativeSyncApi, _nativeSyncApi = nativeSyncApi,
_platform = platform ?? const LocalPlatform(); _platform = platform ?? const LocalPlatform();
Future<void> sync({bool full = false}) async { Future<void> sync({bool full = false}) async {
final Stopwatch stopwatch = Stopwatch()..start(); final Stopwatch stopwatch = Stopwatch()..start();
@@ -66,11 +66,14 @@ class LocalSyncService {
// On iOS, we need to full sync albums that are marked as cloud as the delta sync // On iOS, we need to full sync albums that are marked as cloud as the delta sync
// does not include changes for cloud albums. If ignoreIcloudAssets is enabled, // does not include changes for cloud albums. If ignoreIcloudAssets is enabled,
// remove the albums from the local database from the previous sync // remove the albums from the local database from the previous sync
final cloudAlbums = deviceAlbums.where((a) => a.isCloud).toLocalAlbums(); final cloudAlbums =
deviceAlbums.where((a) => a.isCloud).toLocalAlbums();
for (final album in cloudAlbums) { for (final album in cloudAlbums) {
final dbAlbum = dbAlbums.firstWhereOrNull((a) => a.id == album.id); final dbAlbum = dbAlbums.firstWhereOrNull((a) => a.id == album.id);
if (dbAlbum == null) { if (dbAlbum == null) {
_log.warning("Cloud album ${album.name} not found in local database. Skipping sync."); _log.warning(
"Cloud album ${album.name} not found in local database. Skipping sync.",
);
continue; continue;
} }
await updateAlbum(dbAlbum, album); await updateAlbum(dbAlbum, album);
@@ -92,7 +95,8 @@ class LocalSyncService {
final Stopwatch stopwatch = Stopwatch()..start(); final Stopwatch stopwatch = Stopwatch()..start();
final deviceAlbums = await _nativeSyncApi.getAlbums(); final deviceAlbums = await _nativeSyncApi.getAlbums();
final dbAlbums = await _localAlbumRepository.getAll(sortBy: {SortLocalAlbumsBy.id}); final dbAlbums =
await _localAlbumRepository.getAll(sortBy: {SortLocalAlbumsBy.id});
await diffSortedLists( await diffSortedLists(
dbAlbums, dbAlbums,
@@ -116,9 +120,14 @@ class LocalSyncService {
try { try {
_log.fine("Adding device album ${album.name}"); _log.fine("Adding device album ${album.name}");
final assets = album.assetCount > 0 ? await _nativeSyncApi.getAssetsForAlbum(album.id) : <PlatformAsset>[]; final assets = album.assetCount > 0
? await _nativeSyncApi.getAssetsForAlbum(album.id)
: <PlatformAsset>[];
await _localAlbumRepository.upsert(album, toUpsert: assets.toLocalAssets()); await _localAlbumRepository.upsert(
album,
toUpsert: assets.toLocalAssets(),
);
_log.fine("Successfully added device album ${album.name}"); _log.fine("Successfully added device album ${album.name}");
} catch (e, s) { } catch (e, s) {
_log.warning("Error while adding device album", e, s); _log.warning("Error while adding device album", e, s);
@@ -141,7 +150,9 @@ class LocalSyncService {
_log.fine("Syncing device album ${dbAlbum.name}"); _log.fine("Syncing device album ${dbAlbum.name}");
if (_albumsEqual(deviceAlbum, dbAlbum)) { if (_albumsEqual(deviceAlbum, dbAlbum)) {
_log.fine("Device album ${dbAlbum.name} has not changed. Skipping sync."); _log.fine(
"Device album ${dbAlbum.name} has not changed. Skipping sync.",
);
return false; return false;
} }
@@ -165,7 +176,10 @@ class LocalSyncService {
@visibleForTesting @visibleForTesting
// The [deviceAlbum] is expected to be refreshed before calling this method // The [deviceAlbum] is expected to be refreshed before calling this method
// with modified time and asset count // with modified time and asset count
Future<bool> checkAddition(LocalAlbum dbAlbum, LocalAlbum deviceAlbum) async { Future<bool> checkAddition(
LocalAlbum dbAlbum,
LocalAlbum deviceAlbum,
) async {
try { try {
_log.fine("Fast syncing device album ${dbAlbum.name}"); _log.fine("Fast syncing device album ${dbAlbum.name}");
// Assets has been modified // Assets has been modified
@@ -174,12 +188,16 @@ class LocalSyncService {
return false; return false;
} }
final updatedTime = (dbAlbum.updatedAt.millisecondsSinceEpoch ~/ 1000) + 1; final updatedTime =
final newAssetsCount = await _nativeSyncApi.getAssetsCountSince(deviceAlbum.id, updatedTime); (dbAlbum.updatedAt.millisecondsSinceEpoch ~/ 1000) + 1;
final newAssetsCount =
await _nativeSyncApi.getAssetsCountSince(deviceAlbum.id, updatedTime);
// Early return if no new assets were found // Early return if no new assets were found
if (newAssetsCount == 0) { if (newAssetsCount == 0) {
_log.fine("No new assets found despite album having changes. Proceeding to full sync for ${dbAlbum.name}"); _log.fine(
"No new assets found despite album having changes. Proceeding to full sync for ${dbAlbum.name}",
);
return false; return false;
} }
@@ -189,7 +207,10 @@ class LocalSyncService {
return false; return false;
} }
final newAssets = await _nativeSyncApi.getAssetsForAlbum(deviceAlbum.id, updatedTimeCond: updatedTime); final newAssets = await _nativeSyncApi.getAssetsForAlbum(
deviceAlbum.id,
updatedTimeCond: updatedTime,
);
await _localAlbumRepository.upsert( await _localAlbumRepository.upsert(
deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection), deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection),
@@ -209,12 +230,18 @@ class LocalSyncService {
Future<bool> fullDiff(LocalAlbum dbAlbum, LocalAlbum deviceAlbum) async { Future<bool> fullDiff(LocalAlbum dbAlbum, LocalAlbum deviceAlbum) async {
try { try {
final assetsInDevice = deviceAlbum.assetCount > 0 final assetsInDevice = deviceAlbum.assetCount > 0
? await _nativeSyncApi.getAssetsForAlbum(deviceAlbum.id).then((a) => a.toLocalAssets()) ? await _nativeSyncApi
.getAssetsForAlbum(deviceAlbum.id)
.then((a) => a.toLocalAssets())
: <LocalAsset>[];
final assetsInDb = dbAlbum.assetCount > 0
? await _localAlbumRepository.getAssets(dbAlbum.id)
: <LocalAsset>[]; : <LocalAsset>[];
final assetsInDb = dbAlbum.assetCount > 0 ? await _localAlbumRepository.getAssets(dbAlbum.id) : <LocalAsset>[];
if (deviceAlbum.assetCount == 0) { if (deviceAlbum.assetCount == 0) {
_log.fine("Device album ${deviceAlbum.name} is empty. Removing assets from DB."); _log.fine(
"Device album ${deviceAlbum.name} is empty. Removing assets from DB.",
);
await _localAlbumRepository.upsert( await _localAlbumRepository.upsert(
deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection), deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection),
toDelete: assetsInDb.map((a) => a.id), toDelete: assetsInDb.map((a) => a.id),
@@ -222,11 +249,18 @@ class LocalSyncService {
return true; return true;
} }
final updatedDeviceAlbum = deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection); final updatedDeviceAlbum = deviceAlbum.copyWith(
backupSelection: dbAlbum.backupSelection,
);
if (dbAlbum.assetCount == 0) { if (dbAlbum.assetCount == 0) {
_log.fine("Device album ${deviceAlbum.name} is empty. Adding assets to DB."); _log.fine(
await _localAlbumRepository.upsert(updatedDeviceAlbum, toUpsert: assetsInDevice); "Device album ${deviceAlbum.name} is empty. Adding assets to DB.",
);
await _localAlbumRepository.upsert(
updatedDeviceAlbum,
toUpsert: assetsInDevice,
);
return true; return true;
} }
@@ -258,12 +292,18 @@ class LocalSyncService {
); );
if (assetsToUpsert.isEmpty && assetsToDelete.isEmpty) { if (assetsToUpsert.isEmpty && assetsToDelete.isEmpty) {
_log.fine("No asset changes detected in album ${deviceAlbum.name}. Updating metadata."); _log.fine(
"No asset changes detected in album ${deviceAlbum.name}. Updating metadata.",
);
_localAlbumRepository.upsert(updatedDeviceAlbum); _localAlbumRepository.upsert(updatedDeviceAlbum);
return true; return true;
} }
await _localAlbumRepository.upsert(updatedDeviceAlbum, toUpsert: assetsToUpsert, toDelete: assetsToDelete); await _localAlbumRepository.upsert(
updatedDeviceAlbum,
toUpsert: assetsToUpsert,
toDelete: assetsToDelete,
);
return true; return true;
} catch (e, s) { } catch (e, s) {
@@ -281,7 +321,9 @@ class LocalSyncService {
} }
bool _albumsEqual(LocalAlbum a, LocalAlbum b) { bool _albumsEqual(LocalAlbum a, LocalAlbum b) {
return a.name == b.name && a.assetCount == b.assetCount && a.updatedAt.isAtSameMomentAs(b.updatedAt); return a.name == b.name &&
a.assetCount == b.assetCount &&
a.updatedAt.isAtSameMomentAs(b.updatedAt);
} }
} }
@@ -291,7 +333,9 @@ extension on Iterable<PlatformAlbum> {
(e) => LocalAlbum( (e) => LocalAlbum(
id: e.id, id: e.id,
name: e.name, name: e.name,
updatedAt: e.updatedAt == null ? DateTime.now() : DateTime.fromMillisecondsSinceEpoch(e.updatedAt! * 1000), updatedAt: e.updatedAt == null
? DateTime.now()
: DateTime.fromMillisecondsSinceEpoch(e.updatedAt! * 1000),
assetCount: e.assetCount, assetCount: e.assetCount,
), ),
).toList(); ).toList();
@@ -306,13 +350,16 @@ extension on Iterable<PlatformAsset> {
name: e.name, name: e.name,
checksum: null, checksum: null,
type: AssetType.values.elementAtOrNull(e.type) ?? AssetType.other, type: AssetType.values.elementAtOrNull(e.type) ?? AssetType.other,
createdAt: e.createdAt == null ? DateTime.now() : DateTime.fromMillisecondsSinceEpoch(e.createdAt! * 1000), createdAt: e.createdAt == null
updatedAt: e.updatedAt == null ? DateTime.now() : DateTime.fromMillisecondsSinceEpoch(e.updatedAt! * 1000), ? DateTime.now()
: DateTime.fromMillisecondsSinceEpoch(e.createdAt! * 1000),
updatedAt: e.updatedAt == null
? DateTime.now()
: DateTime.fromMillisecondsSinceEpoch(e.updatedAt! * 1000),
width: e.width, width: e.width,
height: e.height, height: e.height,
durationInSeconds: e.durationInSeconds, durationInSeconds: e.durationInSeconds,
orientation: e.orientation, orientation: e.orientation,
isFavorite: e.isFavorite,
), ),
).toList(); ).toList();
} }

View File

@@ -56,12 +56,17 @@ class LogService {
}) async { }) async {
final instance = LogService._(logRepository, storeRepository, shouldBuffer); final instance = LogService._(logRepository, storeRepository, shouldBuffer);
await logRepository.truncate(limit: kLogTruncateLimit); await logRepository.truncate(limit: kLogTruncateLimit);
final level = await instance._storeRepository.tryGet(StoreKey.logLevel) ?? LogLevel.info.index; final level = await instance._storeRepository.tryGet(StoreKey.logLevel) ??
LogLevel.info.index;
Logger.root.level = Level.LEVELS.elementAtOrNull(level) ?? Level.INFO; Logger.root.level = Level.LEVELS.elementAtOrNull(level) ?? Level.INFO;
return instance; return instance;
} }
LogService._(this._logRepository, this._storeRepository, this._shouldBuffer) { LogService._(
this._logRepository,
this._storeRepository,
this._shouldBuffer,
) {
_logSubscription = Logger.root.onRecord.listen(_handleLogRecord); _logSubscription = Logger.root.onRecord.listen(_handleLogRecord);
} }
@@ -85,7 +90,10 @@ class LogService {
if (_shouldBuffer) { if (_shouldBuffer) {
_msgBuffer.add(record); _msgBuffer.add(record);
_flushTimer ??= Timer(const Duration(seconds: 5), () => unawaited(flushBuffer())); _flushTimer ??= Timer(
const Duration(seconds: 5),
() => unawaited(flushBuffer()),
);
} else { } else {
unawaited(_logRepository.insert(record)); unawaited(_logRepository.insert(record));
} }
@@ -138,7 +146,9 @@ class LoggerUnInitializedException implements Exception {
/// Log levels according to dart logging [Level] /// Log levels according to dart logging [Level]
extension LevelDomainToInfraExtension on Level { extension LevelDomainToInfraExtension on Level {
LogLevel toLogLevel() => LogLevel.values.elementAtOrNull(Level.LEVELS.indexOf(this)) ?? LogLevel.info; LogLevel toLogLevel() =>
LogLevel.values.elementAtOrNull(Level.LEVELS.indexOf(this)) ??
LogLevel.info;
} }
extension on LogLevel { extension on LogLevel {

View File

@@ -1,23 +0,0 @@
import 'package:immich_mobile/domain/models/map.model.dart';
import 'package:immich_mobile/infrastructure/repositories/map.repository.dart';
import 'package:maplibre_gl/maplibre_gl.dart';
typedef MapMarkerSource = Future<List<Marker>> Function(LatLngBounds? bounds);
typedef MapQuery = ({MapMarkerSource markerSource});
class MapFactory {
final DriftMapRepository _mapRepository;
const MapFactory({required DriftMapRepository mapRepository}) : _mapRepository = mapRepository;
MapService remote(String ownerId) => MapService(_mapRepository.remote(ownerId));
}
class MapService {
final MapMarkerSource _markerSource;
MapService(MapQuery query) : _markerSource = query.markerSource;
Future<List<Marker>> Function(LatLngBounds? bounds) get getMarkers => _markerSource;
}

View File

@@ -13,10 +13,6 @@ class DriftMemoryService {
return _repository.getAll(ownerId); return _repository.getAll(ownerId);
} }
Future<DriftMemory?> get(String memoryId) {
return _repository.get(memoryId);
}
Future<int> getCount() { Future<int> getCount() {
return _repository.getCount(); return _repository.getCount();
} }

View File

@@ -7,7 +7,10 @@ class DriftPartnerService {
final DriftPartnerRepository _driftPartnerRepository; final DriftPartnerRepository _driftPartnerRepository;
final PartnerApiRepository _partnerApiRepository; final PartnerApiRepository _partnerApiRepository;
const DriftPartnerService(this._driftPartnerRepository, this._partnerApiRepository); const DriftPartnerService(
this._driftPartnerRepository,
this._partnerApiRepository,
);
Future<List<PartnerUserDto>> getSharedWith(String userId) { Future<List<PartnerUserDto>> getSharedWith(String userId) {
return _driftPartnerRepository.getSharedWith(userId); return _driftPartnerRepository.getSharedWith(userId);
@@ -17,9 +20,13 @@ class DriftPartnerService {
return _driftPartnerRepository.getSharedBy(userId); return _driftPartnerRepository.getSharedBy(userId);
} }
Future<List<PartnerUserDto>> getAvailablePartners(String currentUserId) async { Future<List<PartnerUserDto>> getAvailablePartners(
final otherUsers = await _driftPartnerRepository.getAvailablePartners(currentUserId); String currentUserId,
final currentPartners = await _driftPartnerRepository.getSharedBy(currentUserId); ) async {
final otherUsers =
await _driftPartnerRepository.getAvailablePartners(currentUserId);
final currentPartners =
await _driftPartnerRepository.getSharedBy(currentUserId);
final available = otherUsers.where((user) { final available = otherUsers.where((user) {
return !currentPartners.any((partner) => partner.id == user.id); return !currentPartners.any((partner) => partner.id == user.id);
}).toList(); }).toList();
@@ -34,7 +41,10 @@ class DriftPartnerService {
return; return;
} }
await _partnerApiRepository.update(partnerId, inTimeline: !partner.inTimeline); await _partnerApiRepository.update(
partnerId,
inTimeline: !partner.inTimeline,
);
await _driftPartnerRepository.toggleShowInTimeline(partner, userId); await _driftPartnerRepository.toggleShowInTimeline(partner, userId);
} }

View File

@@ -1,30 +0,0 @@
import 'dart:async';
import 'package:immich_mobile/domain/models/person.model.dart';
import 'package:immich_mobile/infrastructure/repositories/people.repository.dart';
import 'package:immich_mobile/repositories/person_api.repository.dart';
class DriftPeopleService {
final DriftPeopleRepository _repository;
final PersonApiRepository _personApiRepository;
const DriftPeopleService(this._repository, this._personApiRepository);
Future<List<DriftPerson>> getAssetPeople(String assetId) {
return _repository.getAssetPeople(assetId);
}
Future<List<DriftPerson>> getAllPeople() {
return _repository.getAllPeople();
}
Future<int> updateName(String personId, String name) async {
await _personApiRepository.update(personId, name: name);
return _repository.updateName(personId, name);
}
Future<int> updateBrithday(String personId, DateTime birthday) async {
await _personApiRepository.update(personId, birthday: birthday);
return _repository.updateBirthday(personId, birthday);
}
}

View File

@@ -22,11 +22,11 @@ class RemoteAlbumService {
return _repository.getAll(); return _repository.getAll();
} }
Future<RemoteAlbum?> get(String albumId) { List<RemoteAlbum> sortAlbums(
return _repository.get(albumId); List<RemoteAlbum> albums,
} RemoteAlbumSortMode sortMode, {
bool isReverse = false,
List<RemoteAlbum> sortAlbums(List<RemoteAlbum> albums, RemoteAlbumSortMode sortMode, {bool isReverse = false}) { }) {
return sortMode.sortFn(albums, isReverse); return sortMode.sortFn(albums, isReverse);
} }
@@ -44,7 +44,8 @@ class RemoteAlbumService {
filtered = filtered filtered = filtered
.where( .where(
(album) => (album) =>
album.name.toLowerCase().contains(lowerQuery) || album.description.toLowerCase().contains(lowerQuery), album.name.toLowerCase().contains(lowerQuery) ||
album.description.toLowerCase().contains(lowerQuery),
) )
.toList(); .toList();
} }
@@ -52,10 +53,12 @@ class RemoteAlbumService {
if (userId != null) { if (userId != null) {
switch (filterMode) { switch (filterMode) {
case QuickFilterMode.myAlbums: case QuickFilterMode.myAlbums:
filtered = filtered.where((album) => album.ownerId == userId).toList(); filtered =
filtered.where((album) => album.ownerId == userId).toList();
break; break;
case QuickFilterMode.sharedWithMe: case QuickFilterMode.sharedWithMe:
filtered = filtered.where((album) => album.ownerId != userId).toList(); filtered =
filtered.where((album) => album.ownerId != userId).toList();
break; break;
case QuickFilterMode.all: case QuickFilterMode.all:
break; break;
@@ -65,8 +68,16 @@ class RemoteAlbumService {
return filtered; return filtered;
} }
Future<RemoteAlbum> createAlbum({required String title, required List<String> assetIds, String? description}) async { Future<RemoteAlbum> createAlbum({
final album = await _albumApiRepository.createDriftAlbum(title, description: description, assetIds: assetIds); required String title,
required List<String> assetIds,
String? description,
}) async {
final album = await _albumApiRepository.createDriftAlbum(
title,
description: description,
assetIds: assetIds,
);
await _repository.create(album, assetIds); await _repository.create(album, assetIds);
@@ -108,8 +119,14 @@ class RemoteAlbumService {
return _repository.getAssets(albumId); return _repository.getAssets(albumId);
} }
Future<int> addAssets({required String albumId, required List<String> assetIds}) async { Future<int> addAssets({
final album = await _albumApiRepository.addAssets(albumId, assetIds); required String albumId,
required List<String> assetIds,
}) async {
final album = await _albumApiRepository.addAssets(
albumId,
assetIds,
);
await _repository.addAssets(albumId, album.added); await _repository.addAssets(albumId, album.added);
@@ -122,7 +139,10 @@ class RemoteAlbumService {
await _repository.deleteAlbum(albumId); await _repository.deleteAlbum(albumId);
} }
Future<void> addUsers({required String albumId, required List<String> userIds}) async { Future<void> addUsers({
required String albumId,
required List<String> userIds,
}) async {
await _albumApiRepository.addUsers(albumId, userIds); await _albumApiRepository.addUsers(albumId, userIds);
return _repository.addUsers(albumId, userIds); return _repository.addUsers(albumId, userIds);

View File

@@ -83,10 +83,10 @@ extension on AssetResponseDto {
extension on AssetTypeEnum { extension on AssetTypeEnum {
AssetType toAssetType() => switch (this) { AssetType toAssetType() => switch (this) {
AssetTypeEnum.IMAGE => AssetType.image, AssetTypeEnum.IMAGE => AssetType.image,
AssetTypeEnum.VIDEO => AssetType.video, AssetTypeEnum.VIDEO => AssetType.video,
AssetTypeEnum.AUDIO => AssetType.audio, AssetTypeEnum.AUDIO => AssetType.audio,
AssetTypeEnum.OTHER => AssetType.other, AssetTypeEnum.OTHER => AssetType.other,
_ => throw Exception('Unknown AssetType value: $this'), _ => throw Exception('Unknown AssetType value: $this'),
}; };
} }

View File

@@ -9,11 +9,16 @@ final AppSetting = SettingsService(storeService: StoreService.I);
class SettingsService { class SettingsService {
final StoreService _storeService; final StoreService _storeService;
const SettingsService({required StoreService storeService}) : _storeService = storeService; const SettingsService({required StoreService storeService})
: _storeService = storeService;
T get<T>(Setting<T> setting) => _storeService.get(setting.storeKey, setting.defaultValue); T get<T>(Setting<T> setting) =>
_storeService.get(setting.storeKey, setting.defaultValue);
Future<void> set<T>(Setting<T> setting, T value) => _storeService.put(setting.storeKey, value); Future<void> set<T>(Setting<T> setting, T value) =>
_storeService.put(setting.storeKey, value);
Stream<T> watch<T>(Setting<T> setting) => _storeService.watch(setting.storeKey).map((v) => v ?? setting.defaultValue); Stream<T> watch<T>(Setting<T> setting) => _storeService
.watch(setting.storeKey)
.map((v) => v ?? setting.defaultValue);
} }

View File

@@ -12,7 +12,8 @@ class StoreService {
final Map<int, Object?> _cache = {}; final Map<int, Object?> _cache = {};
late final StreamSubscription<StoreDto> _storeUpdateSubscription; late final StreamSubscription<StoreDto> _storeUpdateSubscription;
StoreService._({required IsarStoreRepository storeRepository}) : _storeRepository = storeRepository; StoreService._({required IsarStoreRepository storeRepository})
: _storeRepository = storeRepository;
// TODO: Temporary typedef to make minimal changes. Remove this and make the presentation layer access store through a provider // TODO: Temporary typedef to make minimal changes. Remove this and make the presentation layer access store through a provider
static StoreService? _instance; static StoreService? _instance;
@@ -24,12 +25,16 @@ class StoreService {
} }
// TODO: Replace the implementation with the one from create after removing the typedef // TODO: Replace the implementation with the one from create after removing the typedef
static Future<StoreService> init({required IsarStoreRepository storeRepository}) async { static Future<StoreService> init({
required IsarStoreRepository storeRepository,
}) async {
_instance ??= await create(storeRepository: storeRepository); _instance ??= await create(storeRepository: storeRepository);
return _instance!; return _instance!;
} }
static Future<StoreService> create({required IsarStoreRepository storeRepository}) async { static Future<StoreService> create({
required IsarStoreRepository storeRepository,
}) async {
final instance = StoreService._(storeRepository: storeRepository); final instance = StoreService._(storeRepository: storeRepository);
await instance._populateCache(); await instance._populateCache();
instance._storeUpdateSubscription = instance._listenForChange(); instance._storeUpdateSubscription = instance._listenForChange();
@@ -43,9 +48,10 @@ class StoreService {
} }
} }
StreamSubscription<StoreDto> _listenForChange() => _storeRepository.watchAll().listen((event) { StreamSubscription<StoreDto> _listenForChange() =>
_cache[event.key.id] = event.value; _storeRepository.watchAll().listen((event) {
}); _cache[event.key.id] = event.value;
});
/// Disposes the store and cancels the subscription. To reuse the store call init() again /// Disposes the store and cancels the subscription. To reuse the store call init() again
void dispose() async { void dispose() async {

View File

@@ -18,14 +18,14 @@ class SyncStreamService {
required SyncApiRepository syncApiRepository, required SyncApiRepository syncApiRepository,
required SyncStreamRepository syncStreamRepository, required SyncStreamRepository syncStreamRepository,
bool Function()? cancelChecker, bool Function()? cancelChecker,
}) : _syncApiRepository = syncApiRepository, }) : _syncApiRepository = syncApiRepository,
_syncStreamRepository = syncStreamRepository, _syncStreamRepository = syncStreamRepository,
_cancelChecker = cancelChecker; _cancelChecker = cancelChecker;
bool get isCancelled => _cancelChecker?.call() ?? false; bool get isCancelled => _cancelChecker?.call() ?? false;
Future<void> sync() { Future<void> sync() {
_logger.info("Remote sync request for user"); _logger.info("Remote sync request for userr");
DLog.log("Remote sync request for user"); DLog.log("Remote sync request for user");
// Start the sync stream and handle events // Start the sync stream and handle events
return _syncApiRepository.streamChanges(_handleEvents); return _syncApiRepository.streamChanges(_handleEvents);
@@ -34,7 +34,9 @@ class SyncStreamService {
Future<void> handleWsAssetUploadReadyV1Batch(List<dynamic> batchData) async { Future<void> handleWsAssetUploadReadyV1Batch(List<dynamic> batchData) async {
if (batchData.isEmpty) return; if (batchData.isEmpty) return;
_logger.info('Processing batch of ${batchData.length} AssetUploadReadyV1 events'); _logger.info(
'Processing batch of ${batchData.length} AssetUploadReadyV1 events',
);
final List<SyncAssetV1> assets = []; final List<SyncAssetV1> assets = [];
final List<SyncAssetExifV1> exifs = []; final List<SyncAssetExifV1> exifs = [];
@@ -63,12 +65,22 @@ class SyncStreamService {
} }
if (assets.isNotEmpty && exifs.isNotEmpty) { if (assets.isNotEmpty && exifs.isNotEmpty) {
await _syncStreamRepository.updateAssetsV1(assets, debugLabel: 'websocket-batch'); await _syncStreamRepository.updateAssetsV1(
await _syncStreamRepository.updateAssetsExifV1(exifs, debugLabel: 'websocket-batch'); assets,
debugLabel: 'websocket-batch',
);
await _syncStreamRepository.updateAssetsExifV1(
exifs,
debugLabel: 'websocket-batch',
);
_logger.info('Successfully processed ${assets.length} assets in batch'); _logger.info('Successfully processed ${assets.length} assets in batch');
} }
} catch (error, stackTrace) { } catch (error, stackTrace) {
_logger.severe("Error processing AssetUploadReadyV1 websocket batch events", error, stackTrace); _logger.severe(
"Error processing AssetUploadReadyV1 websocket batch events",
error,
stackTrace,
);
} }
} }
@@ -102,7 +114,10 @@ class SyncStreamService {
batch.clear(); batch.clear();
} }
Future<void> _handleSyncData(SyncEntityType type, Iterable<Object> data) async { Future<void> _handleSyncData(
SyncEntityType type,
Iterable<Object> data,
) async {
_logger.fine("Processing sync data for $type of length ${data.length}"); _logger.fine("Processing sync data for $type of length ${data.length}");
switch (type) { switch (type) {
case SyncEntityType.userV1: case SyncEntityType.userV1:
@@ -120,15 +135,30 @@ class SyncStreamService {
case SyncEntityType.assetExifV1: case SyncEntityType.assetExifV1:
return _syncStreamRepository.updateAssetsExifV1(data.cast()); return _syncStreamRepository.updateAssetsExifV1(data.cast());
case SyncEntityType.partnerAssetV1: case SyncEntityType.partnerAssetV1:
return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'partner'); return _syncStreamRepository.updateAssetsV1(
data.cast(),
debugLabel: 'partner',
);
case SyncEntityType.partnerAssetBackfillV1: case SyncEntityType.partnerAssetBackfillV1:
return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'partner backfill'); return _syncStreamRepository.updateAssetsV1(
data.cast(),
debugLabel: 'partner backfill',
);
case SyncEntityType.partnerAssetDeleteV1: case SyncEntityType.partnerAssetDeleteV1:
return _syncStreamRepository.deleteAssetsV1(data.cast(), debugLabel: "partner"); return _syncStreamRepository.deleteAssetsV1(
data.cast(),
debugLabel: "partner",
);
case SyncEntityType.partnerAssetExifV1: case SyncEntityType.partnerAssetExifV1:
return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'partner'); return _syncStreamRepository.updateAssetsExifV1(
data.cast(),
debugLabel: 'partner',
);
case SyncEntityType.partnerAssetExifBackfillV1: case SyncEntityType.partnerAssetExifBackfillV1:
return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'partner backfill'); return _syncStreamRepository.updateAssetsExifV1(
data.cast(),
debugLabel: 'partner backfill',
);
case SyncEntityType.albumV1: case SyncEntityType.albumV1:
return _syncStreamRepository.updateAlbumsV1(data.cast()); return _syncStreamRepository.updateAlbumsV1(data.cast());
case SyncEntityType.albumDeleteV1: case SyncEntityType.albumDeleteV1:
@@ -136,21 +166,39 @@ class SyncStreamService {
case SyncEntityType.albumUserV1: case SyncEntityType.albumUserV1:
return _syncStreamRepository.updateAlbumUsersV1(data.cast()); return _syncStreamRepository.updateAlbumUsersV1(data.cast());
case SyncEntityType.albumUserBackfillV1: case SyncEntityType.albumUserBackfillV1:
return _syncStreamRepository.updateAlbumUsersV1(data.cast(), debugLabel: 'backfill'); return _syncStreamRepository.updateAlbumUsersV1(
data.cast(),
debugLabel: 'backfill',
);
case SyncEntityType.albumUserDeleteV1: case SyncEntityType.albumUserDeleteV1:
return _syncStreamRepository.deleteAlbumUsersV1(data.cast()); return _syncStreamRepository.deleteAlbumUsersV1(data.cast());
case SyncEntityType.albumAssetV1: case SyncEntityType.albumAssetV1:
return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'album'); return _syncStreamRepository.updateAssetsV1(
data.cast(),
debugLabel: 'album',
);
case SyncEntityType.albumAssetBackfillV1: case SyncEntityType.albumAssetBackfillV1:
return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'album backfill'); return _syncStreamRepository.updateAssetsV1(
data.cast(),
debugLabel: 'album backfill',
);
case SyncEntityType.albumAssetExifV1: case SyncEntityType.albumAssetExifV1:
return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'album'); return _syncStreamRepository.updateAssetsExifV1(
data.cast(),
debugLabel: 'album',
);
case SyncEntityType.albumAssetExifBackfillV1: case SyncEntityType.albumAssetExifBackfillV1:
return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'album backfill'); return _syncStreamRepository.updateAssetsExifV1(
data.cast(),
debugLabel: 'album backfill',
);
case SyncEntityType.albumToAssetV1: case SyncEntityType.albumToAssetV1:
return _syncStreamRepository.updateAlbumToAssetsV1(data.cast()); return _syncStreamRepository.updateAlbumToAssetsV1(data.cast());
case SyncEntityType.albumToAssetBackfillV1: case SyncEntityType.albumToAssetBackfillV1:
return _syncStreamRepository.updateAlbumToAssetsV1(data.cast(), debugLabel: 'backfill'); return _syncStreamRepository.updateAlbumToAssetsV1(
data.cast(),
debugLabel: 'backfill',
);
case SyncEntityType.albumToAssetDeleteV1: case SyncEntityType.albumToAssetDeleteV1:
return _syncStreamRepository.deleteAlbumToAssetsV1(data.cast()); return _syncStreamRepository.deleteAlbumToAssetsV1(data.cast());
// No-op. SyncAckV1 entities are checkpoints in the sync stream // No-op. SyncAckV1 entities are checkpoints in the sync stream
@@ -170,15 +218,28 @@ class SyncStreamService {
case SyncEntityType.stackDeleteV1: case SyncEntityType.stackDeleteV1:
return _syncStreamRepository.deleteStacksV1(data.cast()); return _syncStreamRepository.deleteStacksV1(data.cast());
case SyncEntityType.partnerStackV1: case SyncEntityType.partnerStackV1:
return _syncStreamRepository.updateStacksV1(data.cast(), debugLabel: 'partner'); return _syncStreamRepository.updateStacksV1(
data.cast(),
debugLabel: 'partner',
);
case SyncEntityType.partnerStackBackfillV1: case SyncEntityType.partnerStackBackfillV1:
return _syncStreamRepository.updateStacksV1(data.cast(), debugLabel: 'partner backfill'); return _syncStreamRepository.updateStacksV1(
data.cast(),
debugLabel: 'partner backfill',
);
case SyncEntityType.partnerStackDeleteV1: case SyncEntityType.partnerStackDeleteV1:
return _syncStreamRepository.deleteStacksV1(data.cast(), debugLabel: 'partner'); return _syncStreamRepository.deleteStacksV1(
data.cast(),
debugLabel: 'partner',
);
case SyncEntityType.userMetadataV1: case SyncEntityType.userMetadataV1:
return _syncStreamRepository.updateUserMetadatasV1(data.cast()); return _syncStreamRepository.updateUserMetadatasV1(
data.cast(),
);
case SyncEntityType.userMetadataDeleteV1: case SyncEntityType.userMetadataDeleteV1:
return _syncStreamRepository.deleteUserMetadatasV1(data.cast()); return _syncStreamRepository.deleteUserMetadatasV1(
data.cast(),
);
case SyncEntityType.personV1: case SyncEntityType.personV1:
return _syncStreamRepository.updatePeopleV1(data.cast()); return _syncStreamRepository.updatePeopleV1(data.cast());
case SyncEntityType.personDeleteV1: case SyncEntityType.personDeleteV1:

View File

@@ -10,29 +10,34 @@ import 'package:immich_mobile/domain/services/setting.service.dart';
import 'package:immich_mobile/domain/utils/event_stream.dart'; import 'package:immich_mobile/domain/utils/event_stream.dart';
import 'package:immich_mobile/infrastructure/repositories/timeline.repository.dart'; import 'package:immich_mobile/infrastructure/repositories/timeline.repository.dart';
import 'package:immich_mobile/utils/async_mutex.dart'; import 'package:immich_mobile/utils/async_mutex.dart';
import 'package:maplibre_gl/maplibre_gl.dart';
typedef TimelineAssetSource = Future<List<BaseAsset>> Function(int index, int count); typedef TimelineAssetSource = Future<List<BaseAsset>> Function(
int index,
int count,
);
typedef TimelineBucketSource = Stream<List<Bucket>> Function(); typedef TimelineBucketSource = Stream<List<Bucket>> Function();
typedef TimelineQuery = ({TimelineAssetSource assetSource, TimelineBucketSource bucketSource}); typedef TimelineQuery = ({
TimelineAssetSource assetSource,
TimelineBucketSource bucketSource,
});
class TimelineFactory { class TimelineFactory {
final DriftTimelineRepository _timelineRepository; final DriftTimelineRepository _timelineRepository;
final SettingsService _settingsService; final SettingsService _settingsService;
const TimelineFactory({required DriftTimelineRepository timelineRepository, required SettingsService settingsService}) const TimelineFactory({
: _timelineRepository = timelineRepository, required DriftTimelineRepository timelineRepository,
_settingsService = settingsService; required SettingsService settingsService,
}) : _timelineRepository = timelineRepository,
_settingsService = settingsService;
GroupAssetsBy get groupBy { GroupAssetsBy get groupBy =>
final group = GroupAssetsBy.values[_settingsService.get(Setting.groupAssetsBy)]; GroupAssetsBy.values[_settingsService.get(Setting.groupAssetsBy)];
// We do not support auto grouping in the new timeline yet, fallback to day grouping
return group == GroupAssetsBy.auto ? GroupAssetsBy.day : group;
}
TimelineService main(List<String> timelineUsers) => TimelineService(_timelineRepository.main(timelineUsers, groupBy)); TimelineService main(List<String> timelineUsers) =>
TimelineService(_timelineRepository.main(timelineUsers, groupBy));
TimelineService localAlbum({required String albumId}) => TimelineService localAlbum({required String albumId}) =>
TimelineService(_timelineRepository.localAlbum(albumId, groupBy)); TimelineService(_timelineRepository.localAlbum(albumId, groupBy));
@@ -40,26 +45,29 @@ class TimelineFactory {
TimelineService remoteAlbum({required String albumId}) => TimelineService remoteAlbum({required String albumId}) =>
TimelineService(_timelineRepository.remoteAlbum(albumId, groupBy)); TimelineService(_timelineRepository.remoteAlbum(albumId, groupBy));
TimelineService remoteAssets(String userId) => TimelineService(_timelineRepository.remote(userId, groupBy)); TimelineService remoteAssets(String userId) =>
TimelineService(_timelineRepository.remote(userId, groupBy));
TimelineService favorite(String userId) => TimelineService(_timelineRepository.favorite(userId, groupBy)); TimelineService favorite(String userId) =>
TimelineService(_timelineRepository.favorite(userId, groupBy));
TimelineService trash(String userId) => TimelineService(_timelineRepository.trash(userId, groupBy)); TimelineService trash(String userId) =>
TimelineService(_timelineRepository.trash(userId, groupBy));
TimelineService archive(String userId) => TimelineService(_timelineRepository.archived(userId, groupBy)); TimelineService archive(String userId) =>
TimelineService(_timelineRepository.archived(userId, groupBy));
TimelineService lockedFolder(String userId) => TimelineService(_timelineRepository.locked(userId, groupBy)); TimelineService lockedFolder(String userId) =>
TimelineService(_timelineRepository.locked(userId, groupBy));
TimelineService video(String userId) => TimelineService(_timelineRepository.video(userId, groupBy)); TimelineService video(String userId) =>
TimelineService(_timelineRepository.video(userId, groupBy));
TimelineService place(String place) => TimelineService(_timelineRepository.place(place, groupBy)); TimelineService place(String place) =>
TimelineService(_timelineRepository.place(place, groupBy));
TimelineService person(String userId, String personId) => TimelineService fromAssets(List<BaseAsset> assets) =>
TimelineService(_timelineRepository.person(userId, personId, groupBy)); TimelineService(_timelineRepository.fromAssets(assets));
TimelineService fromAssets(List<BaseAsset> assets) => TimelineService(_timelineRepository.fromAssets(assets));
TimelineService map(LatLngBounds bounds) => TimelineService(_timelineRepository.map(bounds, groupBy));
} }
class TimelineService { class TimelineService {
@@ -73,14 +81,21 @@ class TimelineService {
int _totalAssets = 0; int _totalAssets = 0;
int get totalAssets => _totalAssets; int get totalAssets => _totalAssets;
TimelineService(TimelineQuery query) : this._(assetSource: query.assetSource, bucketSource: query.bucketSource); TimelineService(TimelineQuery query)
: this._(
assetSource: query.assetSource,
bucketSource: query.bucketSource,
);
TimelineService._({required TimelineAssetSource assetSource, required TimelineBucketSource bucketSource}) TimelineService._({
: _assetSource = assetSource, required TimelineAssetSource assetSource,
_bucketSource = bucketSource { required TimelineBucketSource bucketSource,
}) : _assetSource = assetSource,
_bucketSource = bucketSource {
_bucketSubscription = _bucketSource().listen((buckets) { _bucketSubscription = _bucketSource().listen((buckets) {
_mutex.run(() async { _mutex.run(() async {
final totalAssets = buckets.fold<int>(0, (acc, bucket) => acc + bucket.assetCount); final totalAssets =
buckets.fold<int>(0, (acc, bucket) => acc + bucket.assetCount);
if (totalAssets == 0) { if (totalAssets == 0) {
_bufferOffset = 0; _bufferOffset = 0;
@@ -95,7 +110,10 @@ class TimelineService {
count = kTimelineAssetLoadBatchSize; count = kTimelineAssetLoadBatchSize;
} else { } else {
offset = _bufferOffset; offset = _bufferOffset;
count = math.min(_buffer.length, totalAssets - _bufferOffset); count = math.min(
_buffer.length,
totalAssets - _bufferOffset,
);
} }
_buffer = await _assetSource(offset, count); _buffer = await _assetSource(offset, count);
_bufferOffset = offset; _bufferOffset = offset;
@@ -110,7 +128,8 @@ class TimelineService {
Stream<List<Bucket>> Function() get watchBuckets => _bucketSource; Stream<List<Bucket>> Function() get watchBuckets => _bucketSource;
Future<List<BaseAsset>> loadAssets(int index, int count) => _mutex.run(() => _loadAssets(index, count)); Future<List<BaseAsset>> loadAssets(int index, int count) =>
_mutex.run(() => _loadAssets(index, count));
Future<List<BaseAsset>> _loadAssets(int index, int count) async { Future<List<BaseAsset>> _loadAssets(int index, int count) async {
if (hasRange(index, count)) { if (hasRange(index, count)) {
@@ -123,7 +142,10 @@ class TimelineService {
// make sure to load a meaningful amount of data (and not only the requested slice) // make sure to load a meaningful amount of data (and not only the requested slice)
// otherwise, each call to [loadAssets] would result in DB call trashing performance // otherwise, each call to [loadAssets] would result in DB call trashing performance
// fills small requests to [kTimelineAssetLoadBatchSize], adds some legroom into the opposite scroll direction for large requests // fills small requests to [kTimelineAssetLoadBatchSize], adds some legroom into the opposite scroll direction for large requests
final len = math.max(kTimelineAssetLoadBatchSize, count + kTimelineAssetLoadOppositeSize); final len = math.max(
kTimelineAssetLoadBatchSize,
count + kTimelineAssetLoadOppositeSize,
);
// when scrolling forward, start shortly before the requested offset // when scrolling forward, start shortly before the requested offset
// when scrolling backward, end shortly after the requested offset to guard against the user scrolling // when scrolling backward, end shortly after the requested offset to guard against the user scrolling
// in the other direction a tiny bit resulting in another required load from the DB // in the other direction a tiny bit resulting in another required load from the DB
@@ -156,9 +178,11 @@ class TimelineService {
} }
// Pre-cache assets around the given index for asset viewer // Pre-cache assets around the given index for asset viewer
Future<void> preCacheAssets(int index) => _mutex.run(() => _loadAssets(index, math.min(5, _totalAssets - index))); Future<void> preCacheAssets(int index) =>
_mutex.run(() => _loadAssets(index, math.min(5, _totalAssets - index)));
BaseAsset getRandomAsset() => _buffer.elementAt(math.Random().nextInt(_buffer.length)); BaseAsset getRandomAsset() =>
_buffer.elementAt(math.Random().nextInt(_buffer.length));
BaseAsset getAsset(int index) { BaseAsset getAsset(int index) {
if (!hasRange(index, 1)) { if (!hasRange(index, 1)) {

View File

@@ -18,9 +18,9 @@ class UserService {
required IsarUserRepository isarUserRepository, required IsarUserRepository isarUserRepository,
required UserApiRepository userApiRepository, required UserApiRepository userApiRepository,
required StoreService storeService, required StoreService storeService,
}) : _isarUserRepository = isarUserRepository, }) : _isarUserRepository = isarUserRepository,
_userApiRepository = userApiRepository, _userApiRepository = userApiRepository,
_storeService = storeService; _storeService = storeService;
UserDto getMyUser() { UserDto getMyUser() {
return _storeService.get(StoreKey.currentUser); return _storeService.get(StoreKey.currentUser);
@@ -44,7 +44,10 @@ class UserService {
Future<String?> createProfileImage(String name, Uint8List image) async { Future<String?> createProfileImage(String name, Uint8List image) async {
try { try {
final path = await _userApiRepository.createProfileImage(name: name, data: image); final path = await _userApiRepository.createProfileImage(
name: name,
data: image,
);
final updatedUser = getMyUser().copyWith(profileImagePath: path); final updatedUser = getMyUser().copyWith(profileImagePath: path);
await _storeService.put(StoreKey.currentUser, updatedUser); await _storeService.put(StoreKey.currentUser, updatedUser);
await _isarUserRepository.update(updatedUser); await _isarUserRepository.update(updatedUser);

View File

@@ -66,21 +66,25 @@ class BackgroundSyncManager {
// We use a ternary operator to avoid [_deviceAlbumSyncTask] from being // We use a ternary operator to avoid [_deviceAlbumSyncTask] from being
// captured by the closure passed to [runInIsolateGentle]. // captured by the closure passed to [runInIsolateGentle].
_deviceAlbumSyncTask = full _deviceAlbumSyncTask = full
? runInIsolateGentle(computation: (ref) => ref.read(localSyncServiceProvider).sync(full: true)) ? runInIsolateGentle(
: runInIsolateGentle(computation: (ref) => ref.read(localSyncServiceProvider).sync(full: false)); computation: (ref) =>
ref.read(localSyncServiceProvider).sync(full: true),
)
: runInIsolateGentle(
computation: (ref) =>
ref.read(localSyncServiceProvider).sync(full: false),
);
return _deviceAlbumSyncTask! return _deviceAlbumSyncTask!.whenComplete(() {
.whenComplete(() { _deviceAlbumSyncTask = null;
_deviceAlbumSyncTask = null; onLocalSyncComplete?.call();
onLocalSyncComplete?.call(); }).catchError((error) {
}) onLocalSyncError?.call(error.toString());
.catchError((error) { _deviceAlbumSyncTask = null;
onLocalSyncError?.call(error.toString()); });
_deviceAlbumSyncTask = null;
});
} }
// No need to cancel the task, as it can also be run when the user logs out // No need to cancel the task, as it can also be run when the user logs out
Future<void> hashAssets() { Future<void> hashAssets() {
if (_hashTask != null) { if (_hashTask != null) {
return _hashTask!.future; return _hashTask!.future;
@@ -88,17 +92,17 @@ class BackgroundSyncManager {
onHashingStart?.call(); onHashingStart?.call();
_hashTask = runInIsolateGentle(computation: (ref) => ref.read(hashServiceProvider).hashAssets()); _hashTask = runInIsolateGentle(
computation: (ref) => ref.read(hashServiceProvider).hashAssets(),
);
return _hashTask! return _hashTask!.whenComplete(() {
.whenComplete(() { onHashingComplete?.call();
onHashingComplete?.call(); _hashTask = null;
_hashTask = null; }).catchError((error) {
}) onHashingError?.call(error.toString());
.catchError((error) { _hashTask = null;
onHashingError?.call(error.toString()); });
_hashTask = null;
});
} }
Future<void> syncRemote() { Future<void> syncRemote() {
@@ -108,16 +112,16 @@ class BackgroundSyncManager {
onRemoteSyncStart?.call(); onRemoteSyncStart?.call();
_syncTask = runInIsolateGentle(computation: (ref) => ref.read(syncStreamServiceProvider).sync()); _syncTask = runInIsolateGentle(
return _syncTask! computation: (ref) => ref.read(syncStreamServiceProvider).sync(),
.whenComplete(() { );
onRemoteSyncComplete?.call(); return _syncTask!.whenComplete(() {
_syncTask = null; onRemoteSyncComplete?.call();
}) _syncTask = null;
.catchError((error) { }).catchError((error) {
onRemoteSyncError?.call(error.toString()); onRemoteSyncError?.call(error.toString());
_syncTask = null; _syncTask = null;
}); });
} }
Future<void> syncWebsocketBatch(List<dynamic> batchData) { Future<void> syncWebsocketBatch(List<dynamic> batchData) {
@@ -131,6 +135,11 @@ class BackgroundSyncManager {
} }
} }
Cancelable<void> _handleWsAssetUploadReadyV1Batch(List<dynamic> batchData) => runInIsolateGentle( Cancelable<void> _handleWsAssetUploadReadyV1Batch(
computation: (ref) => ref.read(syncStreamServiceProvider).handleWsAssetUploadReadyV1Batch(batchData), List<dynamic> batchData,
); ) =>
runInIsolateGentle(
computation: (ref) => ref
.read(syncStreamServiceProvider)
.handleWsAssetUploadReadyV1Batch(batchData),
);

View File

@@ -9,7 +9,8 @@ class EventStream {
static final EventStream shared = EventStream._(); static final EventStream shared = EventStream._();
final StreamController<Event> _controller = StreamController<Event>.broadcast(); final StreamController<Event> _controller =
StreamController<Event>.broadcast();
void emit(Event event) { void emit(Event event) {
_controller.add(event); _controller.add(event);
@@ -28,7 +29,12 @@ class EventStream {
void Function()? onDone, void Function()? onDone,
bool? cancelOnError, bool? cancelOnError,
}) { }) {
return where<T>().listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError); return where<T>().listen(
onData,
onError: onError,
onDone: onDone,
cancelOnError: cancelOnError,
);
} }
/// Closes the stream controller /// Closes the stream controller

View File

@@ -95,11 +95,13 @@ class Album {
// accessible in an object freshly created (not loaded from DB) // accessible in an object freshly created (not loaded from DB)
@ignore @ignore
Iterable<User> get remoteUsers => Iterable<User> get remoteUsers => sharedUsers.isEmpty
sharedUsers.isEmpty ? (sharedUsers as IsarLinksCommon<User>).addedObjects : sharedUsers; ? (sharedUsers as IsarLinksCommon<User>).addedObjects
: sharedUsers;
@ignore @ignore
Iterable<Asset> get remoteAssets => assets.isEmpty ? (assets as IsarLinksCommon<Asset>).addedObjects : assets; Iterable<Asset> get remoteAssets =>
assets.isEmpty ? (assets as IsarLinksCommon<Asset>).addedObjects : assets;
@override @override
bool operator ==(other) { bool operator ==(other) {
@@ -113,7 +115,10 @@ class Album {
modifiedAt.isAtSameMomentAs(other.modifiedAt) && modifiedAt.isAtSameMomentAs(other.modifiedAt) &&
isAtSameMomentAs(startDate, other.startDate) && isAtSameMomentAs(startDate, other.startDate) &&
isAtSameMomentAs(endDate, other.endDate) && isAtSameMomentAs(endDate, other.endDate) &&
isAtSameMomentAs(lastModifiedAssetTimestamp, other.lastModifiedAssetTimestamp) && isAtSameMomentAs(
lastModifiedAssetTimestamp,
other.lastModifiedAssetTimestamp,
) &&
shared == other.shared && shared == other.shared &&
activityEnabled == other.activityEnabled && activityEnabled == other.activityEnabled &&
owner.value == other.owner.value && owner.value == other.owner.value &&
@@ -159,25 +164,33 @@ class Album {
a.remoteAssetCount = dto.assetCount; a.remoteAssetCount = dto.assetCount;
a.owner.value = await db.users.getById(dto.ownerId); a.owner.value = await db.users.getById(dto.ownerId);
if (dto.order != null) { if (dto.order != null) {
a.sortOrder = dto.order == AssetOrder.asc ? SortOrder.asc : SortOrder.desc; a.sortOrder =
dto.order == AssetOrder.asc ? SortOrder.asc : SortOrder.desc;
} }
if (dto.albumThumbnailAssetId != null) { if (dto.albumThumbnailAssetId != null) {
a.thumbnail.value = await db.assets.where().remoteIdEqualTo(dto.albumThumbnailAssetId).findFirst(); a.thumbnail.value = await db.assets
.where()
.remoteIdEqualTo(dto.albumThumbnailAssetId)
.findFirst();
} }
if (dto.albumUsers.isNotEmpty) { if (dto.albumUsers.isNotEmpty) {
final users = await db.users.getAllById(dto.albumUsers.map((e) => e.user.id).toList(growable: false)); final users = await db.users.getAllById(
dto.albumUsers.map((e) => e.user.id).toList(growable: false),
);
a.sharedUsers.addAll(users.cast()); a.sharedUsers.addAll(users.cast());
} }
if (dto.assets.isNotEmpty) { if (dto.assets.isNotEmpty) {
final assets = await db.assets.getAllByRemoteId(dto.assets.map((e) => e.id)); final assets =
await db.assets.getAllByRemoteId(dto.assets.map((e) => e.id));
a.assets.addAll(assets); a.assets.addAll(assets);
} }
return a; return a;
} }
@override @override
String toString() => 'remoteId: $remoteId name: $name description: $description'; String toString() =>
'remoteId: $remoteId name: $name description: $description';
} }
extension AssetsHelper on IsarCollection<Album> { extension AssetsHelper on IsarCollection<Album> {

File diff suppressed because it is too large Load Diff

View File

@@ -18,9 +18,12 @@ const AndroidDeviceAssetSchema = CollectionSchema(
name: r'AndroidDeviceAsset', name: r'AndroidDeviceAsset',
id: -6758387181232899335, id: -6758387181232899335,
properties: { properties: {
r'hash': PropertySchema(id: 0, name: r'hash', type: IsarType.byteList), r'hash': PropertySchema(
id: 0,
name: r'hash',
type: IsarType.byteList,
)
}, },
estimateSize: _androidDeviceAssetEstimateSize, estimateSize: _androidDeviceAssetEstimateSize,
serialize: _androidDeviceAssetSerialize, serialize: _androidDeviceAssetSerialize,
deserialize: _androidDeviceAssetDeserialize, deserialize: _androidDeviceAssetDeserialize,
@@ -37,13 +40,12 @@ const AndroidDeviceAssetSchema = CollectionSchema(
name: r'hash', name: r'hash',
type: IndexType.hash, type: IndexType.hash,
caseSensitive: false, caseSensitive: false,
), )
], ],
), )
}, },
links: {}, links: {},
embeddedSchemas: {}, embeddedSchemas: {},
getId: _androidDeviceAssetGetId, getId: _androidDeviceAssetGetId,
getLinks: _androidDeviceAssetGetLinks, getLinks: _androidDeviceAssetGetLinks,
attach: _androidDeviceAssetAttach, attach: _androidDeviceAssetAttach,
@@ -101,16 +103,12 @@ Id _androidDeviceAssetGetId(AndroidDeviceAsset object) {
} }
List<IsarLinkBase<dynamic>> _androidDeviceAssetGetLinks( List<IsarLinkBase<dynamic>> _androidDeviceAssetGetLinks(
AndroidDeviceAsset object, AndroidDeviceAsset object) {
) {
return []; return [];
} }
void _androidDeviceAssetAttach( void _androidDeviceAssetAttach(
IsarCollection<dynamic> col, IsarCollection<dynamic> col, Id id, AndroidDeviceAsset object) {
Id id,
AndroidDeviceAsset object,
) {
object.id = id; object.id = id;
} }
@@ -126,14 +124,17 @@ extension AndroidDeviceAssetQueryWhereSort
extension AndroidDeviceAssetQueryWhere extension AndroidDeviceAssetQueryWhere
on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QWhereClause> { on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QWhereClause> {
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
idEqualTo(Id id) { idEqualTo(Id id) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause(IdWhereClause.between(lower: id, upper: id)); return query.addWhereClause(IdWhereClause.between(
lower: id,
upper: id,
));
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
idNotEqualTo(Id id) { idNotEqualTo(Id id) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
if (query.whereSort == Sort.asc) { if (query.whereSort == Sort.asc) {
return query return query
@@ -156,7 +157,7 @@ extension AndroidDeviceAssetQueryWhere
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
idGreaterThan(Id id, {bool include = false}) { idGreaterThan(Id id, {bool include = false}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(
IdWhereClause.greaterThan(lower: id, includeLower: include), IdWhereClause.greaterThan(lower: id, includeLower: include),
@@ -165,7 +166,7 @@ extension AndroidDeviceAssetQueryWhere
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
idLessThan(Id id, {bool include = false}) { idLessThan(Id id, {bool include = false}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(
IdWhereClause.lessThan(upper: id, includeUpper: include), IdWhereClause.lessThan(upper: id, includeUpper: include),
@@ -174,72 +175,63 @@ extension AndroidDeviceAssetQueryWhere
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
idBetween( idBetween(
Id lowerId, Id lowerId,
Id upperId, { Id upperId, {
bool includeLower = true, bool includeLower = true,
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IdWhereClause.between(
IdWhereClause.between( lower: lowerId,
lower: lowerId, includeLower: includeLower,
includeLower: includeLower, upper: upperId,
upper: upperId, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
hashEqualTo(List<int> hash) { hashEqualTo(List<int> hash) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IndexWhereClause.equalTo(
IndexWhereClause.equalTo(indexName: r'hash', value: [hash]), indexName: r'hash',
); value: [hash],
));
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
hashNotEqualTo(List<int> hash) { hashNotEqualTo(List<int> hash) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
if (query.whereSort == Sort.asc) { if (query.whereSort == Sort.asc) {
return query return query
.addWhereClause( .addWhereClause(IndexWhereClause.between(
IndexWhereClause.between( indexName: r'hash',
indexName: r'hash', lower: [],
lower: [], upper: [hash],
upper: [hash], includeUpper: false,
includeUpper: false, ))
), .addWhereClause(IndexWhereClause.between(
) indexName: r'hash',
.addWhereClause( lower: [hash],
IndexWhereClause.between( includeLower: false,
indexName: r'hash', upper: [],
lower: [hash], ));
includeLower: false,
upper: [],
),
);
} else { } else {
return query return query
.addWhereClause( .addWhereClause(IndexWhereClause.between(
IndexWhereClause.between( indexName: r'hash',
indexName: r'hash', lower: [hash],
lower: [hash], includeLower: false,
includeLower: false, upper: [],
upper: [], ))
), .addWhereClause(IndexWhereClause.between(
) indexName: r'hash',
.addWhereClause( lower: [],
IndexWhereClause.between( upper: [hash],
indexName: r'hash', includeUpper: false,
lower: [], ));
upper: [hash],
includeUpper: false,
),
);
} }
}); });
} }
@@ -248,97 +240,134 @@ extension AndroidDeviceAssetQueryWhere
extension AndroidDeviceAssetQueryFilter extension AndroidDeviceAssetQueryFilter
on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QFilterCondition> { on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QFilterCondition> {
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashElementEqualTo(int value) { hashElementEqualTo(int value) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'hash', value: value), property: r'hash',
); value: value,
));
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashElementGreaterThan(int value, {bool include = false}) { hashElementGreaterThan(
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'hash',
property: r'hash', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashElementLessThan(int value, {bool include = false}) { hashElementLessThan(
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'hash',
property: r'hash', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashElementBetween( hashElementBetween(
int lower, int lower,
int upper, { int upper, {
bool includeLower = true, bool includeLower = true,
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'hash',
property: r'hash', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, ));
), });
}
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashLengthEqualTo(int length) {
return QueryBuilder.apply(this, (query) {
return query.listLength(
r'hash',
length,
true,
length,
true,
); );
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashLengthEqualTo(int length) { hashIsEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength(r'hash', length, true, length, true); return query.listLength(
r'hash',
0,
true,
0,
true,
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashIsEmpty() { hashIsNotEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength(r'hash', 0, true, 0, true); return query.listLength(
r'hash',
0,
false,
999999,
true,
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashIsNotEmpty() { hashLengthLessThan(
int length, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength(r'hash', 0, false, 999999, true); return query.listLength(
r'hash',
0,
true,
length,
include,
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashLengthLessThan(int length, {bool include = false}) { hashLengthGreaterThan(
int length, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength(r'hash', 0, true, length, include); return query.listLength(
r'hash',
length,
include,
999999,
true,
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashLengthGreaterThan(int length, {bool include = false}) { hashLengthBetween(
return QueryBuilder.apply(this, (query) {
return query.listLength(r'hash', length, include, 999999, true);
});
}
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashLengthBetween(
int lower, int lower,
int upper, { int upper, {
bool includeLower = true, bool includeLower = true,
@@ -356,57 +385,58 @@ extension AndroidDeviceAssetQueryFilter
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
idEqualTo(Id value) { idEqualTo(Id value) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'id', value: value), property: r'id',
); value: value,
));
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
idGreaterThan(Id value, {bool include = false}) { idGreaterThan(
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'id',
property: r'id', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
idLessThan(Id value, {bool include = false}) { idLessThan(
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'id',
property: r'id', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
idBetween( idBetween(
Id lower, Id lower,
Id upper, { Id upper, {
bool includeLower = true, bool includeLower = true,
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'id',
property: r'id', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
} }
@@ -423,14 +453,14 @@ extension AndroidDeviceAssetQuerySortBy
extension AndroidDeviceAssetQuerySortThenBy extension AndroidDeviceAssetQuerySortThenBy
on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QSortThenBy> { on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QSortThenBy> {
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterSortBy> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterSortBy>
thenById() { thenById() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'id', Sort.asc); return query.addSortBy(r'id', Sort.asc);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterSortBy> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterSortBy>
thenByIdDesc() { thenByIdDesc() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'id', Sort.desc); return query.addSortBy(r'id', Sort.desc);
}); });
@@ -440,7 +470,7 @@ extension AndroidDeviceAssetQuerySortThenBy
extension AndroidDeviceAssetQueryWhereDistinct extension AndroidDeviceAssetQueryWhereDistinct
on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QDistinct> { on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QDistinct> {
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QDistinct> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QDistinct>
distinctByHash() { distinctByHash() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'hash'); return query.addDistinctBy(r'hash');
}); });

View File

@@ -4,7 +4,8 @@ import 'dart:io';
import 'package:immich_mobile/constants/enums.dart'; import 'package:immich_mobile/constants/enums.dart';
import 'package:immich_mobile/domain/models/exif.model.dart'; import 'package:immich_mobile/domain/models/exif.model.dart';
import 'package:immich_mobile/extensions/string_extensions.dart'; import 'package:immich_mobile/extensions/string_extensions.dart';
import 'package:immich_mobile/infrastructure/entities/exif.entity.dart' as entity; import 'package:immich_mobile/infrastructure/entities/exif.entity.dart'
as entity;
import 'package:immich_mobile/infrastructure/utils/exif.converter.dart'; import 'package:immich_mobile/infrastructure/utils/exif.converter.dart';
import 'package:immich_mobile/utils/diff.dart'; import 'package:immich_mobile/utils/diff.dart';
import 'package:immich_mobile/utils/hash.dart'; import 'package:immich_mobile/utils/hash.dart';
@@ -19,30 +20,34 @@ part 'asset.entity.g.dart';
@Collection(inheritance: false) @Collection(inheritance: false)
class Asset { class Asset {
Asset.remote(AssetResponseDto remote) Asset.remote(AssetResponseDto remote)
: remoteId = remote.id, : remoteId = remote.id,
checksum = remote.checksum, checksum = remote.checksum,
fileCreatedAt = remote.fileCreatedAt, fileCreatedAt = remote.fileCreatedAt,
fileModifiedAt = remote.fileModifiedAt, fileModifiedAt = remote.fileModifiedAt,
updatedAt = remote.updatedAt, updatedAt = remote.updatedAt,
durationInSeconds = remote.duration.toDuration()?.inSeconds ?? 0, durationInSeconds = remote.duration.toDuration()?.inSeconds ?? 0,
type = remote.type.toAssetType(), type = remote.type.toAssetType(),
fileName = remote.originalFileName, fileName = remote.originalFileName,
height = remote.exifInfo?.exifImageHeight?.toInt(), height = remote.exifInfo?.exifImageHeight?.toInt(),
width = remote.exifInfo?.exifImageWidth?.toInt(), width = remote.exifInfo?.exifImageWidth?.toInt(),
livePhotoVideoId = remote.livePhotoVideoId, livePhotoVideoId = remote.livePhotoVideoId,
ownerId = fastHash(remote.ownerId), ownerId = fastHash(remote.ownerId),
exifInfo = remote.exifInfo == null ? null : ExifDtoConverter.fromDto(remote.exifInfo!), exifInfo = remote.exifInfo == null
isFavorite = remote.isFavorite, ? null
isArchived = remote.isArchived, : ExifDtoConverter.fromDto(remote.exifInfo!),
isTrashed = remote.isTrashed, isFavorite = remote.isFavorite,
isOffline = remote.isOffline, isArchived = remote.isArchived,
// workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app isTrashed = remote.isTrashed,
// stack handling to properly handle it isOffline = remote.isOffline,
stackPrimaryAssetId = remote.stack?.primaryAssetId == remote.id ? null : remote.stack?.primaryAssetId, // workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app
stackCount = remote.stack?.assetCount ?? 0, // stack handling to properly handle it
stackId = remote.stack?.id, stackPrimaryAssetId = remote.stack?.primaryAssetId == remote.id
thumbhash = remote.thumbhash, ? null
visibility = getVisibility(remote.visibility); : remote.stack?.primaryAssetId,
stackCount = remote.stack?.assetCount ?? 0,
stackId = remote.stack?.id,
thumbhash = remote.thumbhash,
visibility = getVisibility(remote.visibility);
Asset({ Asset({
this.id = Isar.autoIncrement, this.id = Isar.autoIncrement,
@@ -103,7 +108,8 @@ class Asset {
throw Exception('Asset $fileName has no local data'); throw Exception('Asset $fileName has no local data');
} }
final updatedLocal = _didUpdateLocal ? local : await local.obtainForNewProperties(); final updatedLocal =
_didUpdateLocal ? local : await local.obtainForNewProperties();
if (updatedLocal == null) { if (updatedLocal == null) {
throw Exception('Could not fetch local data for $fileName'); throw Exception('Could not fetch local data for $fileName');
} }
@@ -127,7 +133,11 @@ class Asset {
@Index(unique: false, replace: false, type: IndexType.hash) @Index(unique: false, replace: false, type: IndexType.hash)
String? localId; String? localId;
@Index(unique: true, replace: false, composite: [CompositeIndex("checksum", type: IndexType.hash)]) @Index(
unique: true,
replace: false,
composite: [CompositeIndex("checksum", type: IndexType.hash)],
)
int ownerId; int ownerId;
DateTime fileCreatedAt; DateTime fileCreatedAt;
@@ -175,7 +185,10 @@ class Asset {
final orientatedWidth = this.orientatedWidth; final orientatedWidth = this.orientatedWidth;
final orientatedHeight = this.orientatedHeight; final orientatedHeight = this.orientatedHeight;
if (orientatedWidth != null && orientatedHeight != null && orientatedWidth > 0 && orientatedHeight > 0) { if (orientatedWidth != null &&
orientatedHeight != null &&
orientatedWidth > 0 &&
orientatedHeight > 0) {
return orientatedWidth.toDouble() / orientatedHeight.toDouble(); return orientatedWidth.toDouble() / orientatedHeight.toDouble();
} }
@@ -376,7 +389,8 @@ class Asset {
// workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app // workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app
// stack handling to properly handle it // stack handling to properly handle it
stackId: stackId, stackId: stackId,
stackPrimaryAssetId: stackPrimaryAssetId == remoteId ? null : stackPrimaryAssetId, stackPrimaryAssetId:
stackPrimaryAssetId == remoteId ? null : stackPrimaryAssetId,
stackCount: stackCount, stackCount: stackCount,
isFavorite: isFavorite, isFavorite: isFavorite,
isArchived: isArchived, isArchived: isArchived,
@@ -396,7 +410,9 @@ class Asset {
// workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app // workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app
// stack handling to properly handle it // stack handling to properly handle it
stackId: a.stackId, stackId: a.stackId,
stackPrimaryAssetId: a.stackPrimaryAssetId == a.remoteId ? null : a.stackPrimaryAssetId, stackPrimaryAssetId: a.stackPrimaryAssetId == a.remoteId
? null
: a.stackPrimaryAssetId,
stackCount: a.stackCount, stackCount: a.stackCount,
// isFavorite + isArchived are not set by device-only assets // isFavorite + isArchived are not set by device-only assets
isFavorite: a.isFavorite, isFavorite: a.isFavorite,
@@ -412,7 +428,8 @@ class Asset {
localId: localId ?? a.localId, localId: localId ?? a.localId,
width: width ?? a.width, width: width ?? a.width,
height: height ?? a.height, height: height ?? a.height,
exifInfo: exifInfo ?? a.exifInfo?.copyWith(assetId: id), // updated to use assetId exifInfo: exifInfo ??
a.exifInfo?.copyWith(assetId: id), // updated to use assetId
); );
} }
} }
@@ -443,45 +460,49 @@ class Asset {
int? stackCount, int? stackCount,
String? thumbhash, String? thumbhash,
AssetVisibilityEnum? visibility, AssetVisibilityEnum? visibility,
}) => Asset( }) =>
id: id ?? this.id, Asset(
checksum: checksum ?? this.checksum, id: id ?? this.id,
remoteId: remoteId ?? this.remoteId, checksum: checksum ?? this.checksum,
localId: localId ?? this.localId, remoteId: remoteId ?? this.remoteId,
ownerId: ownerId ?? this.ownerId, localId: localId ?? this.localId,
fileCreatedAt: fileCreatedAt ?? this.fileCreatedAt, ownerId: ownerId ?? this.ownerId,
fileModifiedAt: fileModifiedAt ?? this.fileModifiedAt, fileCreatedAt: fileCreatedAt ?? this.fileCreatedAt,
updatedAt: updatedAt ?? this.updatedAt, fileModifiedAt: fileModifiedAt ?? this.fileModifiedAt,
durationInSeconds: durationInSeconds ?? this.durationInSeconds, updatedAt: updatedAt ?? this.updatedAt,
type: type ?? this.type, durationInSeconds: durationInSeconds ?? this.durationInSeconds,
width: width ?? this.width, type: type ?? this.type,
height: height ?? this.height, width: width ?? this.width,
fileName: fileName ?? this.fileName, height: height ?? this.height,
livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, fileName: fileName ?? this.fileName,
isFavorite: isFavorite ?? this.isFavorite, livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId,
isArchived: isArchived ?? this.isArchived, isFavorite: isFavorite ?? this.isFavorite,
isTrashed: isTrashed ?? this.isTrashed, isArchived: isArchived ?? this.isArchived,
isOffline: isOffline ?? this.isOffline, isTrashed: isTrashed ?? this.isTrashed,
exifInfo: exifInfo ?? this.exifInfo, isOffline: isOffline ?? this.isOffline,
stackId: stackId ?? this.stackId, exifInfo: exifInfo ?? this.exifInfo,
stackPrimaryAssetId: stackPrimaryAssetId ?? this.stackPrimaryAssetId, stackId: stackId ?? this.stackId,
stackCount: stackCount ?? this.stackCount, stackPrimaryAssetId: stackPrimaryAssetId ?? this.stackPrimaryAssetId,
thumbhash: thumbhash ?? this.thumbhash, stackCount: stackCount ?? this.stackCount,
visibility: visibility ?? this.visibility, thumbhash: thumbhash ?? this.thumbhash,
); visibility: visibility ?? this.visibility,
);
Future<void> put(Isar db) async { Future<void> put(Isar db) async {
await db.assets.put(this); await db.assets.put(this);
if (exifInfo != null) { if (exifInfo != null) {
await db.exifInfos.put(entity.ExifInfo.fromDto(exifInfo!.copyWith(assetId: id))); await db.exifInfos
.put(entity.ExifInfo.fromDto(exifInfo!.copyWith(assetId: id)));
} }
} }
static int compareById(Asset a, Asset b) => a.id.compareTo(b.id); static int compareById(Asset a, Asset b) => a.id.compareTo(b.id);
static int compareByLocalId(Asset a, Asset b) => compareToNullable(a.localId, b.localId); static int compareByLocalId(Asset a, Asset b) =>
compareToNullable(a.localId, b.localId);
static int compareByChecksum(Asset a, Asset b) => a.checksum.compareTo(b.checksum); static int compareByChecksum(Asset a, Asset b) =>
a.checksum.compareTo(b.checksum);
static int compareByOwnerChecksum(Asset a, Asset b) { static int compareByOwnerChecksum(Asset a, Asset b) {
final int ownerIdOrder = a.ownerId.compareTo(b.ownerId); final int ownerIdOrder = a.ownerId.compareTo(b.ownerId);
@@ -489,7 +510,10 @@ class Asset {
return compareByChecksum(a, b); return compareByChecksum(a, b);
} }
static int compareByOwnerChecksumCreatedModified(Asset a, Asset b) { static int compareByOwnerChecksumCreatedModified(
Asset a,
Asset b,
) {
final int ownerIdOrder = a.ownerId.compareTo(b.ownerId); final int ownerIdOrder = a.ownerId.compareTo(b.ownerId);
if (ownerIdOrder != 0) return ownerIdOrder; if (ownerIdOrder != 0) return ownerIdOrder;
final int checksumOrder = compareByChecksum(a, b); final int checksumOrder = compareByChecksum(a, b);
@@ -531,11 +555,11 @@ class Asset {
} }
static getVisibility(AssetVisibility visibility) => switch (visibility) { static getVisibility(AssetVisibility visibility) => switch (visibility) {
AssetVisibility.archive => AssetVisibilityEnum.archive, AssetVisibility.archive => AssetVisibilityEnum.archive,
AssetVisibility.hidden => AssetVisibilityEnum.hidden, AssetVisibility.hidden => AssetVisibilityEnum.hidden,
AssetVisibility.locked => AssetVisibilityEnum.locked, AssetVisibility.locked => AssetVisibilityEnum.locked,
AssetVisibility.timeline || _ => AssetVisibilityEnum.timeline, AssetVisibility.timeline || _ => AssetVisibilityEnum.timeline,
}; };
} }
enum AssetType { enum AssetType {
@@ -548,28 +572,41 @@ enum AssetType {
extension AssetTypeEnumHelper on AssetTypeEnum { extension AssetTypeEnumHelper on AssetTypeEnum {
AssetType toAssetType() => switch (this) { AssetType toAssetType() => switch (this) {
AssetTypeEnum.IMAGE => AssetType.image, AssetTypeEnum.IMAGE => AssetType.image,
AssetTypeEnum.VIDEO => AssetType.video, AssetTypeEnum.VIDEO => AssetType.video,
AssetTypeEnum.AUDIO => AssetType.audio, AssetTypeEnum.AUDIO => AssetType.audio,
AssetTypeEnum.OTHER => AssetType.other, AssetTypeEnum.OTHER => AssetType.other,
_ => throw Exception(), _ => throw Exception(),
}; };
} }
/// Describes where the information of this asset came from: /// Describes where the information of this asset came from:
/// only from the local device, only from the remote server or merged from both /// only from the local device, only from the remote server or merged from both
enum AssetState { local, remote, merged } enum AssetState {
local,
remote,
merged,
}
extension AssetsHelper on IsarCollection<Asset> { extension AssetsHelper on IsarCollection<Asset> {
Future<int> deleteAllByRemoteId(Iterable<String> ids) => ids.isEmpty ? Future.value(0) : remote(ids).deleteAll(); Future<int> deleteAllByRemoteId(Iterable<String> ids) =>
Future<int> deleteAllByLocalId(Iterable<String> ids) => ids.isEmpty ? Future.value(0) : local(ids).deleteAll(); ids.isEmpty ? Future.value(0) : remote(ids).deleteAll();
Future<List<Asset>> getAllByRemoteId(Iterable<String> ids) => ids.isEmpty ? Future.value([]) : remote(ids).findAll(); Future<int> deleteAllByLocalId(Iterable<String> ids) =>
Future<List<Asset>> getAllByLocalId(Iterable<String> ids) => ids.isEmpty ? Future.value([]) : local(ids).findAll(); ids.isEmpty ? Future.value(0) : local(ids).deleteAll();
Future<Asset?> getByRemoteId(String id) => where().remoteIdEqualTo(id).findFirst(); Future<List<Asset>> getAllByRemoteId(Iterable<String> ids) =>
ids.isEmpty ? Future.value([]) : remote(ids).findAll();
Future<List<Asset>> getAllByLocalId(Iterable<String> ids) =>
ids.isEmpty ? Future.value([]) : local(ids).findAll();
Future<Asset?> getByRemoteId(String id) =>
where().remoteIdEqualTo(id).findFirst();
QueryBuilder<Asset, Asset, QAfterWhereClause> remote(Iterable<String> ids) => QueryBuilder<Asset, Asset, QAfterWhereClause> remote(
Iterable<String> ids,
) =>
where().anyOf(ids, (q, String e) => q.remoteIdEqualTo(e)); where().anyOf(ids, (q, String e) => q.remoteIdEqualTo(e));
QueryBuilder<Asset, Asset, QAfterWhereClause> local(Iterable<String> ids) { QueryBuilder<Asset, Asset, QAfterWhereClause> local(
Iterable<String> ids,
) {
return where().anyOf(ids, (q, String e) => q.localIdEqualTo(e)); return where().anyOf(ids, (q, String e) => q.localIdEqualTo(e));
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -14,9 +14,21 @@ class BackupAlbum {
Id get isarId => fastHash(id); Id get isarId => fastHash(id);
BackupAlbum copyWith({String? id, DateTime? lastBackup, BackupSelection? selection}) { BackupAlbum copyWith({
return BackupAlbum(id ?? this.id, lastBackup ?? this.lastBackup, selection ?? this.selection); String? id,
DateTime? lastBackup,
BackupSelection? selection,
}) {
return BackupAlbum(
id ?? this.id,
lastBackup ?? this.lastBackup,
selection ?? this.selection,
);
} }
} }
enum BackupSelection { none, select, exclude } enum BackupSelection {
none,
select,
exclude;
}

View File

@@ -17,7 +17,11 @@ const BackupAlbumSchema = CollectionSchema(
name: r'BackupAlbum', name: r'BackupAlbum',
id: 8308487201128361847, id: 8308487201128361847,
properties: { properties: {
r'id': PropertySchema(id: 0, name: r'id', type: IsarType.string), r'id': PropertySchema(
id: 0,
name: r'id',
type: IsarType.string,
),
r'lastBackup': PropertySchema( r'lastBackup': PropertySchema(
id: 1, id: 1,
name: r'lastBackup', name: r'lastBackup',
@@ -28,9 +32,8 @@ const BackupAlbumSchema = CollectionSchema(
name: r'selection', name: r'selection',
type: IsarType.byte, type: IsarType.byte,
enumMap: _BackupAlbumselectionEnumValueMap, enumMap: _BackupAlbumselectionEnumValueMap,
), )
}, },
estimateSize: _backupAlbumEstimateSize, estimateSize: _backupAlbumEstimateSize,
serialize: _backupAlbumSerialize, serialize: _backupAlbumSerialize,
deserialize: _backupAlbumDeserialize, deserialize: _backupAlbumDeserialize,
@@ -39,7 +42,6 @@ const BackupAlbumSchema = CollectionSchema(
indexes: {}, indexes: {},
links: {}, links: {},
embeddedSchemas: {}, embeddedSchemas: {},
getId: _backupAlbumGetId, getId: _backupAlbumGetId,
getLinks: _backupAlbumGetLinks, getLinks: _backupAlbumGetLinks,
attach: _backupAlbumAttach, attach: _backupAlbumAttach,
@@ -94,11 +96,9 @@ P _backupAlbumDeserializeProp<P>(
case 1: case 1:
return (reader.readDateTime(offset)) as P; return (reader.readDateTime(offset)) as P;
case 2: case 2:
return (_BackupAlbumselectionValueEnumMap[reader.readByteOrNull( return (_BackupAlbumselectionValueEnumMap[
offset, reader.readByteOrNull(offset)] ??
)] ?? BackupSelection.none) as P;
BackupSelection.none)
as P;
default: default:
throw IsarError('Unknown property with id $propertyId'); throw IsarError('Unknown property with id $propertyId');
} }
@@ -124,10 +124,7 @@ List<IsarLinkBase<dynamic>> _backupAlbumGetLinks(BackupAlbum object) {
} }
void _backupAlbumAttach( void _backupAlbumAttach(
IsarCollection<dynamic> col, IsarCollection<dynamic> col, Id id, BackupAlbum object) {}
Id id,
BackupAlbum object,
) {}
extension BackupAlbumQueryWhereSort extension BackupAlbumQueryWhereSort
on QueryBuilder<BackupAlbum, BackupAlbum, QWhere> { on QueryBuilder<BackupAlbum, BackupAlbum, QWhere> {
@@ -141,18 +138,17 @@ extension BackupAlbumQueryWhereSort
extension BackupAlbumQueryWhere extension BackupAlbumQueryWhere
on QueryBuilder<BackupAlbum, BackupAlbum, QWhereClause> { on QueryBuilder<BackupAlbum, BackupAlbum, QWhereClause> {
QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdEqualTo( QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdEqualTo(
Id isarId, Id isarId) {
) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IdWhereClause.between(
IdWhereClause.between(lower: isarId, upper: isarId), lower: isarId,
); upper: isarId,
));
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdNotEqualTo( QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdNotEqualTo(
Id isarId, Id isarId) {
) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
if (query.whereSort == Sort.asc) { if (query.whereSort == Sort.asc) {
return query return query
@@ -175,9 +171,8 @@ extension BackupAlbumQueryWhere
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdGreaterThan( QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdGreaterThan(
Id isarId, { Id isarId,
bool include = false, {bool include = false}) {
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(
IdWhereClause.greaterThan(lower: isarId, includeLower: include), IdWhereClause.greaterThan(lower: isarId, includeLower: include),
@@ -186,9 +181,8 @@ extension BackupAlbumQueryWhere
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdLessThan( QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdLessThan(
Id isarId, { Id isarId,
bool include = false, {bool include = false}) {
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(
IdWhereClause.lessThan(upper: isarId, includeUpper: include), IdWhereClause.lessThan(upper: isarId, includeUpper: include),
@@ -203,14 +197,12 @@ extension BackupAlbumQueryWhere
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IdWhereClause.between(
IdWhereClause.between( lower: lowerIsarId,
lower: lowerIsarId, includeLower: includeLower,
includeLower: includeLower, upper: upperIsarId,
upper: upperIsarId, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
} }
@@ -222,13 +214,11 @@ extension BackupAlbumQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
@@ -238,14 +228,12 @@ extension BackupAlbumQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
@@ -255,14 +243,12 @@ extension BackupAlbumQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
@@ -274,16 +260,14 @@ extension BackupAlbumQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'id',
property: r'id', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
@@ -292,13 +276,11 @@ extension BackupAlbumQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.startsWith(
FilterCondition.startsWith( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
@@ -307,82 +289,77 @@ extension BackupAlbumQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.endsWith(
FilterCondition.endsWith( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idContains( QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idContains(
String value, { String value,
bool caseSensitive = true, {bool caseSensitive = true}) {
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.contains(
FilterCondition.contains( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idMatches( QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idMatches(
String pattern, { String pattern,
bool caseSensitive = true, {bool caseSensitive = true}) {
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.matches(
FilterCondition.matches( property: r'id',
property: r'id', wildcard: pattern,
wildcard: pattern, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idIsEmpty() { QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idIsEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'id', value: ''), property: r'id',
); value: '',
));
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idIsNotEmpty() { QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idIsNotEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan(property: r'id', value: ''), property: r'id',
); value: '',
));
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> isarIdEqualTo( QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> isarIdEqualTo(
Id value, Id value) {
) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'isarId', value: value), property: r'isarId',
); value: value,
));
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
isarIdGreaterThan(Id value, {bool include = false}) { isarIdGreaterThan(
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'isarId',
property: r'isarId', value: value,
value: value, ));
),
);
}); });
} }
@@ -391,13 +368,11 @@ extension BackupAlbumQueryFilter
bool include = false, bool include = false,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'isarId',
property: r'isarId', value: value,
value: value, ));
),
);
}); });
} }
@@ -408,125 +383,125 @@ extension BackupAlbumQueryFilter
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'isarId',
property: r'isarId', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
lastBackupEqualTo(DateTime value) { lastBackupEqualTo(DateTime value) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'lastBackup', value: value), property: r'lastBackup',
); value: value,
));
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
lastBackupGreaterThan(DateTime value, {bool include = false}) { lastBackupGreaterThan(
DateTime value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'lastBackup',
property: r'lastBackup', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
lastBackupLessThan(DateTime value, {bool include = false}) { lastBackupLessThan(
DateTime value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'lastBackup',
property: r'lastBackup', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
lastBackupBetween( lastBackupBetween(
DateTime lower, DateTime lower,
DateTime upper, { DateTime upper, {
bool includeLower = true, bool includeLower = true,
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'lastBackup',
property: r'lastBackup', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
selectionEqualTo(BackupSelection value) { selectionEqualTo(BackupSelection value) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'selection', value: value), property: r'selection',
); value: value,
));
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
selectionGreaterThan(BackupSelection value, {bool include = false}) { selectionGreaterThan(
BackupSelection value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'selection',
property: r'selection', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
selectionLessThan(BackupSelection value, {bool include = false}) { selectionLessThan(
BackupSelection value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'selection',
property: r'selection', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
selectionBetween( selectionBetween(
BackupSelection lower, BackupSelection lower,
BackupSelection upper, { BackupSelection upper, {
bool includeLower = true, bool includeLower = true,
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'selection',
property: r'selection', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
} }
@@ -629,9 +604,8 @@ extension BackupAlbumQuerySortThenBy
extension BackupAlbumQueryWhereDistinct extension BackupAlbumQueryWhereDistinct
on QueryBuilder<BackupAlbum, BackupAlbum, QDistinct> { on QueryBuilder<BackupAlbum, BackupAlbum, QDistinct> {
QueryBuilder<BackupAlbum, BackupAlbum, QDistinct> distinctById({ QueryBuilder<BackupAlbum, BackupAlbum, QDistinct> distinctById(
bool caseSensitive = true, {bool caseSensitive = true}) {
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'id', caseSensitive: caseSensitive); return query.addDistinctBy(r'id', caseSensitive: caseSensitive);
}); });
@@ -671,7 +645,7 @@ extension BackupAlbumQueryProperty
} }
QueryBuilder<BackupAlbum, BackupSelection, QQueryOperations> QueryBuilder<BackupAlbum, BackupSelection, QQueryOperations>
selectionProperty() { selectionProperty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'selection'); return query.addPropertyName(r'selection');
}); });

View File

@@ -17,9 +17,12 @@ const DuplicatedAssetSchema = CollectionSchema(
name: r'DuplicatedAsset', name: r'DuplicatedAsset',
id: -2679334728174694496, id: -2679334728174694496,
properties: { properties: {
r'id': PropertySchema(id: 0, name: r'id', type: IsarType.string), r'id': PropertySchema(
id: 0,
name: r'id',
type: IsarType.string,
)
}, },
estimateSize: _duplicatedAssetEstimateSize, estimateSize: _duplicatedAssetEstimateSize,
serialize: _duplicatedAssetSerialize, serialize: _duplicatedAssetSerialize,
deserialize: _duplicatedAssetDeserialize, deserialize: _duplicatedAssetDeserialize,
@@ -28,7 +31,6 @@ const DuplicatedAssetSchema = CollectionSchema(
indexes: {}, indexes: {},
links: {}, links: {},
embeddedSchemas: {}, embeddedSchemas: {},
getId: _duplicatedAssetGetId, getId: _duplicatedAssetGetId,
getLinks: _duplicatedAssetGetLinks, getLinks: _duplicatedAssetGetLinks,
attach: _duplicatedAssetAttach, attach: _duplicatedAssetAttach,
@@ -60,7 +62,9 @@ DuplicatedAsset _duplicatedAssetDeserialize(
List<int> offsets, List<int> offsets,
Map<Type, List<int>> allOffsets, Map<Type, List<int>> allOffsets,
) { ) {
final object = DuplicatedAsset(reader.readString(offsets[0])); final object = DuplicatedAsset(
reader.readString(offsets[0]),
);
return object; return object;
} }
@@ -87,10 +91,7 @@ List<IsarLinkBase<dynamic>> _duplicatedAssetGetLinks(DuplicatedAsset object) {
} }
void _duplicatedAssetAttach( void _duplicatedAssetAttach(
IsarCollection<dynamic> col, IsarCollection<dynamic> col, Id id, DuplicatedAsset object) {}
Id id,
DuplicatedAsset object,
) {}
extension DuplicatedAssetQueryWhereSort extension DuplicatedAssetQueryWhereSort
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QWhere> { on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QWhere> {
@@ -104,16 +105,17 @@ extension DuplicatedAssetQueryWhereSort
extension DuplicatedAssetQueryWhere extension DuplicatedAssetQueryWhere
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QWhereClause> { on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QWhereClause> {
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
isarIdEqualTo(Id isarId) { isarIdEqualTo(Id isarId) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IdWhereClause.between(
IdWhereClause.between(lower: isarId, upper: isarId), lower: isarId,
); upper: isarId,
));
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
isarIdNotEqualTo(Id isarId) { isarIdNotEqualTo(Id isarId) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
if (query.whereSort == Sort.asc) { if (query.whereSort == Sort.asc) {
return query return query
@@ -136,7 +138,7 @@ extension DuplicatedAssetQueryWhere
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
isarIdGreaterThan(Id isarId, {bool include = false}) { isarIdGreaterThan(Id isarId, {bool include = false}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(
IdWhereClause.greaterThan(lower: isarId, includeLower: include), IdWhereClause.greaterThan(lower: isarId, includeLower: include),
@@ -145,7 +147,7 @@ extension DuplicatedAssetQueryWhere
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
isarIdLessThan(Id isarId, {bool include = false}) { isarIdLessThan(Id isarId, {bool include = false}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(
IdWhereClause.lessThan(upper: isarId, includeUpper: include), IdWhereClause.lessThan(upper: isarId, includeUpper: include),
@@ -154,21 +156,19 @@ extension DuplicatedAssetQueryWhere
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
isarIdBetween( isarIdBetween(
Id lowerIsarId, Id lowerIsarId,
Id upperIsarId, { Id upperIsarId, {
bool includeLower = true, bool includeLower = true,
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IdWhereClause.between(
IdWhereClause.between( lower: lowerIsarId,
lower: lowerIsarId, includeLower: includeLower,
includeLower: includeLower, upper: upperIsarId,
upper: upperIsarId, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
} }
@@ -176,52 +176,53 @@ extension DuplicatedAssetQueryWhere
extension DuplicatedAssetQueryFilter extension DuplicatedAssetQueryFilter
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QFilterCondition> { on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QFilterCondition> {
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idEqualTo(String value, {bool caseSensitive = true}) { idEqualTo(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idGreaterThan( idGreaterThan(
String value, { String value, {
bool include = false, bool include = false,
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idLessThan(String value, {bool include = false, bool caseSensitive = true}) { idLessThan(
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idBetween( idBetween(
String lower, String lower,
String upper, { String upper, {
bool includeLower = true, bool includeLower = true,
@@ -229,141 +230,140 @@ extension DuplicatedAssetQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'id',
property: r'id', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idStartsWith(String value, {bool caseSensitive = true}) { idStartsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.startsWith(
FilterCondition.startsWith( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idEndsWith(String value, {bool caseSensitive = true}) { idEndsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.endsWith(
FilterCondition.endsWith( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idContains(String value, {bool caseSensitive = true}) { idContains(String value, {bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.contains(
FilterCondition.contains( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idMatches(String pattern, {bool caseSensitive = true}) { idMatches(String pattern, {bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.matches(
FilterCondition.matches( property: r'id',
property: r'id', wildcard: pattern,
wildcard: pattern, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idIsEmpty() { idIsEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'id', value: ''), property: r'id',
); value: '',
));
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idIsNotEmpty() { idIsNotEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan(property: r'id', value: ''), property: r'id',
); value: '',
));
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
isarIdEqualTo(Id value) { isarIdEqualTo(Id value) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'isarId', value: value), property: r'isarId',
); value: value,
));
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
isarIdGreaterThan(Id value, {bool include = false}) { isarIdGreaterThan(
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'isarId',
property: r'isarId', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
isarIdLessThan(Id value, {bool include = false}) { isarIdLessThan(
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'isarId',
property: r'isarId', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
isarIdBetween( isarIdBetween(
Id lower, Id lower,
Id upper, { Id upper, {
bool includeLower = true, bool includeLower = true,
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'isarId',
property: r'isarId', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
} }
@@ -410,7 +410,7 @@ extension DuplicatedAssetQuerySortThenBy
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterSortBy> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterSortBy>
thenByIsarIdDesc() { thenByIsarIdDesc() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'isarId', Sort.desc); return query.addSortBy(r'isarId', Sort.desc);
}); });
@@ -419,9 +419,8 @@ extension DuplicatedAssetQuerySortThenBy
extension DuplicatedAssetQueryWhereDistinct extension DuplicatedAssetQueryWhereDistinct
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QDistinct> { on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QDistinct> {
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QDistinct> distinctById({ QueryBuilder<DuplicatedAsset, DuplicatedAsset, QDistinct> distinctById(
bool caseSensitive = true, {bool caseSensitive = true}) {
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'id', caseSensitive: caseSensitive); return query.addDistinctBy(r'id', caseSensitive: caseSensitive);
}); });

View File

@@ -22,10 +22,17 @@ const ETagSchema = CollectionSchema(
name: r'assetCount', name: r'assetCount',
type: IsarType.long, type: IsarType.long,
), ),
r'id': PropertySchema(id: 1, name: r'id', type: IsarType.string), r'id': PropertySchema(
r'time': PropertySchema(id: 2, name: r'time', type: IsarType.dateTime), id: 1,
name: r'id',
type: IsarType.string,
),
r'time': PropertySchema(
id: 2,
name: r'time',
type: IsarType.dateTime,
)
}, },
estimateSize: _eTagEstimateSize, estimateSize: _eTagEstimateSize,
serialize: _eTagSerialize, serialize: _eTagSerialize,
deserialize: _eTagDeserialize, deserialize: _eTagDeserialize,
@@ -42,13 +49,12 @@ const ETagSchema = CollectionSchema(
name: r'id', name: r'id',
type: IndexType.hash, type: IndexType.hash,
caseSensitive: true, caseSensitive: true,
), )
], ],
), )
}, },
links: {}, links: {},
embeddedSchemas: {}, embeddedSchemas: {},
getId: _eTagGetId, getId: _eTagGetId,
getLinks: _eTagGetLinks, getLinks: _eTagGetLinks,
attach: _eTagAttach, attach: _eTagAttach,
@@ -183,9 +189,10 @@ extension ETagQueryWhereSort on QueryBuilder<ETag, ETag, QWhere> {
extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> { extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdEqualTo(Id isarId) { QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdEqualTo(Id isarId) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IdWhereClause.between(
IdWhereClause.between(lower: isarId, upper: isarId), lower: isarId,
); upper: isarId,
));
}); });
} }
@@ -211,10 +218,8 @@ extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
}); });
} }
QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdGreaterThan( QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdGreaterThan(Id isarId,
Id isarId, { {bool include = false}) {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(
IdWhereClause.greaterThan(lower: isarId, includeLower: include), IdWhereClause.greaterThan(lower: isarId, includeLower: include),
@@ -222,10 +227,8 @@ extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
}); });
} }
QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdLessThan( QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdLessThan(Id isarId,
Id isarId, { {bool include = false}) {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(
IdWhereClause.lessThan(upper: isarId, includeUpper: include), IdWhereClause.lessThan(upper: isarId, includeUpper: include),
@@ -240,22 +243,21 @@ extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IdWhereClause.between(
IdWhereClause.between( lower: lowerIsarId,
lower: lowerIsarId, includeLower: includeLower,
includeLower: includeLower, upper: upperIsarId,
upper: upperIsarId, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
QueryBuilder<ETag, ETag, QAfterWhereClause> idEqualTo(String id) { QueryBuilder<ETag, ETag, QAfterWhereClause> idEqualTo(String id) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IndexWhereClause.equalTo(
IndexWhereClause.equalTo(indexName: r'id', value: [id]), indexName: r'id',
); value: [id],
));
}); });
} }
@@ -263,40 +265,32 @@ extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
if (query.whereSort == Sort.asc) { if (query.whereSort == Sort.asc) {
return query return query
.addWhereClause( .addWhereClause(IndexWhereClause.between(
IndexWhereClause.between( indexName: r'id',
indexName: r'id', lower: [],
lower: [], upper: [id],
upper: [id], includeUpper: false,
includeUpper: false, ))
), .addWhereClause(IndexWhereClause.between(
) indexName: r'id',
.addWhereClause( lower: [id],
IndexWhereClause.between( includeLower: false,
indexName: r'id', upper: [],
lower: [id], ));
includeLower: false,
upper: [],
),
);
} else { } else {
return query return query
.addWhereClause( .addWhereClause(IndexWhereClause.between(
IndexWhereClause.between( indexName: r'id',
indexName: r'id', lower: [id],
lower: [id], includeLower: false,
includeLower: false, upper: [],
upper: [], ))
), .addWhereClause(IndexWhereClause.between(
) indexName: r'id',
.addWhereClause( lower: [],
IndexWhereClause.between( upper: [id],
indexName: r'id', includeUpper: false,
lower: [], ));
upper: [id],
includeUpper: false,
),
);
} }
}); });
} }
@@ -305,27 +299,27 @@ extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> { extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
QueryBuilder<ETag, ETag, QAfterFilterCondition> assetCountIsNull() { QueryBuilder<ETag, ETag, QAfterFilterCondition> assetCountIsNull() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(const FilterCondition.isNull(
const FilterCondition.isNull(property: r'assetCount'), property: r'assetCount',
); ));
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> assetCountIsNotNull() { QueryBuilder<ETag, ETag, QAfterFilterCondition> assetCountIsNotNull() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(const FilterCondition.isNotNull(
const FilterCondition.isNotNull(property: r'assetCount'), property: r'assetCount',
); ));
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> assetCountEqualTo( QueryBuilder<ETag, ETag, QAfterFilterCondition> assetCountEqualTo(
int? value, int? value) {
) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'assetCount', value: value), property: r'assetCount',
); value: value,
));
}); });
} }
@@ -334,13 +328,11 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool include = false, bool include = false,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'assetCount',
property: r'assetCount', value: value,
value: value, ));
),
);
}); });
} }
@@ -349,13 +341,11 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool include = false, bool include = false,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'assetCount',
property: r'assetCount', value: value,
value: value, ));
),
);
}); });
} }
@@ -366,15 +356,13 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'assetCount',
property: r'assetCount', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
@@ -383,13 +371,11 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
@@ -399,14 +385,12 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
@@ -416,14 +400,12 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
@@ -435,16 +417,14 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'id',
property: r'id', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
@@ -453,13 +433,11 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.startsWith(
FilterCondition.startsWith( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
@@ -468,67 +446,60 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.endsWith(
FilterCondition.endsWith( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> idContains( QueryBuilder<ETag, ETag, QAfterFilterCondition> idContains(String value,
String value, { {bool caseSensitive = true}) {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.contains(
FilterCondition.contains( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> idMatches( QueryBuilder<ETag, ETag, QAfterFilterCondition> idMatches(String pattern,
String pattern, { {bool caseSensitive = true}) {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.matches(
FilterCondition.matches( property: r'id',
property: r'id', wildcard: pattern,
wildcard: pattern, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> idIsEmpty() { QueryBuilder<ETag, ETag, QAfterFilterCondition> idIsEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'id', value: ''), property: r'id',
); value: '',
));
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> idIsNotEmpty() { QueryBuilder<ETag, ETag, QAfterFilterCondition> idIsNotEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan(property: r'id', value: ''), property: r'id',
); value: '',
));
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> isarIdEqualTo(Id value) { QueryBuilder<ETag, ETag, QAfterFilterCondition> isarIdEqualTo(Id value) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'isarId', value: value), property: r'isarId',
); value: value,
));
}); });
} }
@@ -537,13 +508,11 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool include = false, bool include = false,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'isarId',
property: r'isarId', value: value,
value: value, ));
),
);
}); });
} }
@@ -552,13 +521,11 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool include = false, bool include = false,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'isarId',
property: r'isarId', value: value,
value: value, ));
),
);
}); });
} }
@@ -569,39 +536,38 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'isarId',
property: r'isarId', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> timeIsNull() { QueryBuilder<ETag, ETag, QAfterFilterCondition> timeIsNull() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(const FilterCondition.isNull(
const FilterCondition.isNull(property: r'time'), property: r'time',
); ));
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> timeIsNotNull() { QueryBuilder<ETag, ETag, QAfterFilterCondition> timeIsNotNull() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(const FilterCondition.isNotNull(
const FilterCondition.isNotNull(property: r'time'), property: r'time',
); ));
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> timeEqualTo(DateTime? value) { QueryBuilder<ETag, ETag, QAfterFilterCondition> timeEqualTo(DateTime? value) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'time', value: value), property: r'time',
); value: value,
));
}); });
} }
@@ -610,13 +576,11 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool include = false, bool include = false,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'time',
property: r'time', value: value,
value: value, ));
),
);
}); });
} }
@@ -625,13 +589,11 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool include = false, bool include = false,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'time',
property: r'time', value: value,
value: value, ));
),
);
}); });
} }
@@ -642,15 +604,13 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'time',
property: r'time', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
} }
@@ -754,9 +714,8 @@ extension ETagQueryWhereDistinct on QueryBuilder<ETag, ETag, QDistinct> {
}); });
} }
QueryBuilder<ETag, ETag, QDistinct> distinctById({ QueryBuilder<ETag, ETag, QDistinct> distinctById(
bool caseSensitive = true, {bool caseSensitive = true}) {
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'id', caseSensitive: caseSensitive); return query.addDistinctBy(r'id', caseSensitive: caseSensitive);
}); });

View File

@@ -17,10 +17,17 @@ const IOSDeviceAssetSchema = CollectionSchema(
name: r'IOSDeviceAsset', name: r'IOSDeviceAsset',
id: -1671546753821948030, id: -1671546753821948030,
properties: { properties: {
r'hash': PropertySchema(id: 0, name: r'hash', type: IsarType.byteList), r'hash': PropertySchema(
r'id': PropertySchema(id: 1, name: r'id', type: IsarType.string), id: 0,
name: r'hash',
type: IsarType.byteList,
),
r'id': PropertySchema(
id: 1,
name: r'id',
type: IsarType.string,
)
}, },
estimateSize: _iOSDeviceAssetEstimateSize, estimateSize: _iOSDeviceAssetEstimateSize,
serialize: _iOSDeviceAssetSerialize, serialize: _iOSDeviceAssetSerialize,
deserialize: _iOSDeviceAssetDeserialize, deserialize: _iOSDeviceAssetDeserialize,
@@ -37,7 +44,7 @@ const IOSDeviceAssetSchema = CollectionSchema(
name: r'id', name: r'id',
type: IndexType.hash, type: IndexType.hash,
caseSensitive: true, caseSensitive: true,
), )
], ],
), ),
r'hash': IndexSchema( r'hash': IndexSchema(
@@ -50,13 +57,12 @@ const IOSDeviceAssetSchema = CollectionSchema(
name: r'hash', name: r'hash',
type: IndexType.hash, type: IndexType.hash,
caseSensitive: false, caseSensitive: false,
), )
], ],
), )
}, },
links: {}, links: {},
embeddedSchemas: {}, embeddedSchemas: {},
getId: _iOSDeviceAssetGetId, getId: _iOSDeviceAssetGetId,
getLinks: _iOSDeviceAssetGetLinks, getLinks: _iOSDeviceAssetGetLinks,
attach: _iOSDeviceAssetAttach, attach: _iOSDeviceAssetAttach,
@@ -122,10 +128,7 @@ List<IsarLinkBase<dynamic>> _iOSDeviceAssetGetLinks(IOSDeviceAsset object) {
} }
void _iOSDeviceAssetAttach( void _iOSDeviceAssetAttach(
IsarCollection<dynamic> col, IsarCollection<dynamic> col, Id id, IOSDeviceAsset object) {}
Id id,
IOSDeviceAsset object,
) {}
extension IOSDeviceAssetByIndex on IsarCollection<IOSDeviceAsset> { extension IOSDeviceAssetByIndex on IsarCollection<IOSDeviceAsset> {
Future<IOSDeviceAsset?> getById(String id) { Future<IOSDeviceAsset?> getById(String id) {
@@ -176,10 +179,8 @@ extension IOSDeviceAssetByIndex on IsarCollection<IOSDeviceAsset> {
return putAllByIndex(r'id', objects); return putAllByIndex(r'id', objects);
} }
List<Id> putAllByIdSync( List<Id> putAllByIdSync(List<IOSDeviceAsset> objects,
List<IOSDeviceAsset> objects, { {bool saveLinks = true}) {
bool saveLinks = true,
}) {
return putAllByIndexSync(r'id', objects, saveLinks: saveLinks); return putAllByIndexSync(r'id', objects, saveLinks: saveLinks);
} }
} }
@@ -196,17 +197,17 @@ extension IOSDeviceAssetQueryWhereSort
extension IOSDeviceAssetQueryWhere extension IOSDeviceAssetQueryWhere
on QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QWhereClause> { on QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QWhereClause> {
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> isarIdEqualTo( QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> isarIdEqualTo(
Id isarId, Id isarId) {
) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IdWhereClause.between(
IdWhereClause.between(lower: isarId, upper: isarId), lower: isarId,
); upper: isarId,
));
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause>
isarIdNotEqualTo(Id isarId) { isarIdNotEqualTo(Id isarId) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
if (query.whereSort == Sort.asc) { if (query.whereSort == Sort.asc) {
return query return query
@@ -229,7 +230,7 @@ extension IOSDeviceAssetQueryWhere
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause>
isarIdGreaterThan(Id isarId, {bool include = false}) { isarIdGreaterThan(Id isarId, {bool include = false}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(
IdWhereClause.greaterThan(lower: isarId, includeLower: include), IdWhereClause.greaterThan(lower: isarId, includeLower: include),
@@ -238,7 +239,7 @@ extension IOSDeviceAssetQueryWhere
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause>
isarIdLessThan(Id isarId, {bool include = false}) { isarIdLessThan(Id isarId, {bool include = false}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(
IdWhereClause.lessThan(upper: isarId, includeUpper: include), IdWhereClause.lessThan(upper: isarId, includeUpper: include),
@@ -253,120 +254,101 @@ extension IOSDeviceAssetQueryWhere
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IdWhereClause.between(
IdWhereClause.between( lower: lowerIsarId,
lower: lowerIsarId, includeLower: includeLower,
includeLower: includeLower, upper: upperIsarId,
upper: upperIsarId, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> idEqualTo( QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> idEqualTo(
String id, String id) {
) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IndexWhereClause.equalTo(
IndexWhereClause.equalTo(indexName: r'id', value: [id]), indexName: r'id',
); value: [id],
));
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> idNotEqualTo( QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> idNotEqualTo(
String id, String id) {
) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
if (query.whereSort == Sort.asc) { if (query.whereSort == Sort.asc) {
return query return query
.addWhereClause( .addWhereClause(IndexWhereClause.between(
IndexWhereClause.between( indexName: r'id',
indexName: r'id', lower: [],
lower: [], upper: [id],
upper: [id], includeUpper: false,
includeUpper: false, ))
), .addWhereClause(IndexWhereClause.between(
) indexName: r'id',
.addWhereClause( lower: [id],
IndexWhereClause.between( includeLower: false,
indexName: r'id', upper: [],
lower: [id], ));
includeLower: false,
upper: [],
),
);
} else { } else {
return query return query
.addWhereClause( .addWhereClause(IndexWhereClause.between(
IndexWhereClause.between( indexName: r'id',
indexName: r'id', lower: [id],
lower: [id], includeLower: false,
includeLower: false, upper: [],
upper: [], ))
), .addWhereClause(IndexWhereClause.between(
) indexName: r'id',
.addWhereClause( lower: [],
IndexWhereClause.between( upper: [id],
indexName: r'id', includeUpper: false,
lower: [], ));
upper: [id],
includeUpper: false,
),
);
} }
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> hashEqualTo( QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> hashEqualTo(
List<int> hash, List<int> hash) {
) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IndexWhereClause.equalTo(
IndexWhereClause.equalTo(indexName: r'hash', value: [hash]), indexName: r'hash',
); value: [hash],
));
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause>
hashNotEqualTo(List<int> hash) { hashNotEqualTo(List<int> hash) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
if (query.whereSort == Sort.asc) { if (query.whereSort == Sort.asc) {
return query return query
.addWhereClause( .addWhereClause(IndexWhereClause.between(
IndexWhereClause.between( indexName: r'hash',
indexName: r'hash', lower: [],
lower: [], upper: [hash],
upper: [hash], includeUpper: false,
includeUpper: false, ))
), .addWhereClause(IndexWhereClause.between(
) indexName: r'hash',
.addWhereClause( lower: [hash],
IndexWhereClause.between( includeLower: false,
indexName: r'hash', upper: [],
lower: [hash], ));
includeLower: false,
upper: [],
),
);
} else { } else {
return query return query
.addWhereClause( .addWhereClause(IndexWhereClause.between(
IndexWhereClause.between( indexName: r'hash',
indexName: r'hash', lower: [hash],
lower: [hash], includeLower: false,
includeLower: false, upper: [],
upper: [], ))
), .addWhereClause(IndexWhereClause.between(
) indexName: r'hash',
.addWhereClause( lower: [],
IndexWhereClause.between( upper: [hash],
indexName: r'hash', includeUpper: false,
lower: [], ));
upper: [hash],
includeUpper: false,
),
);
} }
}); });
} }
@@ -375,97 +357,134 @@ extension IOSDeviceAssetQueryWhere
extension IOSDeviceAssetQueryFilter extension IOSDeviceAssetQueryFilter
on QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QFilterCondition> { on QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QFilterCondition> {
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashElementEqualTo(int value) { hashElementEqualTo(int value) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'hash', value: value), property: r'hash',
); value: value,
));
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashElementGreaterThan(int value, {bool include = false}) { hashElementGreaterThan(
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'hash',
property: r'hash', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashElementLessThan(int value, {bool include = false}) { hashElementLessThan(
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'hash',
property: r'hash', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashElementBetween( hashElementBetween(
int lower, int lower,
int upper, { int upper, {
bool includeLower = true, bool includeLower = true,
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'hash',
property: r'hash', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, ));
), });
}
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashLengthEqualTo(int length) {
return QueryBuilder.apply(this, (query) {
return query.listLength(
r'hash',
length,
true,
length,
true,
); );
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashLengthEqualTo(int length) { hashIsEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength(r'hash', length, true, length, true); return query.listLength(
r'hash',
0,
true,
0,
true,
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashIsEmpty() { hashIsNotEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength(r'hash', 0, true, 0, true); return query.listLength(
r'hash',
0,
false,
999999,
true,
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashIsNotEmpty() { hashLengthLessThan(
int length, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength(r'hash', 0, false, 999999, true); return query.listLength(
r'hash',
0,
true,
length,
include,
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashLengthLessThan(int length, {bool include = false}) { hashLengthGreaterThan(
int length, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength(r'hash', 0, true, length, include); return query.listLength(
r'hash',
length,
include,
999999,
true,
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashLengthGreaterThan(int length, {bool include = false}) { hashLengthBetween(
return QueryBuilder.apply(this, (query) {
return query.listLength(r'hash', length, include, 999999, true);
});
}
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashLengthBetween(
int lower, int lower,
int upper, { int upper, {
bool includeLower = true, bool includeLower = true,
@@ -487,45 +506,43 @@ extension IOSDeviceAssetQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
idGreaterThan( idGreaterThan(
String value, { String value, {
bool include = false, bool include = false,
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan( include: include,
include: include, property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
idLessThan(String value, {bool include = false, bool caseSensitive = true}) { idLessThan(
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
@@ -537,143 +554,141 @@ extension IOSDeviceAssetQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'id',
property: r'id', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
idStartsWith(String value, {bool caseSensitive = true}) { idStartsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.startsWith(
FilterCondition.startsWith( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
idEndsWith(String value, {bool caseSensitive = true}) { idEndsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.endsWith(
FilterCondition.endsWith( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
idContains(String value, {bool caseSensitive = true}) { idContains(String value, {bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.contains(
FilterCondition.contains( property: r'id',
property: r'id', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> idMatches( QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> idMatches(
String pattern, { String pattern,
bool caseSensitive = true, {bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.matches(
property: r'id',
wildcard: pattern,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
idIsEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'id',
value: '',
));
});
}
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
idIsNotEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
property: r'id',
value: '',
));
});
}
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
isarIdEqualTo(Id value) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'isarId',
value: value,
));
});
}
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
isarIdGreaterThan(
Id value, {
bool include = false,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.matches( include: include,
property: r'id', property: r'isarId',
wildcard: pattern, value: value,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
idIsEmpty() { isarIdLessThan(
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.lessThan(
FilterCondition.equalTo(property: r'id', value: ''), include: include,
); property: r'isarId',
value: value,
));
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
idIsNotEmpty() { isarIdBetween(
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
FilterCondition.greaterThan(property: r'id', value: ''),
);
});
}
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
isarIdEqualTo(Id value) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
FilterCondition.equalTo(property: r'isarId', value: value),
);
});
}
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
isarIdGreaterThan(Id value, {bool include = false}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
FilterCondition.greaterThan(
include: include,
property: r'isarId',
value: value,
),
);
});
}
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
isarIdLessThan(Id value, {bool include = false}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
FilterCondition.lessThan(
include: include,
property: r'isarId',
value: value,
),
);
});
}
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
isarIdBetween(
Id lower, Id lower,
Id upper, { Id upper, {
bool includeLower = true, bool includeLower = true,
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.between(
FilterCondition.between( property: r'isarId',
property: r'isarId', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
} }
@@ -720,7 +735,7 @@ extension IOSDeviceAssetQuerySortThenBy
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterSortBy> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterSortBy>
thenByIsarIdDesc() { thenByIsarIdDesc() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'isarId', Sort.desc); return query.addSortBy(r'isarId', Sort.desc);
}); });
@@ -735,9 +750,8 @@ extension IOSDeviceAssetQueryWhereDistinct
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QDistinct> distinctById({ QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QDistinct> distinctById(
bool caseSensitive = true, {bool caseSensitive = true}) {
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'id', caseSensitive: caseSensitive); return query.addDistinctBy(r'id', caseSensitive: caseSensitive);
}); });

View File

@@ -13,11 +13,11 @@ class SSLClientCertStoreVal {
const SSLClientCertStoreVal(this.data, this.password); const SSLClientCertStoreVal(this.data, this.password);
Future<void> save() async { void save() {
final b64Str = base64Encode(data); final b64Str = base64Encode(data);
await Store.put(StoreKey.sslClientCertData, b64Str); Store.put(StoreKey.sslClientCertData, b64Str);
if (password != null) { if (password != null) {
await Store.put(StoreKey.sslClientPasswd, password!); Store.put(StoreKey.sslClientPasswd, password!);
} }
} }
@@ -31,8 +31,8 @@ class SSLClientCertStoreVal {
return SSLClientCertStoreVal(certData, passwd); return SSLClientCertStoreVal(certData, passwd);
} }
static Future<void> delete() async { static void delete() {
await Store.delete(StoreKey.sslClientCertData); Store.delete(StoreKey.sslClientCertData);
await Store.delete(StoreKey.sslClientPasswd); Store.delete(StoreKey.sslClientPasswd);
} }
} }

View File

@@ -15,10 +15,16 @@ extension TZExtension on Asset {
final location = getLocation(exifInfo!.timeZone!); final location = getLocation(exifInfo!.timeZone!);
dt = TZDateTime.from(dt, location); dt = TZDateTime.from(dt, location);
} on LocationNotFoundException { } on LocationNotFoundException {
RegExp re = RegExp(r'^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$', caseSensitive: false); RegExp re = RegExp(
r'^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$',
caseSensitive: false,
);
final m = re.firstMatch(exifInfo!.timeZone!); final m = re.firstMatch(exifInfo!.timeZone!);
if (m != null) { if (m != null) {
final duration = Duration(hours: int.parse(m.group(1) ?? '0'), minutes: int.parse(m.group(2) ?? '0')); final duration = Duration(
hours: int.parse(m.group(1) ?? '0'),
minutes: int.parse(m.group(2) ?? '0'),
);
dt = dt.add(duration); dt = dt.add(duration);
return (dt, duration); return (dt, duration);
} }

View File

@@ -22,13 +22,15 @@ extension LogOnError<T> on AsyncValue<T> {
} }
if (!skip) { if (!skip) {
return onLoading?.call() ?? const Center(child: ImmichLoadingIndicator()); return onLoading?.call() ??
const Center(child: ImmichLoadingIndicator());
} }
} }
if (hasError && !hasValue) { if (hasError && !hasValue) {
_asyncErrorLogger.severe('Could not load value', error, stackTrace); _asyncErrorLogger.severe('Could not load value', error, stackTrace);
return onError?.call(error, stackTrace) ?? ScaffoldErrorBody(errorMsg: error?.toString()); return onError?.call(error, stackTrace) ??
ScaffoldErrorBody(errorMsg: error?.toString());
} }
return onData(requireValue); return onData(requireValue);

View File

@@ -60,5 +60,6 @@ extension ContextHelper on BuildContext {
FocusScopeNode get focusScope => FocusScope.of(this); FocusScopeNode get focusScope => FocusScope.of(this);
// Show SnackBars from the current context // Show SnackBars from the current context
void showSnackBar(SnackBar snackBar) => ScaffoldMessenger.of(this).showSnackBar(snackBar); void showSnackBar(SnackBar snackBar) =>
ScaffoldMessenger.of(this).showSnackBar(snackBar);
} }

Some files were not shown because too many files have changed in this diff Show More