Compare commits

..

1 Commits

Author SHA1 Message Date
wuzihao051119
4677ceb03c drift(mobile): drift auth user sync 2025-07-25 12:28:02 +08:00
1083 changed files with 47902 additions and 43680 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

@@ -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,8 @@ jobs:
run: dart analyze --fatal-infos run: dart analyze --fatal-infos
- name: Run dart format - name: Run dart format
run: make format # Ignore generated files manually until https://github.com/dart-lang/dart_style/issues/864 is resolved
run: dart format --set-exit-if-changed $(find lib -name '*.dart' -not \( -name 'generated_plugin_registrant.dart' -o -name '*.g.dart' -o -name '*.drift.dart' \))
- name: Run dart custom_lint - name: Run dart custom_lint
run: dart run custom_lint run: dart run custom_lint
@@ -129,7 +130,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

4
.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,7 +16,7 @@
"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"
} }
] ]

148
cli/package-lock.json generated
View File

@@ -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",
@@ -61,7 +61,7 @@
"@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

@@ -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

@@ -34,7 +34,7 @@ These environment variables are used by the `docker-compose.yml` file and do **N
| `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` | 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 | |
@@ -199,11 +199,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 +226,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

@@ -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

181
e2e/package-lock.json generated
View File

@@ -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",
@@ -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",
@@ -102,7 +102,7 @@
"@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

@@ -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}",
@@ -519,7 +511,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 +724,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 +743,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 +761,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,7 +816,6 @@
"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_description": "Edit description", "edit_description": "Edit description",
@@ -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,5 +1,5 @@
{ {
"dart.flutterSdkPath": ".fvm/versions/3.32.8", "dart.flutterSdkPath": ".fvm/versions/3.32.6",
"dart.lineLength": 120, "dart.lineLength": 120,
"[dart]": { "[dart]": {
"editor.rulers": [120], "editor.rulers": [120],

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)

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

@@ -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

@@ -51,4 +51,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;

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 {

View File

@@ -5,7 +5,11 @@ 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) {
@@ -24,7 +28,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

@@ -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;

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,18 +13,28 @@ 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());

View File

@@ -91,7 +91,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 +103,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 +116,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 +128,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 +159,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

@@ -1,6 +1,9 @@
import 'package:immich_mobile/domain/models/store.model.dart'; import 'package:immich_mobile/domain/models/store.model.dart';
import 'package:immich_mobile/domain/models/user.model.dart';
enum Setting<T> { enum Setting<T> {
// TODO: Remove UserDto after new store in drift
currentUser<UserDto?>(StoreKey.currentUser, null),
tilesPerRow<int>(StoreKey.tilesPerRow, 4), tilesPerRow<int>(StoreKey.tilesPerRow, 4),
groupAssetsBy<int>(StoreKey.groupAssetsBy, 0), groupAssetsBy<int>(StoreKey.groupAssetsBy, 0),
showStorageIndicator<bool>(StoreKey.storageIndicator, true), showStorageIndicator<bool>(StoreKey.storageIndicator, true),
@@ -8,7 +11,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,
@@ -57,7 +63,11 @@ 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) {

View File

@@ -1,8 +1,18 @@
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,
auto,
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 +45,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

@@ -1,9 +1,6 @@
// ignore_for_file: public_member_api_docs, sort_constructors_first
import 'dart:convert';
import 'package:immich_mobile/domain/models/user_metadata.model.dart'; import 'package:immich_mobile/domain/models/user_metadata.model.dart';
// TODO: Rename to User once Isar is removed // TODO: Remove UserDto once Isar is removed
class UserDto { class UserDto {
final String id; final String id;
final String email; final String email;
@@ -44,19 +41,19 @@ class UserDto {
@override @override
String toString() { String toString() {
return '''User: { return '''User: {
id: $id, id: $id,
email: $email, email: $email,
name: $name, name: $name,
isAdmin: $isAdmin, isAdmin: $isAdmin,
updatedAt: $updatedAt, updatedAt: $updatedAt,
profileImagePath: ${profileImagePath ?? '<NA>'}, profileImagePath: ${profileImagePath ?? '<NA>'},
avatarColor: $avatarColor, avatarColor: $avatarColor,
memoryEnabled: $memoryEnabled, memoryEnabled: $memoryEnabled,
inTimeline: $inTimeline, inTimeline: $inTimeline,
isPartnerSharedBy: $isPartnerSharedBy, isPartnerSharedBy: $isPartnerSharedBy,
isPartnerSharedWith: $isPartnerSharedWith, isPartnerSharedWith: $isPartnerSharedWith,
quotaUsageInBytes: $quotaUsageInBytes, quotaUsageInBytes: $quotaUsageInBytes,
quotaSizeInBytes: $quotaSizeInBytes, quotaSizeInBytes: $quotaSizeInBytes,
}'''; }''';
} }
@@ -74,21 +71,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) {
@@ -126,74 +124,229 @@ quotaSizeInBytes: $quotaSizeInBytes,
quotaSizeInBytes.hashCode; quotaSizeInBytes.hashCode;
} }
class PartnerUserDto { class User {
final String id;
final String name;
final String email;
final DateTime? deletedAt;
final AvatarColor? avatarColor;
const User({
required this.id,
required this.name,
required this.email,
this.deletedAt,
this.avatarColor,
});
User copyWith({
String? id,
String? name,
String? email,
DateTime? deletedAt,
AvatarColor? avatarColor,
}) {
return User(
id: id ?? this.id,
name: name ?? this.name,
email: email ?? this.email,
deletedAt: deletedAt ?? this.deletedAt,
avatarColor: avatarColor ?? this.avatarColor,
);
}
@override
String toString() {
return '''User {
id: $id,
name: $name,
email: $email,
deletedAt: ${deletedAt ?? "<NA>"},
avatarColor: ${avatarColor ?? "<NA>"},
}''';
}
@override
bool operator ==(covariant User other) {
if (identical(this, other)) return true;
return other.id == id &&
other.name == name &&
other.email == email &&
other.deletedAt == deletedAt &&
other.avatarColor == avatarColor;
}
@override
int get hashCode {
return id.hashCode ^ name.hashCode ^ email.hashCode ^ deletedAt.hashCode ^ avatarColor.hashCode;
}
}
class AuthUser {
final String id;
final String name;
final String email;
final DateTime? deletedAt;
final AvatarColor? avatarColor;
final bool isAdmin;
final String oauthId;
final String? pinCode;
final bool hasProfileImage;
final DateTime profileChangedAt;
final int? quotaSizeInBytes;
final int quotaUsageInBytes;
final String? storageLabel;
const AuthUser({
required this.id,
required this.name,
required this.email,
this.deletedAt,
this.avatarColor,
required this.isAdmin,
required this.oauthId,
this.pinCode,
required this.hasProfileImage,
required this.profileChangedAt,
this.quotaSizeInBytes,
required this.quotaUsageInBytes,
this.storageLabel,
});
AuthUser copyWith({
String? id,
String? name,
String? email,
DateTime? deletedAt,
AvatarColor? avatarColor,
bool? isAdmin,
String? oauthId,
String? pinCode,
bool? hasProfileImage,
DateTime? profileChangedAt,
int? quotaSizeInBytes,
int? quotaUsageInBytes,
String? storageLabel,
}) {
return AuthUser(
id: id ?? this.id,
name: name ?? this.name,
email: email ?? this.email,
deletedAt: deletedAt ?? this.deletedAt,
avatarColor: avatarColor ?? this.avatarColor,
isAdmin: isAdmin ?? this.isAdmin,
oauthId: oauthId ?? this.oauthId,
pinCode: pinCode ?? this.pinCode,
hasProfileImage: hasProfileImage ?? this.hasProfileImage,
profileChangedAt: profileChangedAt ?? this.profileChangedAt,
quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes,
quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
storageLabel: storageLabel ?? this.storageLabel,
);
}
@override
String toString() {
return '''AuthUser {
id: $id,
name: $name,
email: $email,
deletedAt: ${deletedAt ?? "<NA>"},
avatarColor: ${avatarColor ?? "<NA>"},
isAdmin: $isAdmin,
oauthId: $oauthId,
pinCode: ${pinCode ?? "<NA>"},
hasProfileImage: $hasProfileImage,
profileChangedAt: $profileChangedAt,
quotaSizeInBytes: ${quotaSizeInBytes ?? "<NA>"},
quotaUsageInBytes: $quotaUsageInBytes,
storageLabel: ${storageLabel ?? "<NA>"},
}''';
}
@override
bool operator ==(covariant AuthUser other) {
if (identical(this, other)) return true;
return other.id == id &&
other.name == name &&
other.email == email &&
other.deletedAt == deletedAt &&
other.avatarColor == avatarColor &&
other.isAdmin == isAdmin &&
other.oauthId == oauthId &&
other.pinCode == pinCode &&
other.hasProfileImage == hasProfileImage &&
other.profileChangedAt == profileChangedAt &&
other.quotaSizeInBytes == quotaSizeInBytes &&
other.quotaUsageInBytes == quotaUsageInBytes &&
other.storageLabel == storageLabel;
}
@override
int get hashCode {
return id.hashCode ^
name.hashCode ^
email.hashCode ^
deletedAt.hashCode ^
avatarColor.hashCode ^
isAdmin.hashCode ^
oauthId.hashCode ^
pinCode.hashCode ^
hasProfileImage.hashCode ^
profileChangedAt.hashCode ^
quotaSizeInBytes.hashCode ^
quotaUsageInBytes.hashCode ^
storageLabel.hashCode;
}
}
class PartnerUser {
final String id; final String id;
final String email; final String email;
final String name; final String name;
final bool inTimeline; final bool inTimeline;
final String? profileImagePath; const PartnerUser({
const PartnerUserDto({
required this.id, required this.id,
required this.email, required this.email,
required this.name, required this.name,
required this.inTimeline, required this.inTimeline,
this.profileImagePath,
}); });
PartnerUserDto copyWith({String? id, String? email, String? name, bool? inTimeline, String? profileImagePath}) { PartnerUser copyWith({
return PartnerUserDto( String? id,
String? email,
String? name,
bool? inTimeline,
}) {
return PartnerUser(
id: id ?? this.id, id: id ?? this.id,
email: email ?? this.email, email: email ?? this.email,
name: name ?? this.name, name: name ?? this.name,
inTimeline: inTimeline ?? this.inTimeline, inTimeline: inTimeline ?? this.inTimeline,
profileImagePath: profileImagePath ?? this.profileImagePath,
); );
} }
Map<String, dynamic> toMap() {
return <String, dynamic>{
'id': id,
'email': email,
'name': name,
'inTimeline': inTimeline,
'profileImagePath': profileImagePath,
};
}
factory PartnerUserDto.fromMap(Map<String, dynamic> map) {
return PartnerUserDto(
id: map['id'] as String,
email: map['email'] as String,
name: map['name'] as String,
inTimeline: map['inTimeline'] as bool,
profileImagePath: map['profileImagePath'] != null ? map['profileImagePath'] as String : null,
);
}
String toJson() => json.encode(toMap());
factory PartnerUserDto.fromJson(String source) => PartnerUserDto.fromMap(json.decode(source) as Map<String, dynamic>);
@override @override
String toString() { String toString() {
return 'PartnerUserDto(id: $id, email: $email, name: $name, inTimeline: $inTimeline, profileImagePath: $profileImagePath)'; return '''PartnerUser {
id: $id,
email: $email,
name: $name,
inTimeline: $inTimeline,
}''';
} }
@override @override
bool operator ==(covariant PartnerUserDto other) { bool operator ==(covariant PartnerUser other) {
if (identical(this, other)) return true; if (identical(this, other)) return true;
return other.id == id && return other.id == id && other.email == email && other.name == name && other.inTimeline == inTimeline;
other.email == email &&
other.name == name &&
other.inTimeline == inTimeline &&
other.profileImagePath == profileImagePath;
} }
@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;
} }
} }

View File

@@ -24,17 +24,17 @@ 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 => isDarkTheme ? const Color(0xFFABCBFA) : const Color(0xFF4250AF),
AvatarColor.pink => const Color.fromARGB(255, 244, 114, 182), AvatarColor.pink => const Color.fromARGB(255, 244, 114, 182),
AvatarColor.red => const Color.fromARGB(255, 239, 68, 68), AvatarColor.red => const Color.fromARGB(255, 239, 68, 68),
AvatarColor.yellow => const Color.fromARGB(255, 234, 179, 8), AvatarColor.yellow => const Color.fromARGB(255, 234, 179, 8),
AvatarColor.blue => const Color.fromARGB(255, 59, 130, 246), AvatarColor.blue => const Color.fromARGB(255, 59, 130, 246),
AvatarColor.green => const Color.fromARGB(255, 22, 163, 74), AvatarColor.green => const Color.fromARGB(255, 22, 163, 74),
AvatarColor.purple => const Color.fromARGB(255, 147, 51, 234), AvatarColor.purple => const Color.fromARGB(255, 147, 51, 234),
AvatarColor.orange => const Color.fromARGB(255, 234, 88, 12), AvatarColor.orange => const Color.fromARGB(255, 234, 88, 12),
AvatarColor.gray => const Color.fromARGB(255, 75, 85, 99), AvatarColor.gray => const Color.fromARGB(255, 75, 85, 99),
AvatarColor.amber => const Color.fromARGB(255, 217, 119, 6), AvatarColor.amber => const Color.fromARGB(255, 217, 119, 6),
}; };
} }
class Onboarding { class Onboarding {
@@ -193,9 +193,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,
@@ -247,11 +255,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,

View File

@@ -13,19 +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 {
if (asset.stackId == null) { if (asset.stackId == null) {
return []; return [];

View File

@@ -25,16 +25,19 @@ 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) {

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();
@@ -70,7 +70,9 @@ class LocalSyncService {
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);
@@ -118,7 +120,10 @@ class LocalSyncService {
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 +146,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 +172,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
@@ -179,7 +189,9 @@ class LocalSyncService {
// 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 +201,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),
@@ -214,7 +229,9 @@ class LocalSyncService {
final assetsInDb = dbAlbum.assetCount > 0 ? await _localAlbumRepository.getAssets(dbAlbum.id) : <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 +239,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 +282,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) {
@@ -312,7 +342,6 @@ extension on Iterable<PlatformAsset> {
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

@@ -61,7 +61,11 @@ class LogService {
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 +89,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));
} }

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,17 +7,22 @@ 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<PartnerUser>> getSharedWith(String userId) {
return _driftPartnerRepository.getSharedWith(userId); return _driftPartnerRepository.getSharedWith(userId);
} }
Future<List<PartnerUserDto>> getSharedBy(String userId) { Future<List<PartnerUser>> getSharedBy(String userId) {
return _driftPartnerRepository.getSharedBy(userId); return _driftPartnerRepository.getSharedBy(userId);
} }
Future<List<PartnerUserDto>> getAvailablePartners(String currentUserId) async { Future<List<PartnerUser>> getAvailablePartners(
String currentUserId,
) async {
final otherUsers = await _driftPartnerRepository.getAvailablePartners(currentUserId); final otherUsers = await _driftPartnerRepository.getAvailablePartners(currentUserId);
final currentPartners = await _driftPartnerRepository.getSharedBy(currentUserId); final currentPartners = await _driftPartnerRepository.getSharedBy(currentUserId);
final available = otherUsers.where((user) { final available = otherUsers.where((user) {
@@ -34,7 +39,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);
} }
@@ -65,8 +65,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);
@@ -100,7 +108,7 @@ class RemoteAlbumService {
return _repository.getDateRange(albumId); return _repository.getDateRange(albumId);
} }
Future<List<UserDto>> getSharedUsers(String albumId) { Future<List<User>> getSharedUsers(String albumId) {
return _repository.getSharedUsers(albumId); return _repository.getSharedUsers(albumId);
} }
@@ -108,8 +116,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 +136,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

@@ -24,12 +24,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();
@@ -44,8 +48,8 @@ class StoreService {
} }
StreamSubscription<StoreDto> _listenForChange() => _storeRepository.watchAll().listen((event) { StreamSubscription<StoreDto> _listenForChange() => _storeRepository.watchAll().listen((event) {
_cache[event.key.id] = event.value; _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,9 +18,9 @@ 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;
@@ -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,9 +114,14 @@ 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.authUserV1:
return _syncStreamRepository.updateAuthUsersV1(data.cast());
case SyncEntityType.userV1: case SyncEntityType.userV1:
return _syncStreamRepository.updateUsersV1(data.cast()); return _syncStreamRepository.updateUsersV1(data.cast());
case SyncEntityType.userDeleteV1: case SyncEntityType.userDeleteV1:
@@ -120,15 +137,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 +168,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 +220,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,21 +10,28 @@ 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)]; final group = GroupAssetsBy.values[_settingsService.get(Setting.groupAssetsBy)];
@@ -54,12 +61,7 @@ class TimelineFactory {
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(_timelineRepository.person(userId, personId, groupBy));
TimelineService fromAssets(List<BaseAsset> assets) => 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,11 +75,17 @@ 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);
@@ -95,7 +103,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;
@@ -123,7 +134,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

View File

@@ -1,8 +1,10 @@
import 'dart:async'; import 'dart:async';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:immich_mobile/domain/models/setting.model.dart';
import 'package:immich_mobile/domain/models/store.model.dart'; import 'package:immich_mobile/domain/models/store.model.dart';
import 'package:immich_mobile/domain/models/user.model.dart'; import 'package:immich_mobile/domain/models/user.model.dart';
import 'package:immich_mobile/domain/services/setting.service.dart';
import 'package:immich_mobile/domain/services/store.service.dart'; import 'package:immich_mobile/domain/services/store.service.dart';
import 'package:immich_mobile/infrastructure/repositories/user.repository.dart'; import 'package:immich_mobile/infrastructure/repositories/user.repository.dart';
import 'package:immich_mobile/infrastructure/repositories/user_api.repository.dart'; import 'package:immich_mobile/infrastructure/repositories/user_api.repository.dart';
@@ -18,9 +20,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 +46,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);
@@ -63,3 +68,28 @@ class UserService {
return _isarUserRepository.deleteAll(); return _isarUserRepository.deleteAll();
} }
} }
class DriftUserService {
final DriftUserRepository _userRepository;
final SettingsService _settingsService;
const DriftUserService(
this._userRepository,
this._settingsService,
);
Future<User?> getMyUser() {
// TODO: Remove UserDto after new store
final isarCurrentUser = _settingsService.get(Setting.currentUser);
if (isarCurrentUser == null) {
throw Exception('User must be login');
}
return _userRepository.getById(isarCurrentUser.id);
}
Future<List<User>> getAll() {
return _userRepository.getAll();
}
}

View File

@@ -66,21 +66,23 @@ 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 +90,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 +110,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 +133,9 @@ 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

@@ -28,7 +28,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

@@ -45,9 +45,9 @@ class Album {
bool activityEnabled; bool activityEnabled;
@enumerated @enumerated
SortOrder sortOrder; SortOrder sortOrder;
final IsarLink<User> owner = IsarLink<User>(); final IsarLink<IsarUser> owner = IsarLink<IsarUser>();
final IsarLink<Asset> thumbnail = IsarLink<Asset>(); final IsarLink<Asset> thumbnail = IsarLink<Asset>();
final IsarLinks<User> sharedUsers = IsarLinks<User>(); final IsarLinks<IsarUser> sharedUsers = IsarLinks<IsarUser>();
final IsarLinks<Asset> assets = IsarLinks<Asset>(); final IsarLinks<Asset> assets = IsarLinks<Asset>();
// transient fields // transient fields
@@ -95,8 +95,8 @@ 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<IsarUser> get remoteUsers =>
sharedUsers.isEmpty ? (sharedUsers as IsarLinksCommon<User>).addedObjects : sharedUsers; sharedUsers.isEmpty ? (sharedUsers as IsarLinksCommon<IsarUser>).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;
@@ -113,7 +113,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 &&
@@ -157,7 +160,7 @@ class Album {
activityEnabled: dto.isActivityEnabled, activityEnabled: dto.isActivityEnabled,
); );
a.remoteAssetCount = dto.assetCount; a.remoteAssetCount = dto.assetCount;
a.owner.value = await db.users.getById(dto.ownerId); a.owner.value = await db.isarUsers.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;
} }
@@ -166,7 +169,9 @@ class Album {
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.isarUsers.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) {

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

@@ -19,30 +19,30 @@ 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 ? null : ExifDtoConverter.fromDto(remote.exifInfo!),
isFavorite = remote.isFavorite, isFavorite = remote.isFavorite,
isArchived = remote.isArchived, isArchived = remote.isArchived,
isTrashed = remote.isTrashed, isTrashed = remote.isTrashed,
isOffline = remote.isOffline, isOffline = remote.isOffline,
// 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
stackPrimaryAssetId = remote.stack?.primaryAssetId == remote.id ? null : remote.stack?.primaryAssetId, stackPrimaryAssetId = remote.stack?.primaryAssetId == remote.id ? null : remote.stack?.primaryAssetId,
stackCount = remote.stack?.assetCount ?? 0, stackCount = remote.stack?.assetCount ?? 0,
stackId = remote.stack?.id, stackId = remote.stack?.id,
thumbhash = remote.thumbhash, thumbhash = remote.thumbhash,
visibility = getVisibility(remote.visibility); visibility = getVisibility(remote.visibility);
Asset({ Asset({
this.id = Isar.autoIncrement, this.id = Isar.autoIncrement,
@@ -127,7 +127,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;
@@ -443,32 +447,33 @@ 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);
@@ -489,7 +494,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 +539,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,17 +556,21 @@ 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) => ids.isEmpty ? Future.value(0) : remote(ids).deleteAll();
@@ -567,9 +579,13 @@ extension AssetsHelper on IsarCollection<Asset> {
Future<List<Asset>> getAllByLocalId(Iterable<String> ids) => ids.isEmpty ? Future.value([]) : local(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(); 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

@@ -6,7 +6,10 @@ import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/utils/hash.dart'; import 'package:immich_mobile/utils/hash.dart';
extension ListExtension<E> on List<E> { extension ListExtension<E> on List<E> {
List<E> uniqueConsecutive({int Function(E a, E b)? compare, void Function(E a, E b)? onDuplicate}) { List<E> uniqueConsecutive({
int Function(E a, E b)? compare,
void Function(E a, E b)? onDuplicate,
}) {
compare ??= (E a, E b) => a == b ? 0 : 1; compare ??= (E a, E b) => a == b ? 0 : 1;
int i = 1, j = 1; int i = 1, j = 1;
for (; i < length; i++) { for (; i < length; i++) {
@@ -42,7 +45,9 @@ extension IntListExtension on Iterable<int> {
extension AssetListExtension on Iterable<Asset> { extension AssetListExtension on Iterable<Asset> {
/// Returns the assets that are already available in the Immich server /// Returns the assets that are already available in the Immich server
Iterable<Asset> remoteOnly({void Function()? errorCallback}) { Iterable<Asset> remoteOnly({
void Function()? errorCallback,
}) {
final bool onlyRemote = every((e) => e.isRemote); final bool onlyRemote = every((e) => e.isRemote);
if (!onlyRemote) { if (!onlyRemote) {
if (errorCallback != null) errorCallback(); if (errorCallback != null) errorCallback();
@@ -53,7 +58,10 @@ extension AssetListExtension on Iterable<Asset> {
/// Returns the assets that are owned by the user passed to the [owner] param /// Returns the assets that are owned by the user passed to the [owner] param
/// If [owner] is null, an empty list is returned /// If [owner] is null, an empty list is returned
Iterable<Asset> ownedOnly(UserDto? owner, {void Function()? errorCallback}) { Iterable<Asset> ownedOnly(
UserDto? owner, {
void Function()? errorCallback,
}) {
if (owner == null) return []; if (owner == null) return [];
final isarUserId = fastHash(owner.id); final isarUserId = fastHash(owner.id);
final bool onlyOwned = every((e) => e.ownerId == isarUserId); final bool onlyOwned = every((e) => e.ownerId == isarUserId);

View File

@@ -47,7 +47,11 @@ extension DateRangeFormatting on DateTime {
/// - Date range of this year: "Mar 23-May 31" /// - Date range of this year: "Mar 23-May 31"
/// - Date range of other year: "Aug 28 - Sep 30, 2023" /// - Date range of other year: "Aug 28 - Sep 30, 2023"
/// - Date range over multiple years: "Apr 17, 2021 - Apr 9, 2022" /// - Date range over multiple years: "Apr 17, 2021 - Apr 9, 2022"
static String formatDateRange(DateTime startDate, DateTime endDate, Locale? locale) { static String formatDateRange(
DateTime startDate,
DateTime endDate,
Locale? locale,
) {
final now = DateTime.now(); final now = DateTime.now();
final currentYear = now.year; final currentYear = now.year;
final localeString = locale?.toString() ?? 'en_US'; final localeString = locale?.toString() ?? 'en_US';

View File

@@ -13,7 +13,9 @@ extension MapMarkers on MapLibreMapController {
Future<void> addGeoJSONSourceForMarkers(List<MapMarker> markers) async { Future<void> addGeoJSONSourceForMarkers(List<MapMarker> markers) async {
return addSource( return addSource(
MapUtils.defaultSourceId, MapUtils.defaultSourceId,
GeojsonSourceProperties(data: MapUtils.generateGeoJsonForMarkers(markers.toList())), GeojsonSourceProperties(
data: MapUtils.generateGeoJsonForMarkers(markers.toList()),
),
); );
} }
@@ -71,13 +73,23 @@ extension MapMarkers on MapLibreMapController {
try { try {
final ByteData bytes = await rootBundle.load("assets/location-pin.png"); final ByteData bytes = await rootBundle.load("assets/location-pin.png");
await addImage("mapMarker", bytes.buffer.asUint8List()); await addImage("mapMarker", bytes.buffer.asUint8List());
return addSymbol(SymbolOptions(geometry: centre, iconImage: "mapMarker", iconSize: 0.15, iconAnchor: "bottom")); return addSymbol(
SymbolOptions(
geometry: centre,
iconImage: "mapMarker",
iconSize: 0.15,
iconAnchor: "bottom",
),
);
} finally { } finally {
// no-op // no-op
} }
} }
Future<LatLngBounds> getBoundsFromPoint(Point<double> point, double distance) async { Future<LatLngBounds> getBoundsFromPoint(
Point<double> point,
double distance,
) async {
final southWestPx = Point(point.x - distance, point.y + distance); final southWestPx = Point(point.x - distance, point.y + distance);
final northEastPx = Point(point.x + distance, point.y - distance); final northEastPx = Point(point.x + distance, point.y - distance);

View File

@@ -10,7 +10,11 @@ class FastScrollPhysics extends ScrollPhysics {
} }
@override @override
SpringDescription get spring => const SpringDescription(mass: 1, stiffness: 402.49984375, damping: 40); SpringDescription get spring => const SpringDescription(
mass: 1,
stiffness: 402.49984375,
damping: 40,
);
} }
class FastClampingScrollPhysics extends ClampingScrollPhysics { class FastClampingScrollPhysics extends ClampingScrollPhysics {
@@ -23,12 +27,12 @@ class FastClampingScrollPhysics extends ClampingScrollPhysics {
@override @override
SpringDescription get spring => const SpringDescription( SpringDescription get spring => const SpringDescription(
// When swiping between videos on Android, the placeholder of the first opened video // When swiping between videos on Android, the placeholder of the first opened video
// can briefly be seen and cause a flicker effect if the video begins to initialize // can briefly be seen and cause a flicker effect if the video begins to initialize
// before the animation finishes - probably a bug in PhotoViewGallery's animation handling // before the animation finishes - probably a bug in PhotoViewGallery's animation handling
// Making the animation faster is not just stylistic, but also helps to avoid this flicker // Making the animation faster is not just stylistic, but also helps to avoid this flicker
mass: 1, mass: 1,
stiffness: 1601.2499609375, stiffness: 1601.2499609375,
damping: 80, damping: 80,
); );
} }

View File

@@ -1,6 +1,10 @@
extension StringExtension on String { extension StringExtension on String {
String capitalize() { String capitalize() {
return split(" ").map((str) => str.isEmpty ? str : str[0].toUpperCase() + str.substring(1)).join(" "); return split(" ")
.map(
(str) => str.isEmpty ? str : str[0].toUpperCase() + str.substring(1),
)
.join(" ");
} }
} }

View File

@@ -7,10 +7,16 @@ extension ImmichColorSchemeExtensions on ColorScheme {
extension ColorExtensions on Color { extension ColorExtensions on Color {
Color lighten({double amount = 0.1}) { Color lighten({double amount = 0.1}) {
return Color.alphaBlend(Colors.white.withValues(alpha: amount), this); return Color.alphaBlend(
Colors.white.withValues(alpha: amount),
this,
);
} }
Color darken({double amount = 0.1}) { Color darken({double amount = 0.1}) {
return Color.alphaBlend(Colors.black.withValues(alpha: amount), this); return Color.alphaBlend(
Colors.black.withValues(alpha: amount),
this,
);
} }
} }

View File

@@ -29,7 +29,11 @@ extension TextTranslateExtension on Text {
} }
} }
String _translateHelper(BuildContext? context, String key, [Map<String, Object>? args]) { String _translateHelper(
BuildContext? context,
String key, [
Map<String, Object>? args,
]) {
if (key.isEmpty) { if (key.isEmpty) {
return ''; return '';
} }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,56 @@
import 'package:drift/drift.dart';
import 'package:immich_mobile/domain/models/user.model.dart';
import 'package:immich_mobile/domain/models/user_metadata.model.dart';
import 'package:immich_mobile/infrastructure/entities/auth_user.entity.drift.dart';
import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
class AuthUserEntity extends Table with DriftDefaultsMixin {
const AuthUserEntity();
TextColumn get id => text()();
TextColumn get name => text()();
TextColumn get email => text()();
DateTimeColumn get deletedAt => dateTime().nullable()();
IntColumn get avatarColor => intEnum<AvatarColor>().nullable()();
BoolColumn get isAdmin => boolean().withDefault(const Constant(false))();
TextColumn get oauthId => text().withDefault(const Constant(''))();
TextColumn get pinCode => text().nullable()();
BoolColumn get hasProfileImage => boolean().withDefault(const Constant(false))();
DateTimeColumn get profileChangedAt => dateTime().withDefault(currentDateAndTime)();
IntColumn get quotaSizeInBytes => integer().nullable()();
IntColumn get quotaUsageInBytes => integer().withDefault(const Constant(0))();
TextColumn get storageLabel => text().nullable()();
@override
Set<Column> get primaryKey => {id};
}
extension AuthUserEntityDataDomainEx on AuthUserEntityData {
AuthUser toDto() => AuthUser(
id: id,
name: name,
email: email,
deletedAt: deletedAt,
avatarColor: avatarColor,
isAdmin: isAdmin,
oauthId: oauthId,
pinCode: pinCode,
hasProfileImage: hasProfileImage,
profileChangedAt: profileChangedAt,
quotaSizeInBytes: quotaSizeInBytes,
quotaUsageInBytes: quotaUsageInBytes,
storageLabel: storageLabel,
);
}

View File

@@ -0,0 +1,951 @@
// dart format width=80
// ignore_for_file: type=lint
import 'package:drift/drift.dart' as i0;
import 'package:immich_mobile/infrastructure/entities/auth_user.entity.drift.dart'
as i1;
import 'package:immich_mobile/domain/models/user_metadata.model.dart' as i2;
import 'package:immich_mobile/infrastructure/entities/auth_user.entity.dart'
as i3;
import 'package:drift/src/runtime/query_builder/query_builder.dart' as i4;
typedef $$AuthUserEntityTableCreateCompanionBuilder = i1.AuthUserEntityCompanion
Function({
required String id,
required String name,
required String email,
i0.Value<DateTime?> deletedAt,
i0.Value<i2.AvatarColor?> avatarColor,
i0.Value<bool> isAdmin,
i0.Value<String> oauthId,
i0.Value<String?> pinCode,
i0.Value<bool> hasProfileImage,
i0.Value<DateTime> profileChangedAt,
i0.Value<int?> quotaSizeInBytes,
i0.Value<int> quotaUsageInBytes,
i0.Value<String?> storageLabel,
});
typedef $$AuthUserEntityTableUpdateCompanionBuilder = i1.AuthUserEntityCompanion
Function({
i0.Value<String> id,
i0.Value<String> name,
i0.Value<String> email,
i0.Value<DateTime?> deletedAt,
i0.Value<i2.AvatarColor?> avatarColor,
i0.Value<bool> isAdmin,
i0.Value<String> oauthId,
i0.Value<String?> pinCode,
i0.Value<bool> hasProfileImage,
i0.Value<DateTime> profileChangedAt,
i0.Value<int?> quotaSizeInBytes,
i0.Value<int> quotaUsageInBytes,
i0.Value<String?> storageLabel,
});
class $$AuthUserEntityTableFilterComposer
extends i0.Composer<i0.GeneratedDatabase, i1.$AuthUserEntityTable> {
$$AuthUserEntityTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
i0.ColumnFilters<String> get id => $composableBuilder(
column: $table.id, builder: (column) => i0.ColumnFilters(column));
i0.ColumnFilters<String> get name => $composableBuilder(
column: $table.name, builder: (column) => i0.ColumnFilters(column));
i0.ColumnFilters<String> get email => $composableBuilder(
column: $table.email, builder: (column) => i0.ColumnFilters(column));
i0.ColumnFilters<DateTime> get deletedAt => $composableBuilder(
column: $table.deletedAt, builder: (column) => i0.ColumnFilters(column));
i0.ColumnWithTypeConverterFilters<i2.AvatarColor?, i2.AvatarColor, int>
get avatarColor => $composableBuilder(
column: $table.avatarColor,
builder: (column) => i0.ColumnWithTypeConverterFilters(column));
i0.ColumnFilters<bool> get isAdmin => $composableBuilder(
column: $table.isAdmin, builder: (column) => i0.ColumnFilters(column));
i0.ColumnFilters<String> get oauthId => $composableBuilder(
column: $table.oauthId, builder: (column) => i0.ColumnFilters(column));
i0.ColumnFilters<String> get pinCode => $composableBuilder(
column: $table.pinCode, builder: (column) => i0.ColumnFilters(column));
i0.ColumnFilters<bool> get hasProfileImage => $composableBuilder(
column: $table.hasProfileImage,
builder: (column) => i0.ColumnFilters(column));
i0.ColumnFilters<DateTime> get profileChangedAt => $composableBuilder(
column: $table.profileChangedAt,
builder: (column) => i0.ColumnFilters(column));
i0.ColumnFilters<int> get quotaSizeInBytes => $composableBuilder(
column: $table.quotaSizeInBytes,
builder: (column) => i0.ColumnFilters(column));
i0.ColumnFilters<int> get quotaUsageInBytes => $composableBuilder(
column: $table.quotaUsageInBytes,
builder: (column) => i0.ColumnFilters(column));
i0.ColumnFilters<String> get storageLabel => $composableBuilder(
column: $table.storageLabel,
builder: (column) => i0.ColumnFilters(column));
}
class $$AuthUserEntityTableOrderingComposer
extends i0.Composer<i0.GeneratedDatabase, i1.$AuthUserEntityTable> {
$$AuthUserEntityTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
i0.ColumnOrderings<String> get id => $composableBuilder(
column: $table.id, builder: (column) => i0.ColumnOrderings(column));
i0.ColumnOrderings<String> get name => $composableBuilder(
column: $table.name, builder: (column) => i0.ColumnOrderings(column));
i0.ColumnOrderings<String> get email => $composableBuilder(
column: $table.email, builder: (column) => i0.ColumnOrderings(column));
i0.ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
column: $table.deletedAt,
builder: (column) => i0.ColumnOrderings(column));
i0.ColumnOrderings<int> get avatarColor => $composableBuilder(
column: $table.avatarColor,
builder: (column) => i0.ColumnOrderings(column));
i0.ColumnOrderings<bool> get isAdmin => $composableBuilder(
column: $table.isAdmin, builder: (column) => i0.ColumnOrderings(column));
i0.ColumnOrderings<String> get oauthId => $composableBuilder(
column: $table.oauthId, builder: (column) => i0.ColumnOrderings(column));
i0.ColumnOrderings<String> get pinCode => $composableBuilder(
column: $table.pinCode, builder: (column) => i0.ColumnOrderings(column));
i0.ColumnOrderings<bool> get hasProfileImage => $composableBuilder(
column: $table.hasProfileImage,
builder: (column) => i0.ColumnOrderings(column));
i0.ColumnOrderings<DateTime> get profileChangedAt => $composableBuilder(
column: $table.profileChangedAt,
builder: (column) => i0.ColumnOrderings(column));
i0.ColumnOrderings<int> get quotaSizeInBytes => $composableBuilder(
column: $table.quotaSizeInBytes,
builder: (column) => i0.ColumnOrderings(column));
i0.ColumnOrderings<int> get quotaUsageInBytes => $composableBuilder(
column: $table.quotaUsageInBytes,
builder: (column) => i0.ColumnOrderings(column));
i0.ColumnOrderings<String> get storageLabel => $composableBuilder(
column: $table.storageLabel,
builder: (column) => i0.ColumnOrderings(column));
}
class $$AuthUserEntityTableAnnotationComposer
extends i0.Composer<i0.GeneratedDatabase, i1.$AuthUserEntityTable> {
$$AuthUserEntityTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
i0.GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
i0.GeneratedColumn<String> get name =>
$composableBuilder(column: $table.name, builder: (column) => column);
i0.GeneratedColumn<String> get email =>
$composableBuilder(column: $table.email, builder: (column) => column);
i0.GeneratedColumn<DateTime> get deletedAt =>
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
i0.GeneratedColumnWithTypeConverter<i2.AvatarColor?, int> get avatarColor =>
$composableBuilder(
column: $table.avatarColor, builder: (column) => column);
i0.GeneratedColumn<bool> get isAdmin =>
$composableBuilder(column: $table.isAdmin, builder: (column) => column);
i0.GeneratedColumn<String> get oauthId =>
$composableBuilder(column: $table.oauthId, builder: (column) => column);
i0.GeneratedColumn<String> get pinCode =>
$composableBuilder(column: $table.pinCode, builder: (column) => column);
i0.GeneratedColumn<bool> get hasProfileImage => $composableBuilder(
column: $table.hasProfileImage, builder: (column) => column);
i0.GeneratedColumn<DateTime> get profileChangedAt => $composableBuilder(
column: $table.profileChangedAt, builder: (column) => column);
i0.GeneratedColumn<int> get quotaSizeInBytes => $composableBuilder(
column: $table.quotaSizeInBytes, builder: (column) => column);
i0.GeneratedColumn<int> get quotaUsageInBytes => $composableBuilder(
column: $table.quotaUsageInBytes, builder: (column) => column);
i0.GeneratedColumn<String> get storageLabel => $composableBuilder(
column: $table.storageLabel, builder: (column) => column);
}
class $$AuthUserEntityTableTableManager extends i0.RootTableManager<
i0.GeneratedDatabase,
i1.$AuthUserEntityTable,
i1.AuthUserEntityData,
i1.$$AuthUserEntityTableFilterComposer,
i1.$$AuthUserEntityTableOrderingComposer,
i1.$$AuthUserEntityTableAnnotationComposer,
$$AuthUserEntityTableCreateCompanionBuilder,
$$AuthUserEntityTableUpdateCompanionBuilder,
(
i1.AuthUserEntityData,
i0.BaseReferences<i0.GeneratedDatabase, i1.$AuthUserEntityTable,
i1.AuthUserEntityData>
),
i1.AuthUserEntityData,
i0.PrefetchHooks Function()> {
$$AuthUserEntityTableTableManager(
i0.GeneratedDatabase db, i1.$AuthUserEntityTable table)
: super(i0.TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
i1.$$AuthUserEntityTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
i1.$$AuthUserEntityTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () => i1
.$$AuthUserEntityTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback: ({
i0.Value<String> id = const i0.Value.absent(),
i0.Value<String> name = const i0.Value.absent(),
i0.Value<String> email = const i0.Value.absent(),
i0.Value<DateTime?> deletedAt = const i0.Value.absent(),
i0.Value<i2.AvatarColor?> avatarColor = const i0.Value.absent(),
i0.Value<bool> isAdmin = const i0.Value.absent(),
i0.Value<String> oauthId = const i0.Value.absent(),
i0.Value<String?> pinCode = const i0.Value.absent(),
i0.Value<bool> hasProfileImage = const i0.Value.absent(),
i0.Value<DateTime> profileChangedAt = const i0.Value.absent(),
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
i0.Value<int> quotaUsageInBytes = const i0.Value.absent(),
i0.Value<String?> storageLabel = const i0.Value.absent(),
}) =>
i1.AuthUserEntityCompanion(
id: id,
name: name,
email: email,
deletedAt: deletedAt,
avatarColor: avatarColor,
isAdmin: isAdmin,
oauthId: oauthId,
pinCode: pinCode,
hasProfileImage: hasProfileImage,
profileChangedAt: profileChangedAt,
quotaSizeInBytes: quotaSizeInBytes,
quotaUsageInBytes: quotaUsageInBytes,
storageLabel: storageLabel,
),
createCompanionCallback: ({
required String id,
required String name,
required String email,
i0.Value<DateTime?> deletedAt = const i0.Value.absent(),
i0.Value<i2.AvatarColor?> avatarColor = const i0.Value.absent(),
i0.Value<bool> isAdmin = const i0.Value.absent(),
i0.Value<String> oauthId = const i0.Value.absent(),
i0.Value<String?> pinCode = const i0.Value.absent(),
i0.Value<bool> hasProfileImage = const i0.Value.absent(),
i0.Value<DateTime> profileChangedAt = const i0.Value.absent(),
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
i0.Value<int> quotaUsageInBytes = const i0.Value.absent(),
i0.Value<String?> storageLabel = const i0.Value.absent(),
}) =>
i1.AuthUserEntityCompanion.insert(
id: id,
name: name,
email: email,
deletedAt: deletedAt,
avatarColor: avatarColor,
isAdmin: isAdmin,
oauthId: oauthId,
pinCode: pinCode,
hasProfileImage: hasProfileImage,
profileChangedAt: profileChangedAt,
quotaSizeInBytes: quotaSizeInBytes,
quotaUsageInBytes: quotaUsageInBytes,
storageLabel: storageLabel,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), i0.BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
));
}
typedef $$AuthUserEntityTableProcessedTableManager = i0.ProcessedTableManager<
i0.GeneratedDatabase,
i1.$AuthUserEntityTable,
i1.AuthUserEntityData,
i1.$$AuthUserEntityTableFilterComposer,
i1.$$AuthUserEntityTableOrderingComposer,
i1.$$AuthUserEntityTableAnnotationComposer,
$$AuthUserEntityTableCreateCompanionBuilder,
$$AuthUserEntityTableUpdateCompanionBuilder,
(
i1.AuthUserEntityData,
i0.BaseReferences<i0.GeneratedDatabase, i1.$AuthUserEntityTable,
i1.AuthUserEntityData>
),
i1.AuthUserEntityData,
i0.PrefetchHooks Function()>;
class $AuthUserEntityTable extends i3.AuthUserEntity
with i0.TableInfo<$AuthUserEntityTable, i1.AuthUserEntityData> {
@override
final i0.GeneratedDatabase attachedDatabase;
final String? _alias;
$AuthUserEntityTable(this.attachedDatabase, [this._alias]);
static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id');
@override
late final i0.GeneratedColumn<String> id = i0.GeneratedColumn<String>(
'id', aliasedName, false,
type: i0.DriftSqlType.string, requiredDuringInsert: true);
static const i0.VerificationMeta _nameMeta =
const i0.VerificationMeta('name');
@override
late final i0.GeneratedColumn<String> name = i0.GeneratedColumn<String>(
'name', aliasedName, false,
type: i0.DriftSqlType.string, requiredDuringInsert: true);
static const i0.VerificationMeta _emailMeta =
const i0.VerificationMeta('email');
@override
late final i0.GeneratedColumn<String> email = i0.GeneratedColumn<String>(
'email', aliasedName, false,
type: i0.DriftSqlType.string, requiredDuringInsert: true);
static const i0.VerificationMeta _deletedAtMeta =
const i0.VerificationMeta('deletedAt');
@override
late final i0.GeneratedColumn<DateTime> deletedAt =
i0.GeneratedColumn<DateTime>('deleted_at', aliasedName, true,
type: i0.DriftSqlType.dateTime, requiredDuringInsert: false);
@override
late final i0.GeneratedColumnWithTypeConverter<i2.AvatarColor?, int>
avatarColor = i0.GeneratedColumn<int>('avatar_color', aliasedName, true,
type: i0.DriftSqlType.int, requiredDuringInsert: false)
.withConverter<i2.AvatarColor?>(
i1.$AuthUserEntityTable.$converteravatarColorn);
static const i0.VerificationMeta _isAdminMeta =
const i0.VerificationMeta('isAdmin');
@override
late final i0.GeneratedColumn<bool> isAdmin = i0.GeneratedColumn<bool>(
'is_admin', aliasedName, false,
type: i0.DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints:
i0.GeneratedColumn.constraintIsAlways('CHECK ("is_admin" IN (0, 1))'),
defaultValue: const i4.Constant(false));
static const i0.VerificationMeta _oauthIdMeta =
const i0.VerificationMeta('oauthId');
@override
late final i0.GeneratedColumn<String> oauthId = i0.GeneratedColumn<String>(
'oauth_id', aliasedName, false,
type: i0.DriftSqlType.string,
requiredDuringInsert: false,
defaultValue: const i4.Constant(''));
static const i0.VerificationMeta _pinCodeMeta =
const i0.VerificationMeta('pinCode');
@override
late final i0.GeneratedColumn<String> pinCode = i0.GeneratedColumn<String>(
'pin_code', aliasedName, true,
type: i0.DriftSqlType.string, requiredDuringInsert: false);
static const i0.VerificationMeta _hasProfileImageMeta =
const i0.VerificationMeta('hasProfileImage');
@override
late final i0.GeneratedColumn<bool> hasProfileImage =
i0.GeneratedColumn<bool>('has_profile_image', aliasedName, false,
type: i0.DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
'CHECK ("has_profile_image" IN (0, 1))'),
defaultValue: const i4.Constant(false));
static const i0.VerificationMeta _profileChangedAtMeta =
const i0.VerificationMeta('profileChangedAt');
@override
late final i0.GeneratedColumn<DateTime> profileChangedAt =
i0.GeneratedColumn<DateTime>('profile_changed_at', aliasedName, false,
type: i0.DriftSqlType.dateTime,
requiredDuringInsert: false,
defaultValue: i4.currentDateAndTime);
static const i0.VerificationMeta _quotaSizeInBytesMeta =
const i0.VerificationMeta('quotaSizeInBytes');
@override
late final i0.GeneratedColumn<int> quotaSizeInBytes = i0.GeneratedColumn<int>(
'quota_size_in_bytes', aliasedName, true,
type: i0.DriftSqlType.int, requiredDuringInsert: false);
static const i0.VerificationMeta _quotaUsageInBytesMeta =
const i0.VerificationMeta('quotaUsageInBytes');
@override
late final i0.GeneratedColumn<int> quotaUsageInBytes =
i0.GeneratedColumn<int>('quota_usage_in_bytes', aliasedName, false,
type: i0.DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const i4.Constant(0));
static const i0.VerificationMeta _storageLabelMeta =
const i0.VerificationMeta('storageLabel');
@override
late final i0.GeneratedColumn<String> storageLabel =
i0.GeneratedColumn<String>('storage_label', aliasedName, true,
type: i0.DriftSqlType.string, requiredDuringInsert: false);
@override
List<i0.GeneratedColumn> get $columns => [
id,
name,
email,
deletedAt,
avatarColor,
isAdmin,
oauthId,
pinCode,
hasProfileImage,
profileChangedAt,
quotaSizeInBytes,
quotaUsageInBytes,
storageLabel
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'auth_user_entity';
@override
i0.VerificationContext validateIntegrity(
i0.Insertable<i1.AuthUserEntityData> instance,
{bool isInserting = false}) {
final context = i0.VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
} else if (isInserting) {
context.missing(_idMeta);
}
if (data.containsKey('name')) {
context.handle(
_nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta));
} else if (isInserting) {
context.missing(_nameMeta);
}
if (data.containsKey('email')) {
context.handle(
_emailMeta, email.isAcceptableOrUnknown(data['email']!, _emailMeta));
} else if (isInserting) {
context.missing(_emailMeta);
}
if (data.containsKey('deleted_at')) {
context.handle(_deletedAtMeta,
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta));
}
if (data.containsKey('is_admin')) {
context.handle(_isAdminMeta,
isAdmin.isAcceptableOrUnknown(data['is_admin']!, _isAdminMeta));
}
if (data.containsKey('oauth_id')) {
context.handle(_oauthIdMeta,
oauthId.isAcceptableOrUnknown(data['oauth_id']!, _oauthIdMeta));
}
if (data.containsKey('pin_code')) {
context.handle(_pinCodeMeta,
pinCode.isAcceptableOrUnknown(data['pin_code']!, _pinCodeMeta));
}
if (data.containsKey('has_profile_image')) {
context.handle(
_hasProfileImageMeta,
hasProfileImage.isAcceptableOrUnknown(
data['has_profile_image']!, _hasProfileImageMeta));
}
if (data.containsKey('profile_changed_at')) {
context.handle(
_profileChangedAtMeta,
profileChangedAt.isAcceptableOrUnknown(
data['profile_changed_at']!, _profileChangedAtMeta));
}
if (data.containsKey('quota_size_in_bytes')) {
context.handle(
_quotaSizeInBytesMeta,
quotaSizeInBytes.isAcceptableOrUnknown(
data['quota_size_in_bytes']!, _quotaSizeInBytesMeta));
}
if (data.containsKey('quota_usage_in_bytes')) {
context.handle(
_quotaUsageInBytesMeta,
quotaUsageInBytes.isAcceptableOrUnknown(
data['quota_usage_in_bytes']!, _quotaUsageInBytesMeta));
}
if (data.containsKey('storage_label')) {
context.handle(
_storageLabelMeta,
storageLabel.isAcceptableOrUnknown(
data['storage_label']!, _storageLabelMeta));
}
return context;
}
@override
Set<i0.GeneratedColumn> get $primaryKey => {id};
@override
i1.AuthUserEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return i1.AuthUserEntityData(
id: attachedDatabase.typeMapping
.read(i0.DriftSqlType.string, data['${effectivePrefix}id'])!,
name: attachedDatabase.typeMapping
.read(i0.DriftSqlType.string, data['${effectivePrefix}name'])!,
email: attachedDatabase.typeMapping
.read(i0.DriftSqlType.string, data['${effectivePrefix}email'])!,
deletedAt: attachedDatabase.typeMapping
.read(i0.DriftSqlType.dateTime, data['${effectivePrefix}deleted_at']),
avatarColor: i1.$AuthUserEntityTable.$converteravatarColorn.fromSql(
attachedDatabase.typeMapping.read(
i0.DriftSqlType.int, data['${effectivePrefix}avatar_color'])),
isAdmin: attachedDatabase.typeMapping
.read(i0.DriftSqlType.bool, data['${effectivePrefix}is_admin'])!,
oauthId: attachedDatabase.typeMapping
.read(i0.DriftSqlType.string, data['${effectivePrefix}oauth_id'])!,
pinCode: attachedDatabase.typeMapping
.read(i0.DriftSqlType.string, data['${effectivePrefix}pin_code']),
hasProfileImage: attachedDatabase.typeMapping.read(
i0.DriftSqlType.bool, data['${effectivePrefix}has_profile_image'])!,
profileChangedAt: attachedDatabase.typeMapping.read(
i0.DriftSqlType.dateTime,
data['${effectivePrefix}profile_changed_at'])!,
quotaSizeInBytes: attachedDatabase.typeMapping.read(
i0.DriftSqlType.int, data['${effectivePrefix}quota_size_in_bytes']),
quotaUsageInBytes: attachedDatabase.typeMapping.read(
i0.DriftSqlType.int, data['${effectivePrefix}quota_usage_in_bytes'])!,
storageLabel: attachedDatabase.typeMapping.read(
i0.DriftSqlType.string, data['${effectivePrefix}storage_label']),
);
}
@override
$AuthUserEntityTable createAlias(String alias) {
return $AuthUserEntityTable(attachedDatabase, alias);
}
static i0.JsonTypeConverter2<i2.AvatarColor, int, int> $converteravatarColor =
const i0.EnumIndexConverter<i2.AvatarColor>(i2.AvatarColor.values);
static i0.JsonTypeConverter2<i2.AvatarColor?, int?, int?>
$converteravatarColorn =
i0.JsonTypeConverter2.asNullable($converteravatarColor);
@override
bool get withoutRowId => true;
@override
bool get isStrict => true;
}
class AuthUserEntityData extends i0.DataClass
implements i0.Insertable<i1.AuthUserEntityData> {
final String id;
final String name;
final String email;
final DateTime? deletedAt;
final i2.AvatarColor? avatarColor;
final bool isAdmin;
final String oauthId;
final String? pinCode;
final bool hasProfileImage;
final DateTime profileChangedAt;
final int? quotaSizeInBytes;
final int quotaUsageInBytes;
final String? storageLabel;
const AuthUserEntityData(
{required this.id,
required this.name,
required this.email,
this.deletedAt,
this.avatarColor,
required this.isAdmin,
required this.oauthId,
this.pinCode,
required this.hasProfileImage,
required this.profileChangedAt,
this.quotaSizeInBytes,
required this.quotaUsageInBytes,
this.storageLabel});
@override
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
final map = <String, i0.Expression>{};
map['id'] = i0.Variable<String>(id);
map['name'] = i0.Variable<String>(name);
map['email'] = i0.Variable<String>(email);
if (!nullToAbsent || deletedAt != null) {
map['deleted_at'] = i0.Variable<DateTime>(deletedAt);
}
if (!nullToAbsent || avatarColor != null) {
map['avatar_color'] = i0.Variable<int>(
i1.$AuthUserEntityTable.$converteravatarColorn.toSql(avatarColor));
}
map['is_admin'] = i0.Variable<bool>(isAdmin);
map['oauth_id'] = i0.Variable<String>(oauthId);
if (!nullToAbsent || pinCode != null) {
map['pin_code'] = i0.Variable<String>(pinCode);
}
map['has_profile_image'] = i0.Variable<bool>(hasProfileImage);
map['profile_changed_at'] = i0.Variable<DateTime>(profileChangedAt);
if (!nullToAbsent || quotaSizeInBytes != null) {
map['quota_size_in_bytes'] = i0.Variable<int>(quotaSizeInBytes);
}
map['quota_usage_in_bytes'] = i0.Variable<int>(quotaUsageInBytes);
if (!nullToAbsent || storageLabel != null) {
map['storage_label'] = i0.Variable<String>(storageLabel);
}
return map;
}
factory AuthUserEntityData.fromJson(Map<String, dynamic> json,
{i0.ValueSerializer? serializer}) {
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
return AuthUserEntityData(
id: serializer.fromJson<String>(json['id']),
name: serializer.fromJson<String>(json['name']),
email: serializer.fromJson<String>(json['email']),
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
avatarColor: i1.$AuthUserEntityTable.$converteravatarColorn
.fromJson(serializer.fromJson<int?>(json['avatarColor'])),
isAdmin: serializer.fromJson<bool>(json['isAdmin']),
oauthId: serializer.fromJson<String>(json['oauthId']),
pinCode: serializer.fromJson<String?>(json['pinCode']),
hasProfileImage: serializer.fromJson<bool>(json['hasProfileImage']),
profileChangedAt: serializer.fromJson<DateTime>(json['profileChangedAt']),
quotaSizeInBytes: serializer.fromJson<int?>(json['quotaSizeInBytes']),
quotaUsageInBytes: serializer.fromJson<int>(json['quotaUsageInBytes']),
storageLabel: serializer.fromJson<String?>(json['storageLabel']),
);
}
@override
Map<String, dynamic> toJson({i0.ValueSerializer? serializer}) {
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'name': serializer.toJson<String>(name),
'email': serializer.toJson<String>(email),
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
'avatarColor': serializer.toJson<int?>(
i1.$AuthUserEntityTable.$converteravatarColorn.toJson(avatarColor)),
'isAdmin': serializer.toJson<bool>(isAdmin),
'oauthId': serializer.toJson<String>(oauthId),
'pinCode': serializer.toJson<String?>(pinCode),
'hasProfileImage': serializer.toJson<bool>(hasProfileImage),
'profileChangedAt': serializer.toJson<DateTime>(profileChangedAt),
'quotaSizeInBytes': serializer.toJson<int?>(quotaSizeInBytes),
'quotaUsageInBytes': serializer.toJson<int>(quotaUsageInBytes),
'storageLabel': serializer.toJson<String?>(storageLabel),
};
}
i1.AuthUserEntityData copyWith(
{String? id,
String? name,
String? email,
i0.Value<DateTime?> deletedAt = const i0.Value.absent(),
i0.Value<i2.AvatarColor?> avatarColor = const i0.Value.absent(),
bool? isAdmin,
String? oauthId,
i0.Value<String?> pinCode = const i0.Value.absent(),
bool? hasProfileImage,
DateTime? profileChangedAt,
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
int? quotaUsageInBytes,
i0.Value<String?> storageLabel = const i0.Value.absent()}) =>
i1.AuthUserEntityData(
id: id ?? this.id,
name: name ?? this.name,
email: email ?? this.email,
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
avatarColor: avatarColor.present ? avatarColor.value : this.avatarColor,
isAdmin: isAdmin ?? this.isAdmin,
oauthId: oauthId ?? this.oauthId,
pinCode: pinCode.present ? pinCode.value : this.pinCode,
hasProfileImage: hasProfileImage ?? this.hasProfileImage,
profileChangedAt: profileChangedAt ?? this.profileChangedAt,
quotaSizeInBytes: quotaSizeInBytes.present
? quotaSizeInBytes.value
: this.quotaSizeInBytes,
quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
storageLabel:
storageLabel.present ? storageLabel.value : this.storageLabel,
);
AuthUserEntityData copyWithCompanion(i1.AuthUserEntityCompanion data) {
return AuthUserEntityData(
id: data.id.present ? data.id.value : this.id,
name: data.name.present ? data.name.value : this.name,
email: data.email.present ? data.email.value : this.email,
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
avatarColor:
data.avatarColor.present ? data.avatarColor.value : this.avatarColor,
isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin,
oauthId: data.oauthId.present ? data.oauthId.value : this.oauthId,
pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode,
hasProfileImage: data.hasProfileImage.present
? data.hasProfileImage.value
: this.hasProfileImage,
profileChangedAt: data.profileChangedAt.present
? data.profileChangedAt.value
: this.profileChangedAt,
quotaSizeInBytes: data.quotaSizeInBytes.present
? data.quotaSizeInBytes.value
: this.quotaSizeInBytes,
quotaUsageInBytes: data.quotaUsageInBytes.present
? data.quotaUsageInBytes.value
: this.quotaUsageInBytes,
storageLabel: data.storageLabel.present
? data.storageLabel.value
: this.storageLabel,
);
}
@override
String toString() {
return (StringBuffer('AuthUserEntityData(')
..write('id: $id, ')
..write('name: $name, ')
..write('email: $email, ')
..write('deletedAt: $deletedAt, ')
..write('avatarColor: $avatarColor, ')
..write('isAdmin: $isAdmin, ')
..write('oauthId: $oauthId, ')
..write('pinCode: $pinCode, ')
..write('hasProfileImage: $hasProfileImage, ')
..write('profileChangedAt: $profileChangedAt, ')
..write('quotaSizeInBytes: $quotaSizeInBytes, ')
..write('quotaUsageInBytes: $quotaUsageInBytes, ')
..write('storageLabel: $storageLabel')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
name,
email,
deletedAt,
avatarColor,
isAdmin,
oauthId,
pinCode,
hasProfileImage,
profileChangedAt,
quotaSizeInBytes,
quotaUsageInBytes,
storageLabel);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is i1.AuthUserEntityData &&
other.id == this.id &&
other.name == this.name &&
other.email == this.email &&
other.deletedAt == this.deletedAt &&
other.avatarColor == this.avatarColor &&
other.isAdmin == this.isAdmin &&
other.oauthId == this.oauthId &&
other.pinCode == this.pinCode &&
other.hasProfileImage == this.hasProfileImage &&
other.profileChangedAt == this.profileChangedAt &&
other.quotaSizeInBytes == this.quotaSizeInBytes &&
other.quotaUsageInBytes == this.quotaUsageInBytes &&
other.storageLabel == this.storageLabel);
}
class AuthUserEntityCompanion
extends i0.UpdateCompanion<i1.AuthUserEntityData> {
final i0.Value<String> id;
final i0.Value<String> name;
final i0.Value<String> email;
final i0.Value<DateTime?> deletedAt;
final i0.Value<i2.AvatarColor?> avatarColor;
final i0.Value<bool> isAdmin;
final i0.Value<String> oauthId;
final i0.Value<String?> pinCode;
final i0.Value<bool> hasProfileImage;
final i0.Value<DateTime> profileChangedAt;
final i0.Value<int?> quotaSizeInBytes;
final i0.Value<int> quotaUsageInBytes;
final i0.Value<String?> storageLabel;
const AuthUserEntityCompanion({
this.id = const i0.Value.absent(),
this.name = const i0.Value.absent(),
this.email = const i0.Value.absent(),
this.deletedAt = const i0.Value.absent(),
this.avatarColor = const i0.Value.absent(),
this.isAdmin = const i0.Value.absent(),
this.oauthId = const i0.Value.absent(),
this.pinCode = const i0.Value.absent(),
this.hasProfileImage = const i0.Value.absent(),
this.profileChangedAt = const i0.Value.absent(),
this.quotaSizeInBytes = const i0.Value.absent(),
this.quotaUsageInBytes = const i0.Value.absent(),
this.storageLabel = const i0.Value.absent(),
});
AuthUserEntityCompanion.insert({
required String id,
required String name,
required String email,
this.deletedAt = const i0.Value.absent(),
this.avatarColor = const i0.Value.absent(),
this.isAdmin = const i0.Value.absent(),
this.oauthId = const i0.Value.absent(),
this.pinCode = const i0.Value.absent(),
this.hasProfileImage = const i0.Value.absent(),
this.profileChangedAt = const i0.Value.absent(),
this.quotaSizeInBytes = const i0.Value.absent(),
this.quotaUsageInBytes = const i0.Value.absent(),
this.storageLabel = const i0.Value.absent(),
}) : id = i0.Value(id),
name = i0.Value(name),
email = i0.Value(email);
static i0.Insertable<i1.AuthUserEntityData> custom({
i0.Expression<String>? id,
i0.Expression<String>? name,
i0.Expression<String>? email,
i0.Expression<DateTime>? deletedAt,
i0.Expression<int>? avatarColor,
i0.Expression<bool>? isAdmin,
i0.Expression<String>? oauthId,
i0.Expression<String>? pinCode,
i0.Expression<bool>? hasProfileImage,
i0.Expression<DateTime>? profileChangedAt,
i0.Expression<int>? quotaSizeInBytes,
i0.Expression<int>? quotaUsageInBytes,
i0.Expression<String>? storageLabel,
}) {
return i0.RawValuesInsertable({
if (id != null) 'id': id,
if (name != null) 'name': name,
if (email != null) 'email': email,
if (deletedAt != null) 'deleted_at': deletedAt,
if (avatarColor != null) 'avatar_color': avatarColor,
if (isAdmin != null) 'is_admin': isAdmin,
if (oauthId != null) 'oauth_id': oauthId,
if (pinCode != null) 'pin_code': pinCode,
if (hasProfileImage != null) 'has_profile_image': hasProfileImage,
if (profileChangedAt != null) 'profile_changed_at': profileChangedAt,
if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes,
if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes,
if (storageLabel != null) 'storage_label': storageLabel,
});
}
i1.AuthUserEntityCompanion copyWith(
{i0.Value<String>? id,
i0.Value<String>? name,
i0.Value<String>? email,
i0.Value<DateTime?>? deletedAt,
i0.Value<i2.AvatarColor?>? avatarColor,
i0.Value<bool>? isAdmin,
i0.Value<String>? oauthId,
i0.Value<String?>? pinCode,
i0.Value<bool>? hasProfileImage,
i0.Value<DateTime>? profileChangedAt,
i0.Value<int?>? quotaSizeInBytes,
i0.Value<int>? quotaUsageInBytes,
i0.Value<String?>? storageLabel}) {
return i1.AuthUserEntityCompanion(
id: id ?? this.id,
name: name ?? this.name,
email: email ?? this.email,
deletedAt: deletedAt ?? this.deletedAt,
avatarColor: avatarColor ?? this.avatarColor,
isAdmin: isAdmin ?? this.isAdmin,
oauthId: oauthId ?? this.oauthId,
pinCode: pinCode ?? this.pinCode,
hasProfileImage: hasProfileImage ?? this.hasProfileImage,
profileChangedAt: profileChangedAt ?? this.profileChangedAt,
quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes,
quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
storageLabel: storageLabel ?? this.storageLabel,
);
}
@override
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
final map = <String, i0.Expression>{};
if (id.present) {
map['id'] = i0.Variable<String>(id.value);
}
if (name.present) {
map['name'] = i0.Variable<String>(name.value);
}
if (email.present) {
map['email'] = i0.Variable<String>(email.value);
}
if (deletedAt.present) {
map['deleted_at'] = i0.Variable<DateTime>(deletedAt.value);
}
if (avatarColor.present) {
map['avatar_color'] = i0.Variable<int>(i1
.$AuthUserEntityTable.$converteravatarColorn
.toSql(avatarColor.value));
}
if (isAdmin.present) {
map['is_admin'] = i0.Variable<bool>(isAdmin.value);
}
if (oauthId.present) {
map['oauth_id'] = i0.Variable<String>(oauthId.value);
}
if (pinCode.present) {
map['pin_code'] = i0.Variable<String>(pinCode.value);
}
if (hasProfileImage.present) {
map['has_profile_image'] = i0.Variable<bool>(hasProfileImage.value);
}
if (profileChangedAt.present) {
map['profile_changed_at'] = i0.Variable<DateTime>(profileChangedAt.value);
}
if (quotaSizeInBytes.present) {
map['quota_size_in_bytes'] = i0.Variable<int>(quotaSizeInBytes.value);
}
if (quotaUsageInBytes.present) {
map['quota_usage_in_bytes'] = i0.Variable<int>(quotaUsageInBytes.value);
}
if (storageLabel.present) {
map['storage_label'] = i0.Variable<String>(storageLabel.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('AuthUserEntityCompanion(')
..write('id: $id, ')
..write('name: $name, ')
..write('email: $email, ')
..write('deletedAt: $deletedAt, ')
..write('avatarColor: $avatarColor, ')
..write('isAdmin: $isAdmin, ')
..write('oauthId: $oauthId, ')
..write('pinCode: $pinCode, ')
..write('hasProfileImage: $hasProfileImage, ')
..write('profileChangedAt: $profileChangedAt, ')
..write('quotaSizeInBytes: $quotaSizeInBytes, ')
..write('quotaUsageInBytes: $quotaUsageInBytes, ')
..write('storageLabel: $storageLabel')
..write(')'))
.toString();
}
}

View File

@@ -16,10 +16,21 @@ class DeviceAssetEntity {
final List<byte> hash; final List<byte> hash;
final DateTime modifiedTime; final DateTime modifiedTime;
const DeviceAssetEntity({required this.assetId, required this.hash, required this.modifiedTime}); const DeviceAssetEntity({
required this.assetId,
required this.hash,
required this.modifiedTime,
});
DeviceAsset toModel() => DeviceAsset(assetId: assetId, hash: Uint8List.fromList(hash), modifiedTime: modifiedTime); DeviceAsset toModel() => DeviceAsset(
assetId: assetId,
hash: Uint8List.fromList(hash),
modifiedTime: modifiedTime,
);
static DeviceAssetEntity fromDto(DeviceAsset dto) => static DeviceAssetEntity fromDto(DeviceAsset dto) => DeviceAssetEntity(
DeviceAssetEntity(assetId: dto.assetId, hash: dto.hash, modifiedTime: dto.modifiedTime); assetId: dto.assetId,
hash: dto.hash,
modifiedTime: dto.modifiedTime,
);
} }

View File

@@ -17,15 +17,22 @@ const DeviceAssetEntitySchema = CollectionSchema(
name: r'DeviceAssetEntity', name: r'DeviceAssetEntity',
id: 6967030785073446271, id: 6967030785073446271,
properties: { properties: {
r'assetId': PropertySchema(id: 0, name: r'assetId', type: IsarType.string), r'assetId': PropertySchema(
r'hash': PropertySchema(id: 1, name: r'hash', type: IsarType.byteList), id: 0,
name: r'assetId',
type: IsarType.string,
),
r'hash': PropertySchema(
id: 1,
name: r'hash',
type: IsarType.byteList,
),
r'modifiedTime': PropertySchema( r'modifiedTime': PropertySchema(
id: 2, id: 2,
name: r'modifiedTime', name: r'modifiedTime',
type: IsarType.dateTime, type: IsarType.dateTime,
), )
}, },
estimateSize: _deviceAssetEntityEstimateSize, estimateSize: _deviceAssetEntityEstimateSize,
serialize: _deviceAssetEntitySerialize, serialize: _deviceAssetEntitySerialize,
deserialize: _deviceAssetEntityDeserialize, deserialize: _deviceAssetEntityDeserialize,
@@ -42,7 +49,7 @@ const DeviceAssetEntitySchema = CollectionSchema(
name: r'assetId', name: r'assetId',
type: IndexType.hash, type: IndexType.hash,
caseSensitive: true, caseSensitive: true,
), )
], ],
), ),
r'hash': IndexSchema( r'hash': IndexSchema(
@@ -55,13 +62,12 @@ const DeviceAssetEntitySchema = CollectionSchema(
name: r'hash', name: r'hash',
type: IndexType.hash, type: IndexType.hash,
caseSensitive: false, caseSensitive: false,
), )
], ],
), )
}, },
links: {}, links: {},
embeddedSchemas: {}, embeddedSchemas: {},
getId: _deviceAssetEntityGetId, getId: _deviceAssetEntityGetId,
getLinks: _deviceAssetEntityGetLinks, getLinks: _deviceAssetEntityGetLinks,
attach: _deviceAssetEntityAttach, attach: _deviceAssetEntityAttach,
@@ -127,16 +133,12 @@ Id _deviceAssetEntityGetId(DeviceAssetEntity object) {
} }
List<IsarLinkBase<dynamic>> _deviceAssetEntityGetLinks( List<IsarLinkBase<dynamic>> _deviceAssetEntityGetLinks(
DeviceAssetEntity object, DeviceAssetEntity object) {
) {
return []; return [];
} }
void _deviceAssetEntityAttach( void _deviceAssetEntityAttach(
IsarCollection<dynamic> col, IsarCollection<dynamic> col, Id id, DeviceAssetEntity object) {}
Id id,
DeviceAssetEntity object,
) {}
extension DeviceAssetEntityByIndex on IsarCollection<DeviceAssetEntity> { extension DeviceAssetEntityByIndex on IsarCollection<DeviceAssetEntity> {
Future<DeviceAssetEntity?> getByAssetId(String assetId) { Future<DeviceAssetEntity?> getByAssetId(String assetId) {
@@ -187,10 +189,8 @@ extension DeviceAssetEntityByIndex on IsarCollection<DeviceAssetEntity> {
return putAllByIndex(r'assetId', objects); return putAllByIndex(r'assetId', objects);
} }
List<Id> putAllByAssetIdSync( List<Id> putAllByAssetIdSync(List<DeviceAssetEntity> objects,
List<DeviceAssetEntity> objects, { {bool saveLinks = true}) {
bool saveLinks = true,
}) {
return putAllByIndexSync(r'assetId', objects, saveLinks: saveLinks); return putAllByIndexSync(r'assetId', objects, saveLinks: saveLinks);
} }
} }
@@ -207,14 +207,17 @@ extension DeviceAssetEntityQueryWhereSort
extension DeviceAssetEntityQueryWhere extension DeviceAssetEntityQueryWhere
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QWhereClause> { on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QWhereClause> {
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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
@@ -237,7 +240,7 @@ extension DeviceAssetEntityQueryWhere
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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),
@@ -246,7 +249,7 @@ extension DeviceAssetEntityQueryWhere
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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),
@@ -255,124 +258,108 @@ extension DeviceAssetEntityQueryWhere
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
assetIdEqualTo(String assetId) { assetIdEqualTo(String assetId) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause( return query.addWhereClause(IndexWhereClause.equalTo(
IndexWhereClause.equalTo(indexName: r'assetId', value: [assetId]), indexName: r'assetId',
); value: [assetId],
));
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
assetIdNotEqualTo(String assetId) { assetIdNotEqualTo(String assetId) {
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'assetId',
indexName: r'assetId', lower: [],
lower: [], upper: [assetId],
upper: [assetId], includeUpper: false,
includeUpper: false, ))
), .addWhereClause(IndexWhereClause.between(
) indexName: r'assetId',
.addWhereClause( lower: [assetId],
IndexWhereClause.between( includeLower: false,
indexName: r'assetId', upper: [],
lower: [assetId], ));
includeLower: false,
upper: [],
),
);
} else { } else {
return query return query
.addWhereClause( .addWhereClause(IndexWhereClause.between(
IndexWhereClause.between( indexName: r'assetId',
indexName: r'assetId', lower: [assetId],
lower: [assetId], includeLower: false,
includeLower: false, upper: [],
upper: [], ))
), .addWhereClause(IndexWhereClause.between(
) indexName: r'assetId',
.addWhereClause( lower: [],
IndexWhereClause.between( upper: [assetId],
indexName: r'assetId', includeUpper: false,
lower: [], ));
upper: [assetId],
includeUpper: false,
),
);
} }
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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,
),
);
} }
}); });
} }
@@ -381,56 +368,53 @@ extension DeviceAssetEntityQueryWhere
extension DeviceAssetEntityQueryFilter extension DeviceAssetEntityQueryFilter
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QFilterCondition> { on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QFilterCondition> {
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdEqualTo(String value, {bool caseSensitive = true}) { assetIdEqualTo(
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'assetId',
property: r'assetId', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdGreaterThan( assetIdGreaterThan(
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'assetId',
property: r'assetId', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdLessThan( assetIdLessThan(
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.lessThan(
FilterCondition.lessThan( include: include,
include: include, property: r'assetId',
property: r'assetId', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdBetween( assetIdBetween(
String lower, String lower,
String upper, { String upper, {
bool includeLower = true, bool includeLower = true,
@@ -438,181 +422,216 @@ extension DeviceAssetEntityQueryFilter
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'assetId',
property: r'assetId', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdStartsWith(String value, {bool caseSensitive = true}) { assetIdStartsWith(
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'assetId',
property: r'assetId', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdEndsWith(String value, {bool caseSensitive = true}) { assetIdEndsWith(
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'assetId',
property: r'assetId', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdContains(String value, {bool caseSensitive = true}) { assetIdContains(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'assetId',
property: r'assetId', value: value,
value: value, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdMatches(String pattern, {bool caseSensitive = true}) { assetIdMatches(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'assetId',
property: r'assetId', wildcard: pattern,
wildcard: pattern, caseSensitive: caseSensitive,
caseSensitive: caseSensitive, ));
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdIsEmpty() { assetIdIsEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'assetId', value: ''), property: r'assetId',
); value: '',
));
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdIsNotEmpty() { assetIdIsNotEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.greaterThan(
FilterCondition.greaterThan(property: r'assetId', value: ''), property: r'assetId',
); value: '',
));
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
hashLengthEqualTo(int length) {
return QueryBuilder.apply(this, (query) {
return query.listLength(
r'hash',
length,
true,
length,
true,
); );
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
hashLengthGreaterThan(int length, {bool include = false}) { hashLengthBetween(
return QueryBuilder.apply(this, (query) {
return query.listLength(r'hash', length, include, 999999, true);
});
}
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
hashLengthBetween(
int lower, int lower,
int upper, { int upper, {
bool includeLower = true, bool includeLower = true,
@@ -630,112 +649,114 @@ extension DeviceAssetEntityQueryFilter
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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, ));
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
modifiedTimeEqualTo(DateTime value) { modifiedTimeEqualTo(DateTime value) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition( return query.addFilterCondition(FilterCondition.equalTo(
FilterCondition.equalTo(property: r'modifiedTime', value: value), property: r'modifiedTime',
); value: value,
));
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
modifiedTimeGreaterThan(DateTime value, {bool include = false}) { modifiedTimeGreaterThan(
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'modifiedTime',
property: r'modifiedTime', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
modifiedTimeLessThan(DateTime value, {bool include = false}) { modifiedTimeLessThan(
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'modifiedTime',
property: r'modifiedTime', value: value,
value: value, ));
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
modifiedTimeBetween( modifiedTimeBetween(
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'modifiedTime',
property: r'modifiedTime', lower: lower,
lower: lower, includeLower: includeLower,
includeLower: includeLower, upper: upper,
upper: upper, includeUpper: includeUpper,
includeUpper: includeUpper, ));
),
);
}); });
} }
} }
@@ -749,28 +770,28 @@ extension DeviceAssetEntityQueryLinks
extension DeviceAssetEntityQuerySortBy extension DeviceAssetEntityQuerySortBy
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QSortBy> { on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QSortBy> {
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
sortByAssetId() { sortByAssetId() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'assetId', Sort.asc); return query.addSortBy(r'assetId', Sort.asc);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
sortByAssetIdDesc() { sortByAssetIdDesc() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'assetId', Sort.desc); return query.addSortBy(r'assetId', Sort.desc);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
sortByModifiedTime() { sortByModifiedTime() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'modifiedTime', Sort.asc); return query.addSortBy(r'modifiedTime', Sort.asc);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
sortByModifiedTimeDesc() { sortByModifiedTimeDesc() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'modifiedTime', Sort.desc); return query.addSortBy(r'modifiedTime', Sort.desc);
}); });
@@ -780,14 +801,14 @@ extension DeviceAssetEntityQuerySortBy
extension DeviceAssetEntityQuerySortThenBy extension DeviceAssetEntityQuerySortThenBy
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QSortThenBy> { on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QSortThenBy> {
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
thenByAssetId() { thenByAssetId() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'assetId', Sort.asc); return query.addSortBy(r'assetId', Sort.asc);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
thenByAssetIdDesc() { thenByAssetIdDesc() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'assetId', Sort.desc); return query.addSortBy(r'assetId', Sort.desc);
}); });
@@ -800,21 +821,21 @@ extension DeviceAssetEntityQuerySortThenBy
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, 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);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
thenByModifiedTime() { thenByModifiedTime() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'modifiedTime', Sort.asc); return query.addSortBy(r'modifiedTime', Sort.asc);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
thenByModifiedTimeDesc() { thenByModifiedTimeDesc() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'modifiedTime', Sort.desc); return query.addSortBy(r'modifiedTime', Sort.desc);
}); });
@@ -824,21 +845,21 @@ extension DeviceAssetEntityQuerySortThenBy
extension DeviceAssetEntityQueryWhereDistinct extension DeviceAssetEntityQueryWhereDistinct
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct> { on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct> {
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct>
distinctByAssetId({bool caseSensitive = true}) { distinctByAssetId({bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'assetId', caseSensitive: caseSensitive); return query.addDistinctBy(r'assetId', caseSensitive: caseSensitive);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct>
distinctByHash() { distinctByHash() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'hash'); return query.addDistinctBy(r'hash');
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct>
distinctByModifiedTime() { distinctByModifiedTime() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'modifiedTime'); return query.addDistinctBy(r'modifiedTime');
}); });
@@ -866,7 +887,7 @@ extension DeviceAssetEntityQueryProperty
} }
QueryBuilder<DeviceAssetEntity, DateTime, QQueryOperations> QueryBuilder<DeviceAssetEntity, DateTime, QQueryOperations>
modifiedTimeProperty() { modifiedTimeProperty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'modifiedTime'); return query.addPropertyName(r'modifiedTime');
}); });

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