Compare commits

...

80 Commits

Author SHA1 Message Date
mertalev
03c820931e commit json 2025-07-30 19:53:55 -04:00
mertalev
6cea779b2d optimizations 2025-07-30 19:30:42 -04:00
wuzihao051119
196f2a72f4 temporary change for stress test 2025-07-30 11:37:38 -04:00
wuzihao051119
7f9bc092ac remove locked and favorite 2025-07-30 11:37:38 -04:00
wuzihao051119
dc807777d6 clean code 2025-07-30 11:37:38 -04:00
wuzihao051119
6ad2e8e155 remove ref listen and global key 2025-07-30 11:37:38 -04:00
wuzihao051119
e6c46fe0bf chore: rename 2025-07-30 11:37:38 -04:00
wuzihao051119
749582b6d8 fix: refresh timeline by key 2025-07-30 11:37:38 -04:00
wuzihao051119
94c073e58f perf: do not filter markers 2025-07-30 11:37:38 -04:00
wuzihao051119
5d722eef98 refactor: map query 2025-07-30 11:37:38 -04:00
wuzihao051119
d308d023c2 feat(mobile): drift map page 2025-07-30 11:37:38 -04:00
shenlong
da5deffd03 fix: exclude assets from excluded albumbs on main timeline (#20425)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-30 10:16:23 -05:00
shenlong
9f20522df5 chore: add isFavorite to PlatformAsset in duplicate check (#20427)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-30 08:44:19 -05:00
Ben
baadf9db20 fix(web): timeline date group width (#19964)
Fix the calculation for the date group width, so there's never a scenario where photos will be hidden. On mobile devices, photos in the second row can sometimes have a top of <100px, which throws off the calculation of the date group width.
2025-07-30 08:39:19 -04:00
xCJPECKOVERx
4ea4ee40af fix(web): Search chip key value heights don't match (#20312)
- add flex items-stretch to stretch chip key height to match value height
2025-07-30 08:31:16 -04:00
renovate[bot]
d8a6552811 chore(deps): update ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0 docker digest to 32324a2 (#20381)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-30 08:29:37 -04:00
renovate[bot]
444133a72b chore(deps): update ghcr.io/immich-app/postgres:14-vectorchord0.3.0 docker digest to 0e763a2 (#20380)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-30 10:36:50 +00:00
Alex
29f16c6a47 feat: people page/sheet/detail (#20309) 2025-07-30 03:07:53 +00:00
shenlong
268b411a6f fix: sync is_favorite from native (#20412)
* feat: sync is_favorite from native

* handle favorite during upload

* Update mobile/ios/Runner/Sync/MessagesImpl.swift

Co-authored-by: Alex <alex.tran1502@gmail.com>

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex <alex.tran1502@gmail.com>
2025-07-29 21:57:04 -05:00
Brandon Wees
07ed060c32 feat: 3-2-1 backup onboarding card (#20374)
* feat: 3-2-1 backup onboarding card

* chore: format i18n

* fix: lint

* Update onboarding-backup.svelte

* fix: e2e onboarding test
2025-07-29 21:55:21 -05:00
Jason Rasmussen
2f5d543ad9 fix: tweak error docs (#20417) 2025-07-29 21:33:24 +00:00
Jason Rasmussen
9b65cd4d7b feat!: remove typeorm (#20366)
feat: remove typeorm
2025-07-29 17:28:02 -04:00
Brandon Wees
290e325c5c feat: drift description editor (#20383)
* feat: drift description editor

* chore: use focus node

* chore: code review fixes

* chore: move description update to action.service

* refactor

* refactor

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
2025-07-29 21:17:33 +00:00
Jason Rasmussen
58521c9efb feat: change default media location to /data (#20367)
* feat!: change default media location to /data

* feat: dynamically detect media location
2025-07-29 16:58:50 -04:00
Andrew Marshall
4cae15f28d feat: support config via systemd credentials (#20406)
feat: Support config via Systemd Credentials

See https://systemd.io/CREDENTIALS/. This is used as a fallback, so will
only be used if the `$*_FILE` var is empty. This could also be used to
implicitly use Docker Secrets by settings
`CREDENTIALS_DIRECTORY=/run/secrets` rather than setting individual
`$_*FILE` environment variables.
2025-07-29 16:43:11 -04:00
shenlong
e6ec019852 fix: show missing local assets only in timeline with partner sharing (#20298)
fix: show missing local assets in timeline with partner sharing

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex <alex.tran1502@gmail.com>
2025-07-29 10:05:04 -05:00
Brandon Wees
3b5e00131b fix: android widget periodic updates (#20389)
* fix: android widget updates

* ensure periodic work is queued when we receive an update

This will not "reset the clock" on the periodic work since we are using         ExistingPeriodicWorkPolicy.UPDATE. This is needed since existing widgets have already been asked to queue their workers. If those periodic workers were overwritten by a widget update request from the app, there is no way to queue them again. onReceive gets run when the app requests a widget update so the periodic workers will get queued again.
2025-07-29 08:59:10 -05:00
Zack Pollard
a0fa7318ed fix: handle cleanup of new backups alongside old backups (#20402) 2025-07-29 13:28:10 +01:00
Zack Pollard
2a005629a0 chore: bump minimum eslint-config-prettier version due to MAL-2025-6022 (#20400) 2025-07-29 11:23:52 +00:00
renovate[bot]
59a50b8697 chore(deps): update github-actions (#20384)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-29 12:07:14 +01:00
renovate[bot]
90eac40e02 chore(deps): update terraform cloudflare to v4.52.1 (#20387)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-29 12:06:52 +01:00
Andreas Petersson
ad6f7f8089 docs: add immich_ml_balancer to community projects (#20399) 2025-07-29 12:02:37 +01:00
renovate[bot]
056b262cba chore(deps): update dependency @types/node to ^22.16.5 (#20385)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-29 11:48:26 +02:00
renovate[bot]
cfae134ecf fix(deps): update typescript-projects (#20388)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
2025-07-29 09:47:30 +00:00
Jason Rasmussen
fbbb6af27a chore: update open-api (#20376) 2025-07-28 19:56:22 -05:00
Brandon Wees
1804a8fe58 fix: openapi spec (#20378) 2025-07-28 23:46:34 +00:00
Alwin Lohrie
ae1d60e259 feat: find large files utility (#18040)
feat: large asset utility

Co-authored-by: Jason Rasmussen <jason@rasm.me>
2025-07-28 18:48:39 -04:00
Jason Rasmussen
7d759edfcc chore: add permission metadata to open-api document (#20373) 2025-07-28 18:40:34 -04:00
shenlong
34974b036c fix: handle back gesture in multi selection mode (#20356)
* fix: handle back gesture in multi selection mode

# Conflicts:
#	mobile/lib/presentation/widgets/timeline/timeline.widget.dart

* remove null-aware element because Isar

* chore: set sqlite busy_timeout to 500ms (#20358)

fix: add busy_timeout pragma

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-28 19:22:50 +00:00
shenlong
e52b9d15b5 chore: bump dart sdk to 3.8 (#20355)
* chore: bump dart sdk to 3.8

* chore: make build

* make pigeon

* chore: format files

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-28 14:04:03 -05:00
Jed-Giblin
9b3718120b feat: shared links custom URL (#19999)
* feat: custom url for shared links

* feat: use a separate route and query param

---------

Co-authored-by: Jason Rasmussen <jason@rasm.me>
2025-07-28 14:16:55 -04:00
Jason Rasmussen
16b14b390f fix: file samples (#20364) 2025-07-28 13:30:49 -04:00
Jason Rasmussen
7e7b8da128 fix: debug source maps (#20363) 2025-07-28 12:41:22 -04:00
Dag Stuan
66ea75072d feat(web): auto fit bounds for map modal (#20345) 2025-07-28 17:36:37 +01:00
Sergey Katsubo
d34670bae6 feat(server): include reason in null reverse geocoding logs (#20347)
* Clarify in log why reverse geocoding may return nothing

* Decrease log level for empty reverse geocoding response from warn to log

* Use a named constant for 25km

* Mention fallback to countries in the message

* Improve natural earth log message

* Decrease log level for empty reverse geocoding response from natural earth countries
2025-07-28 08:51:00 -05:00
shenlong
1e1c2ea627 fix: backup indicator in beta app bar (#20354)
fix: beta - app bar backup indicator

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-28 08:50:50 -05:00
Sergey Katsubo
c7fcb23a23 chore(docs): add links to custom scan interval from other sections in external library doc (#20353) 2025-07-28 13:42:59 +01:00
shenlong
708e42d8a3 fix: change translation key for archive action button (#20336)
* chore: change translation key for archive action button

* chore: await navigation before emitting event

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-27 17:43:23 +00:00
Alex
d15f67da5d feat: scroll to top & view in timeline (#20274)
* feat: scroll to top & view in timeline

* use EventStream

* refactor: event invocation and listerner

* fix: correct parent routing
2025-07-27 21:48:32 +05:30
Matthew Momjian
6becf409da feat(docs): reorganize DB queries, add tags (#20303)
* reorganize

* fix checksum
2025-07-27 10:03:58 -05:00
xCJPECKOVERx
ee4ae40d61 fix(web): Album picker recent albums don't match sidebar (#20313)
- update album picker recent albums to show most recent 'updatedAt' instead of 'createdAt'. Matches sidebar.
2025-07-27 10:03:39 -05:00
Matthew Momjian
ebd644eedd fix(docs): update SQL queries with schema changes (#20297)
* sql queries with table changes

* fix linting
2025-07-26 17:38:12 -05:00
shenlong
7c36cbaf0f fix: error on navigating back from backup selection page (#20299)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-26 13:58:27 -05:00
Alex
3a5d82f790 chore: delete action button (#20261) 2025-07-26 13:51:18 -05:00
Alex
b14c768208 fix: share to app upload (#20271) 2025-07-26 11:42:24 -05:00
Alex
07cb2fb04e fix: remainder backup count (#20270) 2025-07-26 09:02:26 -05:00
Alexandre Garnier
9bbad45990 fix(mobile): remove unused translation and pluralize existing one for map photos count (#20282) 2025-07-26 09:00:35 -05:00
shenlong
e85655d34c fix: no hero animation after tab change (#20285)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-26 08:59:26 -05:00
shenlong
d0576697c3 chore: upgrade flutter to 3.32.8 (#20287)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-26 08:58:48 -05:00
Yaros
f9847bee51 fix(mobile): places search not working in beta version (#20284)
fix(mobile): places search not working
2025-07-26 17:00:57 +05:30
beposec
f2141de5bb fix(mobile): Fix a typo in SyncStreamService Logging (#20283)
Fix typo in logging
2025-07-26 11:29:42 +00:00
Alexandre Garnier
cb344cb014 fix(mobile): distinguish backup settings title from 'backup_controller_page_backup' translation entry (#20237)
Different translation in some languages like in French ('Sauvegarde' for title, otherwise 'Sauvegardé')
2025-07-25 18:07:59 -05:00
Jason Rasmussen
c6b25ef111 feat: automatically detect media location changes (#20256) 2025-07-25 15:25:36 -04:00
Jason Rasmussen
0fdeac0417 feat!: more permissions (#20250)
feat: more api key permissions
2025-07-25 15:25:23 -04:00
Jason Rasmussen
153bb70f6e feat(web): api key permission search (#20248) 2025-07-25 13:39:48 -04:00
Brandon Wees
da80b69062 fix(mobile): beta search page improvements (#20247)
search page improvements
2025-07-25 12:24:19 -05:00
Brandon Wees
f9292c9c96 fix(mobile): deep links when using the beta timeline (#20111)
* fix: deep links when using the beta timeline

* Update remote_asset.repository.dart

* Update mobile/lib/domain/services/asset.service.dart

Co-authored-by: Alex <alex.tran1502@gmail.com>

* return optional from album get

* do not include trashed assets in album asset count

Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com>

* formatting

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com>
2025-07-25 17:02:49 +00:00
Zack Pollard
2e0ee6ec05 feat: don't wait for network on app startup (#20232) 2025-07-25 11:19:50 -05:00
Zack Pollard
7f2e4f85f8 fix: lookup the primary key constraint name before dropping it (#20221) 2025-07-25 16:51:22 +01:00
Brandon Wees
c63f805cb4 fix: word wrapping on action buttons (#20231) 2025-07-25 15:10:01 +00:00
Alex
03a13828e1 chore: refactor upload service (#20130)
* chore: refactor upload service

* fix: cancel upload queue on logout (#20131)

* fix: cancel upload on logout

* fix: test

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex <alex.tran1502@gmail.com>

---------

Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com>
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-25 10:09:32 -05:00
Jeremy Fleischman
e5ee1c8db6 chore: add missing 'make pigeon' instruction (#20202)
* chore: fix typo 'make_build' -> 'make build'

* chore: add missing 'make pigeon' instruction

Turns out I was getting bit by forgetting to run `make pigeon`, which
also generates files. Perhaps it would be better to make it part of
`make build`?

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
2025-07-25 15:05:40 +00:00
Daimolean
25e2d37490 fix(server): use UserMetadataKey enum instead of string (#20209)
* fix(server): use UserMetadataKey enum instead of string

* fix: mobile
2025-07-25 11:04:28 -04:00
Alex
ed5759fe07 fix: character width calculation (#20201) 2025-07-25 09:56:25 -05:00
Daniel Dietzler
edefed56ae fix: optional number inputs (#20218) 2025-07-25 09:06:12 -04:00
shenlong
13281f8531 docs: more make commands and add mobile checks to pr-checklist (#20211)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-25 13:24:08 +01:00
Zack Pollard
b48406bd20 fix: android backup album migration losing selection (#20220) 2025-07-25 12:57:31 +01:00
Brandon Wees
06c78dfa91 feat: add to album on new beta timeline (#20119)
* feat: add to album on new beta timeline

* handle add album button

* tune

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
2025-07-25 01:10:33 -05:00
Jeremy Fleischman
de67d22bc0 fix: add missing awaits when changing client certificate (#20189)
I ran into this while testing out
<https://github.com/immich-app/immich/pull/19830>. When I add, change,
or remove a client certificate under Immich's advanced settings, the
change wouldn't take effect until some mysterious point in the future.
For example:

1. Add a client certificate. It doesn't get used.
2. Remove certificate. *Now* the client certificate from step 1) is used.
3. Restart application. Now no client certificate is used.

This all boils down to some missing `await`s. The user would change the
cert, and we'd start asynchronously saving it to the store, and while
the save is still happening, [`HttpSSLOptions` pulls the "old" value out of
`SSLClientCertStoreVal`](https://github.com/immich-app/immich/blob/v1.136.0/mobile/lib/utils/http_ssl_options.dart#L30).

With the appropriate `await`s, this behaves much more sanely.
2025-07-25 00:28:33 -05:00
shenlong
b4780e89af fix: add beta toggle in landscape mode (#20187)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-25 00:28:21 -05:00
1076 changed files with 47326 additions and 43638 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:/usr/src/app/upload - ${UPLOAD_LOCATION}/photos:/data
- ${UPLOAD_LOCATION}/photos/upload:/usr/src/app/upload - ${UPLOAD_LOCATION}/photos/upload:/data/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}:/usr/src/app/upload - ${UPLOAD_LOCATION:-upload1-devcontainer-volume}${UPLOAD_LOCATION:+/photos}:/data
- ${UPLOAD_LOCATION:-upload2-devcontainer-volume}${UPLOAD_LOCATION:+/photos/upload}:/usr/src/app/upload/upload - ${UPLOAD_LOCATION:-upload2-devcontainer-volume}${UPLOAD_LOCATION:+/photos/upload}:/data/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@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 uses: github/codeql-action/init@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
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@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 uses: github/codeql-action/autobuild@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
# 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@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 uses: github/codeql-action/analyze@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
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 inside the mobile directory" echo "ERROR: Generated files not up to date! Run 'make build' and 'make pigeon' inside the mobile directory"
echo "Changed files: ${CHANGED_FILES}" echo "Changed files: ${CHANGED_FILES}"
exit 1 exit 1
@@ -98,8 +98,7 @@ jobs:
run: dart analyze --fatal-infos run: dart analyze --fatal-infos
- name: Run dart format - name: Run dart format
# Ignore generated files manually until https://github.com/dart-lang/dart_style/issues/864 is resolved run: make format
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
@@ -130,7 +129,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload SARIF file - name: Upload SARIF file
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 uses: github/codeql-action/upload-sarif@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
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:1f5583fe3397210a0fbc7f11b0cec18bacc4a99e3e8ea0548e9bd6bcf26ec37a image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3@sha256:ec713143dca1a426eba2e03707c319e2ec3cc9d304ef767f777f8e297dee820c
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@48b6133aa6c826f267ebd33aa2d29470f9d9e7d0 # v1.9.0 uses: juliangruber/find-pull-request-action@952b3bb1ddb2dcc0aa3479e98bb1c2d1a922f096 # v1.10.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", "remoteRoot": "/usr/src/app/server",
"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", "remoteRoot": "/usr/src/app/server",
"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.4", "@types/node": "^22.16.5",
"@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.0.0", "eslint-config-prettier": "^10.1.8",
"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.4", "@types/node": "^22.16.5",
"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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.38.0.tgz",
"integrity": "sha512-jsuVWeIkb6ggzB+wPCsR4e6loj+rM72ohW6IBn2C+5NCvfUVY8s33iFPySSVXqtm5Hu29Ne/9bnA0JmyLmgenA==", "integrity": "sha512-CPoznzpuAnIOl4nhj4tRr4gIPj5AfKgkiJmGQDaq+fQnRJTYlcBjbX3wbciGmpoPf8DREufuPRe1tNMZnGdanA==",
"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.37.0", "@typescript-eslint/scope-manager": "8.38.0",
"@typescript-eslint/type-utils": "8.37.0", "@typescript-eslint/type-utils": "8.38.0",
"@typescript-eslint/utils": "8.37.0", "@typescript-eslint/utils": "8.38.0",
"@typescript-eslint/visitor-keys": "8.37.0", "@typescript-eslint/visitor-keys": "8.38.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.37.0", "@typescript-eslint/parser": "^8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.38.0.tgz",
"integrity": "sha512-kVIaQE9vrN9RLCQMQ3iyRlVJpTiDUY6woHGb30JDkfJErqrQEmtdWH3gV0PBAfGZgQXoqzXOO0T3K6ioApbbAA==", "integrity": "sha512-Zhy8HCvBUEfBECzIl1PKqF4p11+d0aUJS1GeUiuqK9WmOug8YCmC4h4bjyBvMyAMI9sbRczmrYL5lKg/YMbrcQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "8.37.0", "@typescript-eslint/scope-manager": "8.38.0",
"@typescript-eslint/types": "8.37.0", "@typescript-eslint/types": "8.38.0",
"@typescript-eslint/typescript-estree": "8.37.0", "@typescript-eslint/typescript-estree": "8.38.0",
"@typescript-eslint/visitor-keys": "8.37.0", "@typescript-eslint/visitor-keys": "8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.38.0.tgz",
"integrity": "sha512-BIUXYsbkl5A1aJDdYJCBAo8rCEbAvdquQ8AnLb6z5Lp1u3x5PNgSSx9A/zqYc++Xnr/0DVpls8iQ2cJs/izTXA==", "integrity": "sha512-dbK7Jvqcb8c9QfH01YB6pORpqX1mn5gDZc9n63Ak/+jD67oWXn3Gs0M6vddAN+eDXBCS5EmNWzbSxsn9SzFWWg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.37.0", "@typescript-eslint/tsconfig-utils": "^8.38.0",
"@typescript-eslint/types": "^8.37.0", "@typescript-eslint/types": "^8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.38.0.tgz",
"integrity": "sha512-0vGq0yiU1gbjKob2q691ybTg9JX6ShiVXAAfm2jGf3q0hdP6/BruaFjL/ManAR/lj05AvYCH+5bbVo0VtzmjOA==", "integrity": "sha512-WJw3AVlFFcdT9Ri1xs/lg8LwDqgekWXWhH3iAF+1ZM+QPd7oxQ6jvtW/JPwzAScxitILUIFs0/AnQ/UWHzbATQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.37.0", "@typescript-eslint/types": "8.38.0",
"@typescript-eslint/visitor-keys": "8.37.0" "@typescript-eslint/visitor-keys": "8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.38.0.tgz",
"integrity": "sha512-1/YHvAVTimMM9mmlPvTec9NP4bobA1RkDbMydxG8omqwJJLEW/Iy2C4adsAESIXU3WGLXFHSZUU+C9EoFWl4Zg==", "integrity": "sha512-Lum9RtSE3EroKk/bYns+sPOodqb2Fv50XOl/gMviMKNvanETUuUcC9ObRbzrJ4VSd2JalPqgSAavwrPiPvnAiQ==",
"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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.38.0.tgz",
"integrity": "sha512-SPkXWIkVZxhgwSwVq9rqj/4VFo7MnWwVaRNznfQDc/xPYHjXnPfLWn+4L6FF1cAz6e7dsqBeMawgl7QjUMj4Ow==", "integrity": "sha512-c7jAvGEZVf0ao2z+nnz8BUaHZD09Agbh+DY7qvBQqLiz8uJzRgVPj5YvOh8I8uEiH8oIUGIfHzMwUcGVco/SJg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.37.0", "@typescript-eslint/types": "8.38.0",
"@typescript-eslint/typescript-estree": "8.37.0", "@typescript-eslint/typescript-estree": "8.38.0",
"@typescript-eslint/utils": "8.37.0", "@typescript-eslint/utils": "8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.38.0.tgz",
"integrity": "sha512-ax0nv7PUF9NOVPs+lmQ7yIE7IQmAf8LGcXbMvHX5Gm+YJUYNAl340XkGnrimxZ0elXyoQJuN5sbg6C4evKA4SQ==", "integrity": "sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==",
"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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.38.0.tgz",
"integrity": "sha512-zuWDMDuzMRbQOM+bHyU4/slw27bAUEcKSKKs3hcv2aNnc/tvE/h7w60dwVw8vnal2Pub6RT1T7BI8tFZ1fE+yg==", "integrity": "sha512-fooELKcAKzxux6fA6pxOflpNS0jc+nOQEEOipXFNjSlBS6fqrJOVY/whSn70SScHrcJ2LDsxWrneFoWYSVfqhQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/project-service": "8.37.0", "@typescript-eslint/project-service": "8.38.0",
"@typescript-eslint/tsconfig-utils": "8.37.0", "@typescript-eslint/tsconfig-utils": "8.38.0",
"@typescript-eslint/types": "8.37.0", "@typescript-eslint/types": "8.38.0",
"@typescript-eslint/visitor-keys": "8.37.0", "@typescript-eslint/visitor-keys": "8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.38.0.tgz",
"integrity": "sha512-TSFvkIW6gGjN2p6zbXo20FzCABbyUAuq6tBvNRGsKdsSQ6a7rnV6ADfZ7f4iI3lIiXc4F4WWvtUfDw9CJ9pO5A==", "integrity": "sha512-hHcMA86Hgt+ijJlrD8fX0j1j8w4C92zue/8LOPAFioIno+W0+L7KqE8QZKCcPGc/92Vs9x36w/4MPTJhqXdyvg==",
"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.37.0", "@typescript-eslint/scope-manager": "8.38.0",
"@typescript-eslint/types": "8.37.0", "@typescript-eslint/types": "8.38.0",
"@typescript-eslint/typescript-estree": "8.37.0" "@typescript-eslint/typescript-estree": "8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.38.0.tgz",
"integrity": "sha512-YzfhzcTnZVPiLfP/oeKtDp2evwvHLMe0LOy7oe+hb9KKIumLNohYS9Hgp1ifwpu42YWxhZE8yieggz6JpqO/1w==", "integrity": "sha512-pWrTcoFNWuwHlA9CvlfSsGWs14JxfN1TH25zM5L7o0pRLhsoZkDnTsXfQRJBEWJoV5DL0jf+Z+sxiud+K0mq1g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.37.0", "@typescript-eslint/types": "8.38.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.5", "version": "10.1.8",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz",
"integrity": "sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw==", "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==",
"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.1", "version": "5.5.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.3.tgz",
"integrity": "sha512-dobTkHT6XaEVOo8IO90Q4DOSxnm3Y151QxPJlM/vKC0bVy+d6cVWQZLlFiuZPP0wS6vZwSKeJgKkcS+KfMBlRw==", "integrity": "sha512-NAdMYww51ehKfDyDhv59/eIItUVzU0Io9H2E8nHNGKEeeqlnci+1gCvrHib6EmZdf6GxF+LCV5K7UC65Ezvw7w==",
"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.1.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.1.0.tgz", "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.2.0.tgz",
"integrity": "sha512-5aWRdCgv645xaa58X8lOxzZoiHAldAPChljr/MT0crXVOWTZ+Svl4hIWlz+niYSlO6ikE5UXkN1JrRvIP2ut0A==", "integrity": "sha512-Zdy27UhlmyvATZi67BTnLcKTo8fm6Oik59Sz6H64PgZJVs6NJpPD1mT240mmJn62c98/QaL+r3kx9Q3gRpDajg==",
"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" "vue-tsc": "^2.1.0 || 3"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"vue-tsc": { "vue-tsc": {
@@ -4139,16 +4139,16 @@
} }
}, },
"node_modules/typescript-eslint": { "node_modules/typescript-eslint": {
"version": "8.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.37.0.tgz", "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.38.0.tgz",
"integrity": "sha512-TnbEjzkE9EmcO0Q2zM+GE8NQLItNAJpMmED1BdgoBMYNdqMhzlbqfdSwiRlAzEK2pA9UzVW0gzaaIzXWg2BjfA==", "integrity": "sha512-FsZlrYK6bPDGoLeZRuvx2v6qrM03I0U0SnfCLPs/XCCPCFD80xU9Pg09H/K+XFa68uJuZo7l/Xhs+eDRg2l3hg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/eslint-plugin": "8.37.0", "@typescript-eslint/eslint-plugin": "8.38.0",
"@typescript-eslint/parser": "8.37.0", "@typescript-eslint/parser": "8.38.0",
"@typescript-eslint/typescript-estree": "8.37.0", "@typescript-eslint/typescript-estree": "8.38.0",
"@typescript-eslint/utils": "8.37.0" "@typescript-eslint/utils": "8.38.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.4", "@types/node": "^22.16.5",
"@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.0.0", "eslint-config-prettier": "^10.1.8",
"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.0" version = "4.52.1"
constraints = "4.52.0" constraints = "4.52.1"
hashes = [ hashes = [
"h1:2BEJyXJtYC4B4nda/WCYUmuJYDaYk88F8t1pwPzr0iQ=", "h1:2lHvafwGbLdmc9lYkuJFw3nsInaQjRpjX/JfIRKmq/M=",
"h1:4IASk5SESeWKQ7JU0+M7KApuF5mZyklvwMXPBabim3c=", "h1:596JomwjrtUrOSreq9NNCS+rj70+jOV+0pfja5MXiTI=",
"h1:5ImZxxALSnWfH/4EXw/wFirSmk5Tr0ACmcysy51AafE=", "h1:7mBOA5TVAIt3qAwPXKCtE0RSYeqij9v30mnksuBbpEg=",
"h1:6TJ3dxLSin4ZKBJLsZDn95H2ZYnGm8S7GGHvvXuuMQU=", "h1:ELVgzh4kHKBCYdL+2A8JjWS0E1snLUN3Mmz3Vo6qSfw=",
"h1:IzTUjg9kQ4N3qizP9CjYLeHwjsuGgtxwXvfUQWyOLcA=", "h1:FGGM5yLFf72g3kSXM3LAN64Gf/AkXr5WCmhixgnP+l4=",
"h1:NTaOQfYINA0YTG/V1/9+SYtgX1it63+cBugj4WK4FWc=", "h1:JupkJbQALcIVoMhHImrLeLDsQR1ET7VJLGC7ONxjqGU=",
"h1:PXH48LuJn329sCfMXprdMDk51EZaWFyajVvS03qhQLs=", "h1:KsaE4JNq+1uV1nJsuTcYar/8lyY6zKS5UBEpfYg3wvc=",
"h1:Pi5M+GeoMSN2eJ6QnIeXjBf19O+rby/74CfB2ocpv20=", "h1:NHZ5RJIzQDLhie/ykl3uI6UPfNQR9Lu5Ti7JPR6X904=",
"h1:ShXZ2ZjBvm3thfoPPzPT8+OhyismnydQVkUAfI8X12w=", "h1:NfAuMbn6LQPLDtJhbzO1MX9JMIGLMa8K6CpekvtsuX8=",
"h1:WQ9hu0Wge2msBbODfottCSKgu8oKUrw4Opz+fDPVVHk=", "h1:e+vNKokamDsp/kJvFr2pRudzwEz2r49iZ/oSggw+1LY=",
"h1:Z5yXML2DE0uH9UU+M0ut9JMQAORcwVZz1CxBHzeBmao=", "h1:jnb4VdfNZ79I3yj7Q8x+JmOT+FxbfjjRfrF0dL0yCW8=",
"h1:jqI2qKknpleS3JDSplyGYHMu0u9K/tor1ZOjFwDgEMk=", "h1:kmF//O539d7NuHU7qIxDj7Wz4eJmLKFiI5glwQivldU=",
"h1:kgfutDh14Q5nw4eg6qGFamFxIiY8Ae0FPKRBLDOzpcI=", "h1:s6XriaKwOgV4jvKAGPXkrxhhOQxpNU5dceZwi9Z/1k8=",
"h1:zCAO7GZmfYhWb+i6TfqlqhMeDyPZWGio2IzEzAh3YTs=", "h1:wt3WBEBAeSGTlC9OlnTlAALxRiK4SQgLy0KgBIS7qzs=",
"zh:19be1a91c982b902c42aba47766860dfa5dc151eed1e95fd39ca642229381ef0", "zh:2fb95e1d3229b9b6c704e1a413c7481c60f139780d9641f657b6eb9b633b90f2",
"zh:1de451c4d1ecf7efbe67b6dace3426ba810711afdd644b0f1b870364c8ae91f8", "zh:379c7680983383862236e9e6e720c3114195c40526172188e88d0ffcf50dfe2e",
"zh:352b4a2120173298622e669258744554339d959ac3a95607b117a48ee4a83238", "zh:55533beb6cfc02d22ffda8cba8027bc2c841bb172cd637ed0d28323d41395f8f",
"zh:3c6f1346d9154afbd2d558fabb4b0150fc8d559aa961254144fe1bc17fe6032f", "zh:5abd70760e4eb1f37a1c307cbd2989ea7c9ba0afb93818c67c1d363a31f75703",
"zh:4c4c92d53fb535b1e0eff26f222bbd627b97d3b4c891ec9c321268676d06152f", "zh:699f1c8cd66129176fe659ebf0e6337632a8967a28d2630b6ae5948665c0c2ae",
"zh:53276f68006c9ceb7cdb10a6ccf91a5c1eadd1407a28edb5741e84e88d7e29e8", "zh:69c15acd73c451e89de6477059cda2f3ec200b48ae4b9ff3646c4d389fd3205e",
"zh:7925a97773948171a63d4f65bb81ee92fd6d07a447e36012977313293a5435c9", "zh:6e02b687de21b844f8266dff99e93e7c61fc8eb688f4bbb23803caceb251839e",
"zh:7dfb0a4496cfe032437386d0a2cd9229a1956e9c30bd920923c141b0f0440060", "zh:7a51d17b87ed87b7bebf2ad9fc7c3a74f16a1b44eee92c779c08eb89258c0496",
"zh:88ad84436837b0f55302f22748505972634e87400d6902260fd6b7ba1610f937",
"zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f", "zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f",
"zh:8d4aa79f0a414bb4163d771063c70cd991c8fac6c766e685bac2ee12903c5bd6", "zh:8d46c3d9f4f7ad20ac6ef01daa63f4e30a2d16dcb1bb5c7c7ee3dc6be38e9ca1",
"zh:a67540c13565616a7e7e51ee9366e88b0dc60046e1d75c72680e150bd02725bb", "zh:913d64e72a4929dae1d4793e2004f4f9a58b138ea337d9d94fa35cafbf06550a",
"zh:a936383a4767f5393f38f622e92bf2d0c03fe04b69c284951f27345766c7b31b", "zh:c8d93cf86e2e49f6cec665cfe78b82c144cce15a8b2e30f343385fadd1251849",
"zh:d4887d73c466ff036eecf50ad6404ba38fd82ea4855296b1846d244b0f13c380", "zh:cc4f69397d9bc34a528a5609a024c3a48f54f21616c0008792dd417297add955",
"zh:e9093c8bd5b6cd99c81666e315197791781b8f93afa14fc2e0f732d1bb2a44b7", "zh:df99cdb8b064aad35ffea77e645cf6541d0b1b2ebc51b6d26c42031de60ab69e",
"zh:efd3b3f1ec59a37f635aa1d4efcf178734c2fcf8ddb0d56ea690bec342da8672",
] ]
} }

View File

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

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

View File

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

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:/usr/src/app/upload - ${UPLOAD_LOCATION}/photos:/data
- ${UPLOAD_LOCATION}/photos/upload:/usr/src/app/upload/upload - ${UPLOAD_LOCATION}/photos/upload:/data/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:5f6a838e4e44c8e0e019d0ebfe3ee8952b69afc2809b2c25f7b0119641978e91 image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a
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:/usr/src/app/upload - ${UPLOAD_LOCATION}/photos:/data
- /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:5f6a838e4e44c8e0e019d0ebfe3ee8952b69afc2809b2c25f7b0119641978e91 image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a
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}:/usr/src/app/upload - ${UPLOAD_LOCATION}:/data
- /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:5f6a838e4e44c8e0e019d0ebfe3ee8952b69afc2809b2c25f7b0119641978e91 image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a
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}:/usr/src/app/upload - ${UPLOAD_LOCATION}:/data
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
+ - originals:/usr/src/app/originals + - originals:/usr/src/app/originals
... ...

View File

@@ -94,19 +94,16 @@ Change media location
``` ```
immich-admin change-media-location immich-admin change-media-location
? Enter the previous value of IMMICH_MEDIA_LOCATION: /usr/src/app/upload ? Enter the previous value of IMMICH_MEDIA_LOCATION: /data
? Enter the new value of IMMICH_MEDIA_LOCATION: /data ? Enter the new value of IMMICH_MEDIA_LOCATION: /my-data
...
Previous value: /data
Current value: /my-data
Previous value: /usr/src/app/upload Changing database paths from "/data/*" to "/my-data/*"
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,6 +38,19 @@ 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 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](#set-custom-scan-interval) to pull in your changes.
#### Troubleshooting #### Troubleshooting
@@ -72,7 +72,9 @@ 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. 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. 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).
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
@@ -91,7 +93,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}:/usr/src/app/upload - ${UPLOAD_LOCATION}:/data
+ - /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}:/usr/src/app/upload - ${UPLOAD_LOCATION}:/data
+ - ${THUMB_LOCATION}:/usr/src/app/upload/thumbs + - ${THUMB_LOCATION}:/data/thumbs
+ - ${ENCODED_VIDEO_LOCATION}:/usr/src/app/upload/encoded-video + - ${ENCODED_VIDEO_LOCATION}:/data/encoded-video
+ - ${PROFILE_LOCATION}:/usr/src/app/upload/profile + - ${PROFILE_LOCATION}:/data/profile
+ - ${BACKUP_LOCATION}:/usr/src/app/upload/backups + - ${BACKUP_LOCATION}:/data/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 `/usr/src/app/upload` 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 `/data` 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,118 +12,148 @@ 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 "assets" WHERE "originalFileName" = 'PXL_20230903_232542848.jpg'; SELECT * FROM "asset" WHERE "originalFileName" = 'PXL_20230903_232542848.jpg';
SELECT * FROM "assets" WHERE "originalFileName" LIKE 'PXL_%'; -- all files starting with PXL_ SELECT * FROM "asset" WHERE "originalFileName" LIKE 'PXL_%'; -- all files starting with PXL_
SELECT * FROM "assets" WHERE "originalFileName" LIKE '%_2023_%'; -- all files with _2023_ in the middle SELECT * FROM "asset" WHERE "originalFileName" LIKE '%_2023_%'; -- all files with _2023_ in the middle
``` ```
```sql title="Find by path" ```sql title="Find by path"
SELECT * FROM "assets" WHERE "originalPath" = 'upload/library/admin/2023/2023-09-03/PXL_2023.jpg'; SELECT * FROM "asset" WHERE "originalPath" = 'upload/library/admin/2023/2023-09-03/PXL_2023.jpg';
SELECT * FROM "assets" WHERE "originalPath" LIKE 'upload/library/admin/2023/%'; SELECT * FROM "asset" WHERE "originalPath" LIKE 'upload/library/admin/2023/%';
``` ```
### ID
```sql title="Find by ID" ```sql title="Find by ID"
SELECT * FROM "assets" WHERE "id" = '9f94e60f-65b6-47b7-ae44-a4df7b57f0e9'; SELECT * FROM "asset" WHERE "id" = '9f94e60f-65b6-47b7-ae44-a4df7b57f0e9';
``` ```
```sql title="Find by partial ID" ```sql title="Find by partial ID"
SELECT * FROM "assets" WHERE "id"::text LIKE '%ab431d3a%'; SELECT * FROM "asset" 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 "assets"; SELECT encode("checksum", 'hex') FROM "asset";
SELECT * FROM "assets" WHERE "checksum" = decode('69de19c87658c4c15d9cacb9967b8e033bf74dd1', 'hex'); SELECT * FROM "asset" WHERE "checksum" = decode('69de19c87658c4c15d9cacb9967b8e033bf74dd1', 'hex');
SELECT * FROM "assets" WHERE "checksum" = '\x69de19c87658c4c15d9cacb9967b8e033bf74dd1'; -- alternate notation SELECT * FROM "asset" 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 "assets" T1 SELECT T1."checksum", array_agg(T2."id") ids FROM "asset" T1
INNER JOIN "assets" T2 ON T1."checksum" = T2."checksum" AND T1."id" != T2."id" AND T2."deletedAt" IS NULL INNER JOIN "asset" 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 "assets" WHERE "livePhotoVideoId" IS NOT NULL; SELECT * FROM "asset" WHERE "livePhotoVideoId" IS NOT NULL;
``` ```
```sql title="By description" ```sql title="By description"
SELECT "assets".*, "exif"."description" FROM "exif" SELECT "asset".*, "asset_exif"."description" FROM "asset_exif"
JOIN "assets" ON "assets"."id" = "exif"."assetId" JOIN "asset" ON "asset"."id" = "asset_exif"."assetId"
WHERE TRIM("exif"."description") <> ''; -- all files with a description WHERE TRIM("asset_exif"."description") <> ''; -- all files with a description
SELECT "assets".*, "exif"."description" FROM "exif" SELECT "asset".*, "asset_exif"."description" FROM "asset_exif"
JOIN "assets" ON "assets"."id" = "exif"."assetId" JOIN "asset" ON "asset"."id" = "asset_exif"."assetId"
WHERE "exif"."description" ILIKE '%string to match%'; -- search by string WHERE "asset_exif"."description" ILIKE '%string to match%'; -- search by string
``` ```
```sql title="Without metadata" ```sql title="Without metadata"
SELECT "assets".* FROM "exif" SELECT "asset".* FROM "asset_exif"
LEFT JOIN "assets" ON "assets"."id" = "exif"."assetId" LEFT JOIN "asset" ON "asset"."id" = "asset_exif"."assetId"
WHERE "exif"."assetId" IS NULL; WHERE "asset_exif"."assetId" IS NULL;
``` ```
```sql title="size < 100,000 bytes, smallest to largest" ```sql title="size < 100,000 bytes, smallest to largest"
SELECT * FROM "assets" SELECT * FROM "asset"
JOIN "exif" ON "assets"."id" = "exif"."assetId" JOIN "asset_exif" ON "asset"."id" = "asset_exif"."assetId"
WHERE "exif"."fileSizeInByte" < 100000 WHERE "asset_exif"."fileSizeInByte" < 100000
ORDER BY "exif"."fileSizeInByte" ASC; ORDER BY "asset_exif"."fileSizeInByte" ASC;
``` ```
```sql title="Without thumbnails" ### Type
SELECT * FROM "assets" WHERE "assets"."previewPath" IS NULL OR "assets"."thumbnailPath" IS NULL;
```
```sql title="By type" ```sql title="By type"
SELECT * FROM "assets" WHERE "assets"."type" = 'VIDEO'; SELECT * FROM "asset" WHERE "asset"."type" = 'VIDEO';
SELECT * FROM "assets" WHERE "assets"."type" = 'IMAGE'; SELECT * FROM "asset" WHERE "asset"."type" = 'IMAGE';
``` ```
```sql title="Count by type" ```sql title="Count by type"
SELECT "assets"."type", COUNT(*) FROM "assets" GROUP BY "assets"."type"; SELECT "asset"."type", COUNT(*) FROM "asset" GROUP BY "asset"."type";
``` ```
```sql title="Count by type (per user)" ```sql title="Count by type (per user)"
SELECT "users"."email", "assets"."type", COUNT(*) FROM "assets" SELECT "user"."email", "asset"."type", COUNT(*) FROM "asset"
JOIN "users" ON "assets"."ownerId" = "users"."id" JOIN "user" ON "asset"."ownerId" = "user"."id"
GROUP BY "assets"."type", "users"."email" ORDER BY "users"."email"; GROUP BY "asset"."type", "user"."email" ORDER BY "user"."email";
``` ```
```sql title="Failed file movements" ## Tags
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 "users"; SELECT * FROM "user";
``` ```
```sql title="Get owner info from asset ID" ```sql title="Get owner info from asset ID"
SELECT "users".* FROM "users" JOIN "assets" ON "users"."id" = "assets"."ownerId" WHERE "assets"."id" = 'fa310b01-2f26-4b7a-9042-d578226e021f'; SELECT "user".* FROM "user" JOIN "asset" ON "user"."id" = "asset"."ownerId" WHERE "asset"."id" = 'fa310b01-2f26-4b7a-9042-d578226e021f';
``` ```
## System Config
```sql title="Custom settings"
SELECT "key", "value" FROM "system_metadata" WHERE "key" = 'system-config';
```
(Only used when not using the [config file](/docs/install/config-file))
## Persons ## Persons
```sql title="Delete person and unset it for the faces it was associated with" ```sql title="Delete person and unset it for the faces it was associated with"
DELETE FROM "person" WHERE "name" = 'PersonNameHere'; DELETE FROM "person" WHERE "name" = 'PersonNameHere';
``` ```
## System
### Config
```sql title="Custom settings"
SELECT "key", "value" FROM "system_metadata" WHERE "key" = 'system-config';
```
(Only used when not using the [config file](/docs/install/config-file))
### File properties
```sql title="Without thumbnails"
SELECT * FROM "asset" WHERE "asset"."previewPath" IS NULL OR "asset"."thumbnailPath" IS NULL;
```
```sql title="Failed file movements"
SELECT * FROM "move_history";
```
## Postgres internal ## Postgres internal
```sql title="Change DB_PASSWORD" ```sql title="Change DB_PASSWORD"

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}:/usr/src/app/upload - ${UPLOAD_LOCATION}:/data
+ - /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>⚠️ | `/usr/src/app/upload` | server | api, microservices | | `IMMICH_MEDIA_LOCATION` | Media location inside the container ⚠️**You probably shouldn't set this**<sup>\*2</sup>⚠️ | `/data` | 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,12 +199,11 @@ 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 |
## Docker Secrets ## Secrets
The following variables support the use of [Docker secrets][docker-secrets] for additional security. The following variables support reading from files, either via [Systemd Credentials][systemd-creds] or [Docker secrets][docker-secrets] for additional security.
To use any of these, replace the regular environment variable with the equivalent `_FILE` environment variable. The value of 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.
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 |
| :----------------- | :------------------------------------------ | | :----------------- | :------------------------------------------ |
@@ -226,3 +225,4 @@ 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,6 +100,11 @@ 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,4 +2,23 @@
## TypeORM Upgrade ## TypeORM Upgrade
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. 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.
## 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:3aef84a0a4fabbda17ef115c3019ba0c914ec73e9f6e59203674322d858b8eea image: ghcr.io/immich-app/postgres:14-vectorchord0.3.0@sha256:0e763a2383d56f90364fcd72767ac41400cd30d2627f407f7e7960c9f1923c21
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.4", "@types/node": "^22.16.5",
"@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.0.0", "eslint-config-prettier": "^10.1.8",
"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.4", "@types/node": "^22.16.5",
"@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.0.0", "eslint-config-prettier": "^10.1.8",
"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.4", "@types/node": "^22.16.5",
"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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.38.0.tgz",
"integrity": "sha512-jsuVWeIkb6ggzB+wPCsR4e6loj+rM72ohW6IBn2C+5NCvfUVY8s33iFPySSVXqtm5Hu29Ne/9bnA0JmyLmgenA==", "integrity": "sha512-CPoznzpuAnIOl4nhj4tRr4gIPj5AfKgkiJmGQDaq+fQnRJTYlcBjbX3wbciGmpoPf8DREufuPRe1tNMZnGdanA==",
"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.37.0", "@typescript-eslint/scope-manager": "8.38.0",
"@typescript-eslint/type-utils": "8.37.0", "@typescript-eslint/type-utils": "8.38.0",
"@typescript-eslint/utils": "8.37.0", "@typescript-eslint/utils": "8.38.0",
"@typescript-eslint/visitor-keys": "8.37.0", "@typescript-eslint/visitor-keys": "8.38.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.37.0", "@typescript-eslint/parser": "^8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.38.0.tgz",
"integrity": "sha512-kVIaQE9vrN9RLCQMQ3iyRlVJpTiDUY6woHGb30JDkfJErqrQEmtdWH3gV0PBAfGZgQXoqzXOO0T3K6ioApbbAA==", "integrity": "sha512-Zhy8HCvBUEfBECzIl1PKqF4p11+d0aUJS1GeUiuqK9WmOug8YCmC4h4bjyBvMyAMI9sbRczmrYL5lKg/YMbrcQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "8.37.0", "@typescript-eslint/scope-manager": "8.38.0",
"@typescript-eslint/types": "8.37.0", "@typescript-eslint/types": "8.38.0",
"@typescript-eslint/typescript-estree": "8.37.0", "@typescript-eslint/typescript-estree": "8.38.0",
"@typescript-eslint/visitor-keys": "8.37.0", "@typescript-eslint/visitor-keys": "8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.38.0.tgz",
"integrity": "sha512-BIUXYsbkl5A1aJDdYJCBAo8rCEbAvdquQ8AnLb6z5Lp1u3x5PNgSSx9A/zqYc++Xnr/0DVpls8iQ2cJs/izTXA==", "integrity": "sha512-dbK7Jvqcb8c9QfH01YB6pORpqX1mn5gDZc9n63Ak/+jD67oWXn3Gs0M6vddAN+eDXBCS5EmNWzbSxsn9SzFWWg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.37.0", "@typescript-eslint/tsconfig-utils": "^8.38.0",
"@typescript-eslint/types": "^8.37.0", "@typescript-eslint/types": "^8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.38.0.tgz",
"integrity": "sha512-0vGq0yiU1gbjKob2q691ybTg9JX6ShiVXAAfm2jGf3q0hdP6/BruaFjL/ManAR/lj05AvYCH+5bbVo0VtzmjOA==", "integrity": "sha512-WJw3AVlFFcdT9Ri1xs/lg8LwDqgekWXWhH3iAF+1ZM+QPd7oxQ6jvtW/JPwzAScxitILUIFs0/AnQ/UWHzbATQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.37.0", "@typescript-eslint/types": "8.38.0",
"@typescript-eslint/visitor-keys": "8.37.0" "@typescript-eslint/visitor-keys": "8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.38.0.tgz",
"integrity": "sha512-1/YHvAVTimMM9mmlPvTec9NP4bobA1RkDbMydxG8omqwJJLEW/Iy2C4adsAESIXU3WGLXFHSZUU+C9EoFWl4Zg==", "integrity": "sha512-Lum9RtSE3EroKk/bYns+sPOodqb2Fv50XOl/gMviMKNvanETUuUcC9ObRbzrJ4VSd2JalPqgSAavwrPiPvnAiQ==",
"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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.38.0.tgz",
"integrity": "sha512-SPkXWIkVZxhgwSwVq9rqj/4VFo7MnWwVaRNznfQDc/xPYHjXnPfLWn+4L6FF1cAz6e7dsqBeMawgl7QjUMj4Ow==", "integrity": "sha512-c7jAvGEZVf0ao2z+nnz8BUaHZD09Agbh+DY7qvBQqLiz8uJzRgVPj5YvOh8I8uEiH8oIUGIfHzMwUcGVco/SJg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.37.0", "@typescript-eslint/types": "8.38.0",
"@typescript-eslint/typescript-estree": "8.37.0", "@typescript-eslint/typescript-estree": "8.38.0",
"@typescript-eslint/utils": "8.37.0", "@typescript-eslint/utils": "8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.38.0.tgz",
"integrity": "sha512-ax0nv7PUF9NOVPs+lmQ7yIE7IQmAf8LGcXbMvHX5Gm+YJUYNAl340XkGnrimxZ0elXyoQJuN5sbg6C4evKA4SQ==", "integrity": "sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==",
"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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.38.0.tgz",
"integrity": "sha512-zuWDMDuzMRbQOM+bHyU4/slw27bAUEcKSKKs3hcv2aNnc/tvE/h7w60dwVw8vnal2Pub6RT1T7BI8tFZ1fE+yg==", "integrity": "sha512-fooELKcAKzxux6fA6pxOflpNS0jc+nOQEEOipXFNjSlBS6fqrJOVY/whSn70SScHrcJ2LDsxWrneFoWYSVfqhQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/project-service": "8.37.0", "@typescript-eslint/project-service": "8.38.0",
"@typescript-eslint/tsconfig-utils": "8.37.0", "@typescript-eslint/tsconfig-utils": "8.38.0",
"@typescript-eslint/types": "8.37.0", "@typescript-eslint/types": "8.38.0",
"@typescript-eslint/visitor-keys": "8.37.0", "@typescript-eslint/visitor-keys": "8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.38.0.tgz",
"integrity": "sha512-TSFvkIW6gGjN2p6zbXo20FzCABbyUAuq6tBvNRGsKdsSQ6a7rnV6ADfZ7f4iI3lIiXc4F4WWvtUfDw9CJ9pO5A==", "integrity": "sha512-hHcMA86Hgt+ijJlrD8fX0j1j8w4C92zue/8LOPAFioIno+W0+L7KqE8QZKCcPGc/92Vs9x36w/4MPTJhqXdyvg==",
"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.37.0", "@typescript-eslint/scope-manager": "8.38.0",
"@typescript-eslint/types": "8.37.0", "@typescript-eslint/types": "8.38.0",
"@typescript-eslint/typescript-estree": "8.37.0" "@typescript-eslint/typescript-estree": "8.38.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.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.37.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.38.0.tgz",
"integrity": "sha512-YzfhzcTnZVPiLfP/oeKtDp2evwvHLMe0LOy7oe+hb9KKIumLNohYS9Hgp1ifwpu42YWxhZE8yieggz6JpqO/1w==", "integrity": "sha512-pWrTcoFNWuwHlA9CvlfSsGWs14JxfN1TH25zM5L7o0pRLhsoZkDnTsXfQRJBEWJoV5DL0jf+Z+sxiud+K0mq1g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.37.0", "@typescript-eslint/types": "8.38.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.5", "version": "10.1.8",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz",
"integrity": "sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw==", "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==",
"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.1", "version": "5.5.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.3.tgz",
"integrity": "sha512-dobTkHT6XaEVOo8IO90Q4DOSxnm3Y151QxPJlM/vKC0bVy+d6cVWQZLlFiuZPP0wS6vZwSKeJgKkcS+KfMBlRw==", "integrity": "sha512-NAdMYww51ehKfDyDhv59/eIItUVzU0Io9H2E8nHNGKEeeqlnci+1gCvrHib6EmZdf6GxF+LCV5K7UC65Ezvw7w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -3983,15 +3983,16 @@
} }
}, },
"node_modules/form-data": { "node_modules/form-data": {
"version": "4.0.2", "version": "4.0.4",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz",
"integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==",
"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": {
@@ -5708,15 +5709,15 @@
} }
}, },
"node_modules/prettier-plugin-organize-imports": { "node_modules/prettier-plugin-organize-imports": {
"version": "4.1.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.1.0.tgz", "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.2.0.tgz",
"integrity": "sha512-5aWRdCgv645xaa58X8lOxzZoiHAldAPChljr/MT0crXVOWTZ+Svl4hIWlz+niYSlO6ikE5UXkN1JrRvIP2ut0A==", "integrity": "sha512-Zdy27UhlmyvATZi67BTnLcKTo8fm6Oik59Sz6H64PgZJVs6NJpPD1mT240mmJn62c98/QaL+r3kx9Q3gRpDajg==",
"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" "vue-tsc": "^2.1.0 || 3"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"vue-tsc": { "vue-tsc": {
@@ -6469,35 +6470,35 @@
} }
}, },
"node_modules/superagent": { "node_modules/superagent": {
"version": "10.2.2", "version": "10.2.3",
"resolved": "https://registry.npmjs.org/superagent/-/superagent-10.2.2.tgz", "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.2.3.tgz",
"integrity": "sha512-vWMq11OwWCC84pQaFPzF/VO3BrjkCeewuvJgt1jfV0499Z1QSAWN4EqfMM5WlFDDX9/oP8JjlDKpblrmEoyu4Q==", "integrity": "sha512-y/hkYGeXAj7wUMjxRbB21g/l6aAEituGXM9Rwl4o20+SX3e8YOSV6BxFXl+dL3Uk0mjSL3kCbNkwURm8/gEDig==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"component-emitter": "^1.3.0", "component-emitter": "^1.3.1",
"cookiejar": "^2.1.4", "cookiejar": "^2.1.4",
"debug": "^4.3.4", "debug": "^4.3.7",
"fast-safe-stringify": "^2.1.1", "fast-safe-stringify": "^2.1.1",
"form-data": "^4.0.0", "form-data": "^4.0.4",
"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.0" "qs": "^6.11.2"
}, },
"engines": { "engines": {
"node": ">=14.18.0" "node": ">=14.18.0"
} }
}, },
"node_modules/supertest": { "node_modules/supertest": {
"version": "7.1.3", "version": "7.1.4",
"resolved": "https://registry.npmjs.org/supertest/-/supertest-7.1.3.tgz", "resolved": "https://registry.npmjs.org/supertest/-/supertest-7.1.4.tgz",
"integrity": "sha512-ORY0gPa6ojmg/C74P/bDoS21WL6FMXq5I8mawkEz30/zkwdu0gOeqstFy316vHG6OKxqQ+IbGneRemHI8WraEw==", "integrity": "sha512-tjLPs7dVyqgItVFirHYqe2T+MfWc2VOBQ8QFKKbWTA3PU7liZR8zoSpAi/C1k1ilm9RsXIKYf197oap9wXGVYg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"methods": "^1.1.2", "methods": "^1.1.2",
"superagent": "^10.2.2" "superagent": "^10.2.3"
}, },
"engines": { "engines": {
"node": ">=14.18.0" "node": ">=14.18.0"
@@ -6817,16 +6818,16 @@
} }
}, },
"node_modules/typescript-eslint": { "node_modules/typescript-eslint": {
"version": "8.37.0", "version": "8.38.0",
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.37.0.tgz", "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.38.0.tgz",
"integrity": "sha512-TnbEjzkE9EmcO0Q2zM+GE8NQLItNAJpMmED1BdgoBMYNdqMhzlbqfdSwiRlAzEK2pA9UzVW0gzaaIzXWg2BjfA==", "integrity": "sha512-FsZlrYK6bPDGoLeZRuvx2v6qrM03I0U0SnfCLPs/XCCPCFD80xU9Pg09H/K+XFa68uJuZo7l/Xhs+eDRg2l3hg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/eslint-plugin": "8.37.0", "@typescript-eslint/eslint-plugin": "8.38.0",
"@typescript-eslint/parser": "8.37.0", "@typescript-eslint/parser": "8.38.0",
"@typescript-eslint/typescript-estree": "8.37.0", "@typescript-eslint/typescript-estree": "8.38.0",
"@typescript-eslint/utils": "8.37.0" "@typescript-eslint/utils": "8.38.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.4", "@types/node": "^22.16.5",
"@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.0.0", "eslint-config-prettier": "^10.1.8",
"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 album.addAsset access')); expect(body).toEqual(errorDto.badRequest('Not found or no albumAsset.create 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 album.removeAsset access')); expect(body).toEqual(errorDto.badRequest('Not found or no albumAsset.delete access'));
}); });
it('should remove duplicate assets only once', async () => { it('should remove duplicate assets only once', async () => {

View File

@@ -186,18 +186,6 @@ 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,6 +37,7 @@ 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,6 +14,7 @@
"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",
@@ -44,6 +45,13 @@
"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}",
@@ -511,6 +519,7 @@
"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.",
@@ -724,6 +733,7 @@
"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",
@@ -743,7 +753,8 @@
"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_prompt": "{count} deleted permanently", "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",
"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",
@@ -761,6 +772,8 @@
"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",
@@ -816,6 +829,7 @@
"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",
@@ -983,6 +997,7 @@
}, },
"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",
@@ -1149,6 +1164,7 @@
"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",
@@ -1168,7 +1184,6 @@
"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",
@@ -1233,8 +1248,7 @@
"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_bound": "{count} photo", "map_assets_in_bounds": "{count, plural, one {# photo} other {# photos}}",
"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",
@@ -1585,6 +1599,7 @@
"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",
@@ -1742,6 +1757,7 @@
"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",
@@ -1767,6 +1783,7 @@
"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.6" "flutter": "3.32.8"
} }

View File

@@ -1,5 +1,5 @@
{ {
"dart.flutterSdkPath": ".fvm/versions/3.32.6", "dart.flutterSdkPath": ".fvm/versions/3.32.8",
"dart.lineLength": 120, "dart.lineLength": 120,
"[dart]": { "[dart]": {
"editor.rulers": [120], "editor.rulers": [120],

View File

@@ -88,7 +88,8 @@ 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 {
@@ -102,7 +103,8 @@ 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
return PlatformAsset(id, name, type, createdAt, updatedAt, width, height, durationInSeconds, orientation) val isFavorite = pigeonVar_list[9] as Boolean
return PlatformAsset(id, name, type, createdAt, updatedAt, width, height, durationInSeconds, orientation, isFavorite)
} }
} }
fun toList(): List<Any?> { fun toList(): List<Any?> {
@@ -116,6 +118,7 @@ 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,6 +42,7 @@ 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
@@ -77,6 +78,7 @@ 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()
@@ -105,6 +107,7 @@ 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,
@@ -116,6 +119,7 @@ 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", "$uniqueWorkName-$appWidgetId-singleShot",
ExistingWorkPolicy.REPLACE, ExistingWorkPolicy.REPLACE,
workRequest workRequest
) )

View File

@@ -28,19 +28,21 @@ 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) {
CoroutineScope(Dispatchers.Default).launch { glanceIds.forEach { widgetID ->
val provider = ComponentName(context, MemoryReceiver::class.java) ImageDownloadWorker.singleShot(context, widgetID, WidgetType.MEMORIES)
val glanceIds = AppWidgetManager.getInstance(context).getAppWidgetIds(provider)
glanceIds.forEach { widgetID ->
ImageDownloadWorker.singleShot(context, widgetID, WidgetType.MEMORIES)
}
} }
} }
// make sure the periodic jobs are running
glanceIds.forEach { widgetID ->
ImageDownloadWorker.enqueuePeriodic(context, widgetID, WidgetType.MEMORIES)
}
super.onReceive(context, intent) super.onReceive(context, intent)
} }

View File

@@ -28,19 +28,21 @@ 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) {
CoroutineScope(Dispatchers.Default).launch { glanceIds.forEach { widgetID ->
val provider = ComponentName(context, RandomReceiver::class.java) ImageDownloadWorker.singleShot(context, widgetID, WidgetType.RANDOM)
val glanceIds = AppWidgetManager.getInstance(context).getAppWidgetIds(provider)
glanceIds.forEach { widgetID ->
ImageDownloadWorker.singleShot(context, widgetID, WidgetType.RANDOM)
}
} }
} }
// make sure the periodic jobs are running
glanceIds.forEach { widgetID ->
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,6 +139,7 @@ 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
@@ -152,6 +153,7 @@ 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,
@@ -162,7 +164,8 @@ 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?] {
@@ -176,6 +179,7 @@ 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,7 +28,8 @@ 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
) )
} }
} }
@@ -171,7 +172,8 @@ 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,17 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
enum ImmichColorPreset { enum ImmichColorPreset { indigo, deepPurple, pink, red, orange, yellow, lime, green, cyan, slateGray }
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,13 +1,6 @@
enum SortOrder { enum SortOrder { asc, desc }
asc,
desc,
}
enum TextSearchType { enum TextSearchType { context, filename, description }
context,
filename,
description,
}
enum AssetVisibilityEnum { timeline, hidden, archive, locked } enum AssetVisibilityEnum { timeline, hidden, archive, locked }

View File

@@ -2,511 +2,49 @@ import 'package:flutter/material.dart';
const List<ColorFilter> filters = [ const List<ColorFilter> filters = [
//Original //Original
ColorFilter.matrix([ ColorFilter.matrix([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]),
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
1,
0,
]),
//Vintage //Vintage
ColorFilter.matrix([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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,
@@ -554,212 +92,23 @@ const List<ColorFilter> filters = [
0, 0,
]), ]),
//Purple Haze //Purple Haze
ColorFilter.matrix([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ ColorFilter.matrix([1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0]),
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([ 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]),
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([ 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]),
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([ 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]),
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([ 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]),
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,7 +51,4 @@ const Map<String, Locale> locales = {
const String translationsPath = 'assets/i18n'; const String translationsPath = 'assets/i18n';
const List<Locale> localesNotSupportedByOverpass = [ const List<Locale> localesNotSupportedByOverpass = [Locale('el', 'GR'), Locale('sr', 'Cyrl')];
Locale('el', 'GR'),
Locale('sr', 'Cyrl'),
];

View File

@@ -9,11 +9,7 @@ enum AssetType {
audio, audio,
} }
enum AssetState { enum AssetState { local, remote, merged }
local,
remote,
merged,
}
sealed class BaseAsset { sealed class BaseAsset {
final String name; final String name;

View File

@@ -1,11 +1,6 @@
part of 'base_asset.model.dart'; part of 'base_asset.model.dart';
enum AssetVisibility { enum AssetVisibility { timeline, hidden, archive, locked }
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,11 +5,7 @@ class DeviceAsset {
final Uint8List hash; final Uint8List hash;
final DateTime modifiedTime; final DateTime modifiedTime;
const DeviceAsset({ const DeviceAsset({required this.assetId, required this.hash, required this.modifiedTime});
required this.assetId,
required this.hash,
required this.modifiedTime,
});
@override @override
bool operator ==(covariant DeviceAsset other) { bool operator ==(covariant DeviceAsset other) {
@@ -28,11 +24,7 @@ class DeviceAsset {
return 'DeviceAsset(assetId: $assetId, hash: $hash, modifiedTime: $modifiedTime)'; return 'DeviceAsset(assetId: $assetId, hash: $hash, modifiedTime: $modifiedTime)';
} }
DeviceAsset copyWith({ DeviceAsset copyWith({String? assetId, Uint8List? hash, DateTime? modifiedTime}) {
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,16 +1,5 @@
/// Log levels according to dart logging [Level] /// Log levels according to dart logging [Level]
enum LogLevel { enum LogLevel { all, finest, finer, fine, config, info, warning, severe, shout, off }
all,
finest,
finer,
fine,
config,
info,
warning,
severe,
shout,
off,
}
class LogMessage { class LogMessage {
final String message; final String message;

View File

@@ -0,0 +1,18 @@
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,28 +13,18 @@ enum MemoryTypeEnum {
class MemoryData { class MemoryData {
final int year; final int year;
const MemoryData({ const MemoryData({required this.year});
required this.year,
});
MemoryData copyWith({ MemoryData copyWith({int? year}) {
int? year, return MemoryData(year: year ?? this.year);
}) {
return MemoryData(
year: year ?? this.year,
);
} }
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
return <String, dynamic>{ return <String, dynamic>{'year': year};
'year': year,
};
} }
factory MemoryData.fromMap(Map<String, dynamic> map) { factory MemoryData.fromMap(Map<String, dynamic> map) {
return MemoryData( return MemoryData(year: map['year'] as int);
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 Person { class DriftPerson {
final String id; final String id;
final DateTime createdAt; final DateTime createdAt;
final DateTime updatedAt; final DateTime updatedAt;
@@ -103,7 +103,7 @@ class Person {
final String? color; final String? color;
final DateTime? birthDate; final DateTime? birthDate;
const Person({ const DriftPerson({
required this.id, required this.id,
required this.createdAt, required this.createdAt,
required this.updatedAt, required this.updatedAt,
@@ -116,7 +116,7 @@ class Person {
this.birthDate, this.birthDate,
}); });
Person copyWith({ DriftPerson copyWith({
String? id, String? id,
DateTime? createdAt, DateTime? createdAt,
DateTime? updatedAt, DateTime? updatedAt,
@@ -128,7 +128,7 @@ class Person {
String? color, String? color,
DateTime? birthDate, DateTime? birthDate,
}) { }) {
return Person( return DriftPerson(
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 Person {
} }
@override @override
bool operator ==(covariant Person other) { bool operator ==(covariant DriftPerson other) {
if (identical(this, other)) return true; if (identical(this, other)) return true;
return other.id == id && return other.id == id &&

View File

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

View File

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

View File

@@ -14,13 +14,7 @@ class Stack {
required this.primaryAssetId, required this.primaryAssetId,
}); });
Stack copyWith({ Stack copyWith({String? id, DateTime? createdAt, DateTime? updatedAt, String? ownerId, String? primaryAssetId}) {
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,
@@ -63,11 +57,7 @@ class StackResponse {
final String primaryAssetId; final String primaryAssetId;
final List<String> assetIds; final List<String> assetIds;
const StackResponse({ const StackResponse({required this.id, required this.primaryAssetId, required this.assetIds});
required this.id,
required this.primaryAssetId,
required this.assetIds,
});
@override @override
bool operator ==(covariant StackResponse other) { bool operator ==(covariant StackResponse other) {

View File

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

View File

@@ -74,22 +74,21 @@ quotaSizeInBytes: $quotaSizeInBytes,
bool? isPartnerSharedWith, bool? isPartnerSharedWith,
int? quotaUsageInBytes, int? quotaUsageInBytes,
int? quotaSizeInBytes, int? quotaSizeInBytes,
}) => }) => UserDto(
UserDto( id: id ?? this.id,
id: id ?? this.id, email: email ?? this.email,
email: email ?? this.email, name: name ?? this.name,
name: name ?? this.name, isAdmin: isAdmin ?? this.isAdmin,
isAdmin: isAdmin ?? this.isAdmin, updatedAt: updatedAt ?? this.updatedAt,
updatedAt: updatedAt ?? this.updatedAt, profileImagePath: profileImagePath ?? this.profileImagePath,
profileImagePath: profileImagePath ?? this.profileImagePath, avatarColor: avatarColor ?? this.avatarColor,
avatarColor: avatarColor ?? this.avatarColor, memoryEnabled: memoryEnabled ?? this.memoryEnabled,
memoryEnabled: memoryEnabled ?? this.memoryEnabled, inTimeline: inTimeline ?? this.inTimeline,
inTimeline: inTimeline ?? this.inTimeline, isPartnerSharedBy: isPartnerSharedBy ?? this.isPartnerSharedBy,
isPartnerSharedBy: isPartnerSharedBy ?? this.isPartnerSharedBy, isPartnerSharedWith: isPartnerSharedWith ?? this.isPartnerSharedWith,
isPartnerSharedWith: isPartnerSharedWith ?? this.isPartnerSharedWith, quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes,
quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, );
);
@override @override
bool operator ==(covariant UserDto other) { bool operator ==(covariant UserDto other) {
@@ -143,13 +142,7 @@ class PartnerUserDto {
this.profileImagePath, this.profileImagePath,
}); });
PartnerUserDto copyWith({ PartnerUserDto copyWith({String? id, String? email, String? name, bool? inTimeline, String? profileImagePath}) {
String? id,
String? email,
String? name,
bool? inTimeline,
String? profileImagePath,
}) {
return PartnerUserDto( return PartnerUserDto(
id: id ?? this.id, id: id ?? this.id,
email: email ?? this.email, email: email ?? this.email,

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,17 +193,9 @@ class License {
final String activationKey; final String activationKey;
final String licenseKey; final String licenseKey;
const License({ const License({required this.activatedAt, required this.activationKey, required this.licenseKey});
required this.activatedAt,
required this.activationKey,
required this.licenseKey,
});
License copyWith({ License copyWith({DateTime? activatedAt, String? activationKey, String? licenseKey}) {
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,
@@ -255,16 +247,11 @@ class UserMetadata {
final Preferences? preferences; final Preferences? preferences;
final License? license; final License? license;
const UserMetadata({ const UserMetadata({required this.userId, required this.key, this.onboarding, this.preferences, this.license})
required this.userId, : assert(
required this.key, onboarding != null || preferences != null || license != null,
this.onboarding, 'One of onboarding, preferences and license must be provided',
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,15 +13,19 @@ 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,19 +25,16 @@ 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: { sortBy: {SortLocalAlbumsBy.backupSelection, SortLocalAlbumsBy.isIosSharedAlbum},
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,9 +70,7 @@ 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( _log.warning("Cloud album ${album.name} not found in local database. Skipping sync.");
"Cloud album ${album.name} not found in local database. Skipping sync.",
);
continue; continue;
} }
await updateAlbum(dbAlbum, album); await updateAlbum(dbAlbum, album);
@@ -120,10 +118,7 @@ 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( await _localAlbumRepository.upsert(album, toUpsert: assets.toLocalAssets());
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);
@@ -146,9 +141,7 @@ 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( _log.fine("Device album ${dbAlbum.name} has not changed. Skipping sync.");
"Device album ${dbAlbum.name} has not changed. Skipping sync.",
);
return false; return false;
} }
@@ -172,10 +165,7 @@ 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( Future<bool> checkAddition(LocalAlbum dbAlbum, LocalAlbum deviceAlbum) async {
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
@@ -189,9 +179,7 @@ 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( _log.fine("No new assets found despite album having changes. Proceeding to full sync for ${dbAlbum.name}");
"No new assets found despite album having changes. Proceeding to full sync for ${dbAlbum.name}",
);
return false; return false;
} }
@@ -201,10 +189,7 @@ class LocalSyncService {
return false; return false;
} }
final newAssets = await _nativeSyncApi.getAssetsForAlbum( final newAssets = await _nativeSyncApi.getAssetsForAlbum(deviceAlbum.id, updatedTimeCond: updatedTime);
deviceAlbum.id,
updatedTimeCond: updatedTime,
);
await _localAlbumRepository.upsert( await _localAlbumRepository.upsert(
deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection), deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection),
@@ -229,9 +214,7 @@ 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( _log.fine("Device album ${deviceAlbum.name} is empty. Removing assets from DB.");
"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),
@@ -239,18 +222,11 @@ class LocalSyncService {
return true; return true;
} }
final updatedDeviceAlbum = deviceAlbum.copyWith( final updatedDeviceAlbum = deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection);
backupSelection: dbAlbum.backupSelection,
);
if (dbAlbum.assetCount == 0) { if (dbAlbum.assetCount == 0) {
_log.fine( _log.fine("Device album ${deviceAlbum.name} is empty. Adding assets to DB.");
"Device album ${deviceAlbum.name} is empty. Adding assets to DB.", await _localAlbumRepository.upsert(updatedDeviceAlbum, toUpsert: assetsInDevice);
);
await _localAlbumRepository.upsert(
updatedDeviceAlbum,
toUpsert: assetsInDevice,
);
return true; return true;
} }
@@ -282,18 +258,12 @@ class LocalSyncService {
); );
if (assetsToUpsert.isEmpty && assetsToDelete.isEmpty) { if (assetsToUpsert.isEmpty && assetsToDelete.isEmpty) {
_log.fine( _log.fine("No asset changes detected in album ${deviceAlbum.name}. Updating metadata.");
"No asset changes detected in album ${deviceAlbum.name}. Updating metadata.",
);
_localAlbumRepository.upsert(updatedDeviceAlbum); _localAlbumRepository.upsert(updatedDeviceAlbum);
return true; return true;
} }
await _localAlbumRepository.upsert( await _localAlbumRepository.upsert(updatedDeviceAlbum, toUpsert: assetsToUpsert, toDelete: assetsToDelete);
updatedDeviceAlbum,
toUpsert: assetsToUpsert,
toDelete: assetsToDelete,
);
return true; return true;
} catch (e, s) { } catch (e, s) {
@@ -342,6 +312,7 @@ 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,11 +61,7 @@ class LogService {
return instance; return instance;
} }
LogService._( LogService._(this._logRepository, this._storeRepository, this._shouldBuffer) {
this._logRepository,
this._storeRepository,
this._shouldBuffer,
) {
_logSubscription = Logger.root.onRecord.listen(_handleLogRecord); _logSubscription = Logger.root.onRecord.listen(_handleLogRecord);
} }
@@ -89,10 +85,7 @@ class LogService {
if (_shouldBuffer) { if (_shouldBuffer) {
_msgBuffer.add(record); _msgBuffer.add(record);
_flushTimer ??= Timer( _flushTimer ??= Timer(const Duration(seconds: 5), () => unawaited(flushBuffer()));
const Duration(seconds: 5),
() => unawaited(flushBuffer()),
);
} else { } else {
unawaited(_logRepository.insert(record)); unawaited(_logRepository.insert(record));
} }

View File

@@ -0,0 +1,23 @@
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,6 +13,10 @@ 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,10 +7,7 @@ class DriftPartnerService {
final DriftPartnerRepository _driftPartnerRepository; final DriftPartnerRepository _driftPartnerRepository;
final PartnerApiRepository _partnerApiRepository; final PartnerApiRepository _partnerApiRepository;
const DriftPartnerService( const DriftPartnerService(this._driftPartnerRepository, this._partnerApiRepository);
this._driftPartnerRepository,
this._partnerApiRepository,
);
Future<List<PartnerUserDto>> getSharedWith(String userId) { Future<List<PartnerUserDto>> getSharedWith(String userId) {
return _driftPartnerRepository.getSharedWith(userId); return _driftPartnerRepository.getSharedWith(userId);
@@ -20,9 +17,7 @@ class DriftPartnerService {
return _driftPartnerRepository.getSharedBy(userId); return _driftPartnerRepository.getSharedBy(userId);
} }
Future<List<PartnerUserDto>> getAvailablePartners( Future<List<PartnerUserDto>> getAvailablePartners(String currentUserId) async {
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) {
@@ -39,10 +34,7 @@ class DriftPartnerService {
return; return;
} }
await _partnerApiRepository.update( await _partnerApiRepository.update(partnerId, inTimeline: !partner.inTimeline);
partnerId,
inTimeline: !partner.inTimeline,
);
await _driftPartnerRepository.toggleShowInTimeline(partner, userId); await _driftPartnerRepository.toggleShowInTimeline(partner, userId);
} }

View File

@@ -0,0 +1,30 @@
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();
} }
List<RemoteAlbum> sortAlbums( Future<RemoteAlbum?> get(String albumId) {
List<RemoteAlbum> albums, return _repository.get(albumId);
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,16 +65,8 @@ class RemoteAlbumService {
return filtered; return filtered;
} }
Future<RemoteAlbum> createAlbum({ Future<RemoteAlbum> createAlbum({required String title, required List<String> assetIds, String? description}) async {
required String title, final album = await _albumApiRepository.createDriftAlbum(title, description: description, assetIds: assetIds);
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);
@@ -116,14 +108,8 @@ class RemoteAlbumService {
return _repository.getAssets(albumId); return _repository.getAssets(albumId);
} }
Future<int> addAssets({ Future<int> addAssets({required String albumId, required List<String> assetIds}) async {
required String albumId, final album = await _albumApiRepository.addAssets(albumId, assetIds);
required List<String> assetIds,
}) async {
final album = await _albumApiRepository.addAssets(
albumId,
assetIds,
);
await _repository.addAssets(albumId, album.added); await _repository.addAssets(albumId, album.added);
@@ -136,10 +122,7 @@ class RemoteAlbumService {
await _repository.deleteAlbum(albumId); await _repository.deleteAlbum(albumId);
} }
Future<void> addUsers({ Future<void> addUsers({required String albumId, required List<String> userIds}) async {
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,16 +24,12 @@ 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({ static Future<StoreService> init({required IsarStoreRepository storeRepository}) async {
required IsarStoreRepository storeRepository,
}) async {
_instance ??= await create(storeRepository: storeRepository); _instance ??= await create(storeRepository: storeRepository);
return _instance!; return _instance!;
} }
static Future<StoreService> create({ static Future<StoreService> create({required IsarStoreRepository storeRepository}) async {
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();
@@ -48,8 +44,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,14 +18,14 @@ class SyncStreamService {
required SyncApiRepository syncApiRepository, required SyncApiRepository syncApiRepository,
required SyncStreamRepository syncStreamRepository, required SyncStreamRepository syncStreamRepository,
bool Function()? cancelChecker, bool Function()? cancelChecker,
}) : _syncApiRepository = syncApiRepository, }) : _syncApiRepository = syncApiRepository,
_syncStreamRepository = syncStreamRepository, _syncStreamRepository = syncStreamRepository,
_cancelChecker = cancelChecker; _cancelChecker = cancelChecker;
bool get isCancelled => _cancelChecker?.call() ?? false; bool get isCancelled => _cancelChecker?.call() ?? false;
Future<void> sync() { Future<void> sync() {
_logger.info("Remote sync request for userr"); _logger.info("Remote sync request for user");
DLog.log("Remote sync request for user"); DLog.log("Remote sync request for user");
// Start the sync stream and handle events // Start the sync stream and handle events
return _syncApiRepository.streamChanges(_handleEvents); return _syncApiRepository.streamChanges(_handleEvents);
@@ -34,9 +34,7 @@ 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( _logger.info('Processing batch of ${batchData.length} AssetUploadReadyV1 events');
'Processing batch of ${batchData.length} AssetUploadReadyV1 events',
);
final List<SyncAssetV1> assets = []; final List<SyncAssetV1> assets = [];
final List<SyncAssetExifV1> exifs = []; final List<SyncAssetExifV1> exifs = [];
@@ -65,22 +63,12 @@ class SyncStreamService {
} }
if (assets.isNotEmpty && exifs.isNotEmpty) { if (assets.isNotEmpty && exifs.isNotEmpty) {
await _syncStreamRepository.updateAssetsV1( await _syncStreamRepository.updateAssetsV1(assets, debugLabel: 'websocket-batch');
assets, await _syncStreamRepository.updateAssetsExifV1(exifs, debugLabel: 'websocket-batch');
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( _logger.severe("Error processing AssetUploadReadyV1 websocket batch events", error, stackTrace);
"Error processing AssetUploadReadyV1 websocket batch events",
error,
stackTrace,
);
} }
} }
@@ -114,10 +102,7 @@ class SyncStreamService {
batch.clear(); batch.clear();
} }
Future<void> _handleSyncData( Future<void> _handleSyncData(SyncEntityType type, Iterable<Object> data) async {
SyncEntityType type,
Iterable<Object> data,
) async {
_logger.fine("Processing sync data for $type of length ${data.length}"); _logger.fine("Processing sync data for $type of length ${data.length}");
switch (type) { switch (type) {
case SyncEntityType.userV1: case SyncEntityType.userV1:
@@ -135,30 +120,15 @@ 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( return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'partner');
data.cast(),
debugLabel: 'partner',
);
case SyncEntityType.partnerAssetBackfillV1: case SyncEntityType.partnerAssetBackfillV1:
return _syncStreamRepository.updateAssetsV1( return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'partner backfill');
data.cast(),
debugLabel: 'partner backfill',
);
case SyncEntityType.partnerAssetDeleteV1: case SyncEntityType.partnerAssetDeleteV1:
return _syncStreamRepository.deleteAssetsV1( return _syncStreamRepository.deleteAssetsV1(data.cast(), debugLabel: "partner");
data.cast(),
debugLabel: "partner",
);
case SyncEntityType.partnerAssetExifV1: case SyncEntityType.partnerAssetExifV1:
return _syncStreamRepository.updateAssetsExifV1( return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'partner');
data.cast(),
debugLabel: 'partner',
);
case SyncEntityType.partnerAssetExifBackfillV1: case SyncEntityType.partnerAssetExifBackfillV1:
return _syncStreamRepository.updateAssetsExifV1( return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'partner backfill');
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:
@@ -166,39 +136,21 @@ 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( return _syncStreamRepository.updateAlbumUsersV1(data.cast(), debugLabel: 'backfill');
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( return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'album');
data.cast(),
debugLabel: 'album',
);
case SyncEntityType.albumAssetBackfillV1: case SyncEntityType.albumAssetBackfillV1:
return _syncStreamRepository.updateAssetsV1( return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'album backfill');
data.cast(),
debugLabel: 'album backfill',
);
case SyncEntityType.albumAssetExifV1: case SyncEntityType.albumAssetExifV1:
return _syncStreamRepository.updateAssetsExifV1( return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'album');
data.cast(),
debugLabel: 'album',
);
case SyncEntityType.albumAssetExifBackfillV1: case SyncEntityType.albumAssetExifBackfillV1:
return _syncStreamRepository.updateAssetsExifV1( return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'album backfill');
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( return _syncStreamRepository.updateAlbumToAssetsV1(data.cast(), debugLabel: 'backfill');
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
@@ -218,28 +170,15 @@ 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( return _syncStreamRepository.updateStacksV1(data.cast(), debugLabel: 'partner');
data.cast(),
debugLabel: 'partner',
);
case SyncEntityType.partnerStackBackfillV1: case SyncEntityType.partnerStackBackfillV1:
return _syncStreamRepository.updateStacksV1( return _syncStreamRepository.updateStacksV1(data.cast(), debugLabel: 'partner backfill');
data.cast(),
debugLabel: 'partner backfill',
);
case SyncEntityType.partnerStackDeleteV1: case SyncEntityType.partnerStackDeleteV1:
return _syncStreamRepository.deleteStacksV1( return _syncStreamRepository.deleteStacksV1(data.cast(), debugLabel: 'partner');
data.cast(),
debugLabel: 'partner',
);
case SyncEntityType.userMetadataV1: case SyncEntityType.userMetadataV1:
return _syncStreamRepository.updateUserMetadatasV1( return _syncStreamRepository.updateUserMetadatasV1(data.cast());
data.cast(),
);
case SyncEntityType.userMetadataDeleteV1: case SyncEntityType.userMetadataDeleteV1:
return _syncStreamRepository.deleteUserMetadatasV1( return _syncStreamRepository.deleteUserMetadatasV1(data.cast());
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,28 +10,21 @@ 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( typedef TimelineAssetSource = Future<List<BaseAsset>> Function(int index, int count);
int index,
int count,
);
typedef TimelineBucketSource = Stream<List<Bucket>> Function(); typedef TimelineBucketSource = Stream<List<Bucket>> Function();
typedef TimelineQuery = ({ typedef TimelineQuery = ({TimelineAssetSource assetSource, TimelineBucketSource bucketSource});
TimelineAssetSource assetSource,
TimelineBucketSource bucketSource,
});
class TimelineFactory { class TimelineFactory {
final DriftTimelineRepository _timelineRepository; final DriftTimelineRepository _timelineRepository;
final SettingsService _settingsService; final SettingsService _settingsService;
const TimelineFactory({ const TimelineFactory({required DriftTimelineRepository timelineRepository, required SettingsService settingsService})
required DriftTimelineRepository timelineRepository, : _timelineRepository = timelineRepository,
required SettingsService settingsService, _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)];
@@ -61,7 +54,12 @@ 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 {
@@ -75,17 +73,11 @@ class TimelineService {
int _totalAssets = 0; int _totalAssets = 0;
int get totalAssets => _totalAssets; int get totalAssets => _totalAssets;
TimelineService(TimelineQuery query) TimelineService(TimelineQuery query) : this._(assetSource: query.assetSource, bucketSource: query.bucketSource);
: this._(
assetSource: query.assetSource,
bucketSource: query.bucketSource,
);
TimelineService._({ TimelineService._({required TimelineAssetSource assetSource, required TimelineBucketSource bucketSource})
required TimelineAssetSource assetSource, : _assetSource = assetSource,
required TimelineBucketSource bucketSource, _bucketSource = 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);
@@ -103,10 +95,7 @@ class TimelineService {
count = kTimelineAssetLoadBatchSize; count = kTimelineAssetLoadBatchSize;
} else { } else {
offset = _bufferOffset; offset = _bufferOffset;
count = math.min( count = math.min(_buffer.length, totalAssets - _bufferOffset);
_buffer.length,
totalAssets - _bufferOffset,
);
} }
_buffer = await _assetSource(offset, count); _buffer = await _assetSource(offset, count);
_bufferOffset = offset; _bufferOffset = offset;
@@ -134,10 +123,7 @@ 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( final len = math.max(kTimelineAssetLoadBatchSize, count + kTimelineAssetLoadOppositeSize);
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

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

View File

@@ -66,23 +66,21 @@ 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( ? runInIsolateGentle(computation: (ref) => ref.read(localSyncServiceProvider).sync(full: true))
computation: (ref) => ref.read(localSyncServiceProvider).sync(full: true), : runInIsolateGentle(computation: (ref) => ref.read(localSyncServiceProvider).sync(full: false));
)
: runInIsolateGentle(
computation: (ref) => ref.read(localSyncServiceProvider).sync(full: false),
);
return _deviceAlbumSyncTask!.whenComplete(() { return _deviceAlbumSyncTask!
_deviceAlbumSyncTask = null; .whenComplete(() {
onLocalSyncComplete?.call(); _deviceAlbumSyncTask = null;
}).catchError((error) { onLocalSyncComplete?.call();
onLocalSyncError?.call(error.toString()); })
_deviceAlbumSyncTask = null; .catchError((error) {
}); 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;
@@ -90,17 +88,17 @@ class BackgroundSyncManager {
onHashingStart?.call(); onHashingStart?.call();
_hashTask = runInIsolateGentle( _hashTask = runInIsolateGentle(computation: (ref) => ref.read(hashServiceProvider).hashAssets());
computation: (ref) => ref.read(hashServiceProvider).hashAssets(),
);
return _hashTask!.whenComplete(() { return _hashTask!
onHashingComplete?.call(); .whenComplete(() {
_hashTask = null; onHashingComplete?.call();
}).catchError((error) { _hashTask = null;
onHashingError?.call(error.toString()); })
_hashTask = null; .catchError((error) {
}); onHashingError?.call(error.toString());
_hashTask = null;
});
} }
Future<void> syncRemote() { Future<void> syncRemote() {
@@ -110,16 +108,16 @@ class BackgroundSyncManager {
onRemoteSyncStart?.call(); onRemoteSyncStart?.call();
_syncTask = runInIsolateGentle( _syncTask = runInIsolateGentle(computation: (ref) => ref.read(syncStreamServiceProvider).sync());
computation: (ref) => ref.read(syncStreamServiceProvider).sync(), return _syncTask!
); .whenComplete(() {
return _syncTask!.whenComplete(() { onRemoteSyncComplete?.call();
onRemoteSyncComplete?.call(); _syncTask = null;
_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) {
@@ -133,9 +131,6 @@ class BackgroundSyncManager {
} }
} }
Cancelable<void> _handleWsAssetUploadReadyV1Batch( Cancelable<void> _handleWsAssetUploadReadyV1Batch(List<dynamic> batchData) => runInIsolateGentle(
List<dynamic> batchData, computation: (ref) => ref.read(syncStreamServiceProvider).handleWsAssetUploadReadyV1Batch(batchData),
) => );
runInIsolateGentle(
computation: (ref) => ref.read(syncStreamServiceProvider).handleWsAssetUploadReadyV1Batch(batchData),
);

View File

@@ -28,12 +28,7 @@ class EventStream {
void Function()? onDone, void Function()? onDone,
bool? cancelOnError, bool? cancelOnError,
}) { }) {
return where<T>().listen( return where<T>().listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError);
onData,
onError: onError,
onDone: onDone,
cancelOnError: cancelOnError,
);
} }
/// Closes the stream controller /// Closes the stream controller

View File

@@ -113,10 +113,7 @@ 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( isAtSameMomentAs(lastModifiedAssetTimestamp, other.lastModifiedAssetTimestamp) &&
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 &&
@@ -169,9 +166,7 @@ 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( final users = await db.users.getAllById(dto.albumUsers.map((e) => e.user.id).toList(growable: false));
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,12 +18,9 @@ const AndroidDeviceAssetSchema = CollectionSchema(
name: r'AndroidDeviceAsset', name: r'AndroidDeviceAsset',
id: -6758387181232899335, id: -6758387181232899335,
properties: { properties: {
r'hash': PropertySchema( r'hash': PropertySchema(id: 0, name: r'hash', type: IsarType.byteList),
id: 0,
name: r'hash',
type: IsarType.byteList,
)
}, },
estimateSize: _androidDeviceAssetEstimateSize, estimateSize: _androidDeviceAssetEstimateSize,
serialize: _androidDeviceAssetSerialize, serialize: _androidDeviceAssetSerialize,
deserialize: _androidDeviceAssetDeserialize, deserialize: _androidDeviceAssetDeserialize,
@@ -40,12 +37,13 @@ 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,
@@ -103,12 +101,16 @@ 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, Id id, AndroidDeviceAsset object) { IsarCollection<dynamic> col,
Id id,
AndroidDeviceAsset object,
) {
object.id = id; object.id = id;
} }
@@ -124,17 +126,14 @@ 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( return query.addWhereClause(IdWhereClause.between(lower: id, upper: id));
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
@@ -157,7 +156,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),
@@ -166,7 +165,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),
@@ -175,63 +174,72 @@ 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(IdWhereClause.between( return query.addWhereClause(
lower: lowerId, IdWhereClause.between(
includeLower: includeLower, lower: lowerId,
upper: upperId, includeLower: includeLower,
includeUpper: includeUpper, upper: upperId,
)); 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(IndexWhereClause.equalTo( return query.addWhereClause(
indexName: r'hash', IndexWhereClause.equalTo(indexName: r'hash', value: [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(IndexWhereClause.between( .addWhereClause(
indexName: r'hash', IndexWhereClause.between(
lower: [], indexName: r'hash',
upper: [hash], lower: [],
includeUpper: false, upper: [hash],
)) includeUpper: false,
.addWhereClause(IndexWhereClause.between( ),
indexName: r'hash', )
lower: [hash], .addWhereClause(
includeLower: false, IndexWhereClause.between(
upper: [], indexName: r'hash',
)); lower: [hash],
includeLower: false,
upper: [],
),
);
} else { } else {
return query return query
.addWhereClause(IndexWhereClause.between( .addWhereClause(
indexName: r'hash', IndexWhereClause.between(
lower: [hash], indexName: r'hash',
includeLower: false, lower: [hash],
upper: [], includeLower: false,
)) upper: [],
.addWhereClause(IndexWhereClause.between( ),
indexName: r'hash', )
lower: [], .addWhereClause(
upper: [hash], IndexWhereClause.between(
includeUpper: false, indexName: r'hash',
)); lower: [],
upper: [hash],
includeUpper: false,
),
);
} }
}); });
} }
@@ -240,134 +248,97 @@ 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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'hash', FilterCondition.equalTo(property: r'hash', value: value),
value: value, );
));
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashElementGreaterThan( hashElementGreaterThan(int value, {bool include = false}) {
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'hash', include: include,
value: value, property: r'hash',
)); value: value,
),
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashElementLessThan( hashElementLessThan(int value, {bool include = false}) {
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'hash', include: include,
value: value, property: r'hash',
)); 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(FilterCondition.between( return query.addFilterCondition(
property: r'hash', FilterCondition.between(
lower: lower, property: r'hash',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); 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>
hashIsEmpty() { hashLengthEqualTo(int length) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength( return query.listLength(r'hash', length, true, length, true);
r'hash',
0,
true,
0,
true,
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashIsNotEmpty() { hashIsEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength( return query.listLength(r'hash', 0, true, 0, true);
r'hash',
0,
false,
999999,
true,
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashLengthLessThan( hashIsNotEmpty() {
int length, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength( return query.listLength(r'hash', 0, false, 999999, true);
r'hash',
0,
true,
length,
include,
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashLengthGreaterThan( hashLengthLessThan(int length, {bool include = false}) {
int length, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength( return query.listLength(r'hash', 0, true, length, include);
r'hash',
length,
include,
999999,
true,
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
hashLengthBetween( hashLengthGreaterThan(int length, {bool include = false}) {
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,
@@ -385,58 +356,57 @@ 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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'id', FilterCondition.equalTo(property: r'id', value: value),
value: value, );
));
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
idGreaterThan( idGreaterThan(Id value, {bool include = false}) {
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'id', include: include,
value: value, property: r'id',
)); value: value,
),
);
}); });
} }
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition> QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
idLessThan( idLessThan(Id value, {bool include = false}) {
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'id', include: include,
value: value, property: r'id',
)); 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(FilterCondition.between( return query.addFilterCondition(
property: r'id', FilterCondition.between(
lower: lower, property: r'id',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); includeUpper: includeUpper,
),
);
}); });
} }
} }
@@ -453,14 +423,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);
}); });
@@ -470,7 +440,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,11 +127,7 @@ class Asset {
@Index(unique: false, replace: false, type: IndexType.hash) @Index(unique: false, replace: false, type: IndexType.hash)
String? localId; String? localId;
@Index( @Index(unique: true, replace: false, composite: [CompositeIndex("checksum", type: IndexType.hash)])
unique: true,
replace: false,
composite: [CompositeIndex("checksum", type: IndexType.hash)],
)
int ownerId; int ownerId;
DateTime fileCreatedAt; DateTime fileCreatedAt;
@@ -447,33 +443,32 @@ class Asset {
int? stackCount, int? stackCount,
String? thumbhash, String? thumbhash,
AssetVisibilityEnum? visibility, AssetVisibilityEnum? visibility,
}) => }) => Asset(
Asset( id: id ?? this.id,
id: id ?? this.id, checksum: checksum ?? this.checksum,
checksum: checksum ?? this.checksum, remoteId: remoteId ?? this.remoteId,
remoteId: remoteId ?? this.remoteId, localId: localId ?? this.localId,
localId: localId ?? this.localId, ownerId: ownerId ?? this.ownerId,
ownerId: ownerId ?? this.ownerId, fileCreatedAt: fileCreatedAt ?? this.fileCreatedAt,
fileCreatedAt: fileCreatedAt ?? this.fileCreatedAt, fileModifiedAt: fileModifiedAt ?? this.fileModifiedAt,
fileModifiedAt: fileModifiedAt ?? this.fileModifiedAt, updatedAt: updatedAt ?? this.updatedAt,
updatedAt: updatedAt ?? this.updatedAt, durationInSeconds: durationInSeconds ?? this.durationInSeconds,
durationInSeconds: durationInSeconds ?? this.durationInSeconds, type: type ?? this.type,
type: type ?? this.type, width: width ?? this.width,
width: width ?? this.width, height: height ?? this.height,
height: height ?? this.height, fileName: fileName ?? this.fileName,
fileName: fileName ?? this.fileName, livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId,
livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, isFavorite: isFavorite ?? this.isFavorite,
isFavorite: isFavorite ?? this.isFavorite, isArchived: isArchived ?? this.isArchived,
isArchived: isArchived ?? this.isArchived, isTrashed: isTrashed ?? this.isTrashed,
isTrashed: isTrashed ?? this.isTrashed, isOffline: isOffline ?? this.isOffline,
isOffline: isOffline ?? this.isOffline, exifInfo: exifInfo ?? this.exifInfo,
exifInfo: exifInfo ?? this.exifInfo, stackId: stackId ?? this.stackId,
stackId: stackId ?? this.stackId, stackPrimaryAssetId: stackPrimaryAssetId ?? this.stackPrimaryAssetId,
stackPrimaryAssetId: stackPrimaryAssetId ?? this.stackPrimaryAssetId, stackCount: stackCount ?? this.stackCount,
stackCount: stackCount ?? this.stackCount, thumbhash: thumbhash ?? this.thumbhash,
thumbhash: thumbhash ?? this.thumbhash, visibility: visibility ?? this.visibility,
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);
@@ -494,10 +489,7 @@ class Asset {
return compareByChecksum(a, b); return compareByChecksum(a, b);
} }
static int compareByOwnerChecksumCreatedModified( static int compareByOwnerChecksumCreatedModified(Asset a, Asset b) {
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);
@@ -539,11 +531,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 {
@@ -556,21 +548,17 @@ 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 { enum AssetState { local, remote, merged }
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();
@@ -579,13 +567,9 @@ 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( QueryBuilder<Asset, Asset, QAfterWhereClause> remote(Iterable<String> ids) =>
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( QueryBuilder<Asset, Asset, QAfterWhereClause> local(Iterable<String> ids) {
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,21 +14,9 @@ class BackupAlbum {
Id get isarId => fastHash(id); Id get isarId => fastHash(id);
BackupAlbum copyWith({ BackupAlbum copyWith({String? id, DateTime? lastBackup, BackupSelection? selection}) {
String? id, return BackupAlbum(id ?? this.id, lastBackup ?? this.lastBackup, selection ?? this.selection);
DateTime? lastBackup,
BackupSelection? selection,
}) {
return BackupAlbum(
id ?? this.id,
lastBackup ?? this.lastBackup,
selection ?? this.selection,
);
} }
} }
enum BackupSelection { enum BackupSelection { none, select, exclude }
none,
select,
exclude;
}

View File

@@ -17,11 +17,7 @@ const BackupAlbumSchema = CollectionSchema(
name: r'BackupAlbum', name: r'BackupAlbum',
id: 8308487201128361847, id: 8308487201128361847,
properties: { properties: {
r'id': PropertySchema( r'id': PropertySchema(id: 0, name: r'id', type: IsarType.string),
id: 0,
name: r'id',
type: IsarType.string,
),
r'lastBackup': PropertySchema( r'lastBackup': PropertySchema(
id: 1, id: 1,
name: r'lastBackup', name: r'lastBackup',
@@ -32,8 +28,9 @@ 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,
@@ -42,6 +39,7 @@ const BackupAlbumSchema = CollectionSchema(
indexes: {}, indexes: {},
links: {}, links: {},
embeddedSchemas: {}, embeddedSchemas: {},
getId: _backupAlbumGetId, getId: _backupAlbumGetId,
getLinks: _backupAlbumGetLinks, getLinks: _backupAlbumGetLinks,
attach: _backupAlbumAttach, attach: _backupAlbumAttach,
@@ -96,9 +94,11 @@ 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[ return (_BackupAlbumselectionValueEnumMap[reader.readByteOrNull(
reader.readByteOrNull(offset)] ?? 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,7 +124,10 @@ List<IsarLinkBase<dynamic>> _backupAlbumGetLinks(BackupAlbum object) {
} }
void _backupAlbumAttach( void _backupAlbumAttach(
IsarCollection<dynamic> col, Id id, BackupAlbum object) {} IsarCollection<dynamic> col,
Id id,
BackupAlbum object,
) {}
extension BackupAlbumQueryWhereSort extension BackupAlbumQueryWhereSort
on QueryBuilder<BackupAlbum, BackupAlbum, QWhere> { on QueryBuilder<BackupAlbum, BackupAlbum, QWhere> {
@@ -138,17 +141,18 @@ 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(IdWhereClause.between( return query.addWhereClause(
lower: isarId, IdWhereClause.between(lower: isarId, upper: 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
@@ -171,8 +175,9 @@ 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),
@@ -181,8 +186,9 @@ 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),
@@ -197,12 +203,14 @@ extension BackupAlbumQueryWhere
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause(IdWhereClause.between( return query.addWhereClause(
lower: lowerIsarId, IdWhereClause.between(
includeLower: includeLower, lower: lowerIsarId,
upper: upperIsarId, includeLower: includeLower,
includeUpper: includeUpper, upper: upperIsarId,
)); includeUpper: includeUpper,
),
);
}); });
} }
} }
@@ -214,11 +222,13 @@ extension BackupAlbumQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo( return query.addFilterCondition(
property: r'id', FilterCondition.equalTo(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
@@ -228,12 +238,14 @@ extension BackupAlbumQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'id', include: include,
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
@@ -243,12 +255,14 @@ extension BackupAlbumQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'id', include: include,
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
@@ -260,14 +274,16 @@ extension BackupAlbumQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between( return query.addFilterCondition(
property: r'id', FilterCondition.between(
lower: lower, property: r'id',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
caseSensitive: caseSensitive, includeUpper: includeUpper,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
@@ -276,11 +292,13 @@ extension BackupAlbumQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith( return query.addFilterCondition(
property: r'id', FilterCondition.startsWith(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
@@ -289,77 +307,82 @@ extension BackupAlbumQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith( return query.addFilterCondition(
property: r'id', FilterCondition.endsWith(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); 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(FilterCondition.contains( return query.addFilterCondition(
property: r'id', FilterCondition.contains(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); 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(FilterCondition.matches( return query.addFilterCondition(
property: r'id', FilterCondition.matches(
wildcard: pattern, property: r'id',
caseSensitive: caseSensitive, wildcard: pattern,
)); 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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'id', FilterCondition.equalTo(property: r'id', value: ''),
value: '', );
));
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idIsNotEmpty() { QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idIsNotEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
property: r'id', FilterCondition.greaterThan(property: r'id', value: ''),
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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'isarId', FilterCondition.equalTo(property: r'isarId', value: value),
value: value, );
));
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
isarIdGreaterThan( isarIdGreaterThan(Id value, {bool include = false}) {
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'isarId', include: include,
value: value, property: r'isarId',
)); value: value,
),
);
}); });
} }
@@ -368,11 +391,13 @@ extension BackupAlbumQueryFilter
bool include = false, bool include = false,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'isarId', include: include,
value: value, property: r'isarId',
)); value: value,
),
);
}); });
} }
@@ -383,125 +408,125 @@ extension BackupAlbumQueryFilter
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between( return query.addFilterCondition(
property: r'isarId', FilterCondition.between(
lower: lower, property: r'isarId',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); 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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'lastBackup', FilterCondition.equalTo(property: r'lastBackup', value: value),
value: value, );
));
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
lastBackupGreaterThan( lastBackupGreaterThan(DateTime value, {bool include = false}) {
DateTime value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'lastBackup', include: include,
value: value, property: r'lastBackup',
)); value: value,
),
);
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
lastBackupLessThan( lastBackupLessThan(DateTime value, {bool include = false}) {
DateTime value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'lastBackup', include: include,
value: value, property: r'lastBackup',
)); 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(FilterCondition.between( return query.addFilterCondition(
property: r'lastBackup', FilterCondition.between(
lower: lower, property: r'lastBackup',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); 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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'selection', FilterCondition.equalTo(property: r'selection', value: value),
value: value, );
));
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
selectionGreaterThan( selectionGreaterThan(BackupSelection value, {bool include = false}) {
BackupSelection value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'selection', include: include,
value: value, property: r'selection',
)); value: value,
),
);
}); });
} }
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
selectionLessThan( selectionLessThan(BackupSelection value, {bool include = false}) {
BackupSelection value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'selection', include: include,
value: value, property: r'selection',
)); 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(FilterCondition.between( return query.addFilterCondition(
property: r'selection', FilterCondition.between(
lower: lower, property: r'selection',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); includeUpper: includeUpper,
),
);
}); });
} }
} }
@@ -604,8 +629,9 @@ 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);
}); });
@@ -645,7 +671,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,12 +17,9 @@ const DuplicatedAssetSchema = CollectionSchema(
name: r'DuplicatedAsset', name: r'DuplicatedAsset',
id: -2679334728174694496, id: -2679334728174694496,
properties: { properties: {
r'id': PropertySchema( r'id': PropertySchema(id: 0, name: r'id', type: IsarType.string),
id: 0,
name: r'id',
type: IsarType.string,
)
}, },
estimateSize: _duplicatedAssetEstimateSize, estimateSize: _duplicatedAssetEstimateSize,
serialize: _duplicatedAssetSerialize, serialize: _duplicatedAssetSerialize,
deserialize: _duplicatedAssetDeserialize, deserialize: _duplicatedAssetDeserialize,
@@ -31,6 +28,7 @@ const DuplicatedAssetSchema = CollectionSchema(
indexes: {}, indexes: {},
links: {}, links: {},
embeddedSchemas: {}, embeddedSchemas: {},
getId: _duplicatedAssetGetId, getId: _duplicatedAssetGetId,
getLinks: _duplicatedAssetGetLinks, getLinks: _duplicatedAssetGetLinks,
attach: _duplicatedAssetAttach, attach: _duplicatedAssetAttach,
@@ -62,9 +60,7 @@ DuplicatedAsset _duplicatedAssetDeserialize(
List<int> offsets, List<int> offsets,
Map<Type, List<int>> allOffsets, Map<Type, List<int>> allOffsets,
) { ) {
final object = DuplicatedAsset( final object = DuplicatedAsset(reader.readString(offsets[0]));
reader.readString(offsets[0]),
);
return object; return object;
} }
@@ -91,7 +87,10 @@ List<IsarLinkBase<dynamic>> _duplicatedAssetGetLinks(DuplicatedAsset object) {
} }
void _duplicatedAssetAttach( void _duplicatedAssetAttach(
IsarCollection<dynamic> col, Id id, DuplicatedAsset object) {} IsarCollection<dynamic> col,
Id id,
DuplicatedAsset object,
) {}
extension DuplicatedAssetQueryWhereSort extension DuplicatedAssetQueryWhereSort
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QWhere> { on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QWhere> {
@@ -105,17 +104,16 @@ 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(IdWhereClause.between( return query.addWhereClause(
lower: isarId, IdWhereClause.between(lower: isarId, upper: 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
@@ -138,7 +136,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),
@@ -147,7 +145,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),
@@ -156,19 +154,21 @@ 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(IdWhereClause.between( return query.addWhereClause(
lower: lowerIsarId, IdWhereClause.between(
includeLower: includeLower, lower: lowerIsarId,
upper: upperIsarId, includeLower: includeLower,
includeUpper: includeUpper, upper: upperIsarId,
)); includeUpper: includeUpper,
),
);
}); });
} }
} }
@@ -176,53 +176,52 @@ 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( idEqualTo(String value, {bool caseSensitive = true}) {
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo( return query.addFilterCondition(
property: r'id', FilterCondition.equalTo(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); 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(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'id', include: include,
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idLessThan( idLessThan(String value, {bool include = false, bool caseSensitive = true}) {
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'id', include: include,
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); 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,
@@ -230,140 +229,141 @@ extension DuplicatedAssetQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between( return query.addFilterCondition(
property: r'id', FilterCondition.between(
lower: lower, property: r'id',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
caseSensitive: caseSensitive, includeUpper: includeUpper,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idStartsWith( idStartsWith(String value, {bool caseSensitive = true}) {
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith( return query.addFilterCondition(
property: r'id', FilterCondition.startsWith(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idEndsWith( idEndsWith(String value, {bool caseSensitive = true}) {
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith( return query.addFilterCondition(
property: r'id', FilterCondition.endsWith(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); 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(FilterCondition.contains( return query.addFilterCondition(
property: r'id', FilterCondition.contains(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); 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(FilterCondition.matches( return query.addFilterCondition(
property: r'id', FilterCondition.matches(
wildcard: pattern, property: r'id',
caseSensitive: caseSensitive, wildcard: pattern,
)); 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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'id', FilterCondition.equalTo(property: r'id', value: ''),
value: '', );
));
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
idIsNotEmpty() { idIsNotEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
property: r'id', FilterCondition.greaterThan(property: r'id', value: ''),
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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'isarId', FilterCondition.equalTo(property: r'isarId', value: value),
value: value, );
));
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
isarIdGreaterThan( isarIdGreaterThan(Id value, {bool include = false}) {
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'isarId', include: include,
value: value, property: r'isarId',
)); value: value,
),
);
}); });
} }
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition> QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
isarIdLessThan( isarIdLessThan(Id value, {bool include = false}) {
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'isarId', include: include,
value: value, property: r'isarId',
)); 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(FilterCondition.between( return query.addFilterCondition(
property: r'isarId', FilterCondition.between(
lower: lower, property: r'isarId',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); 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,8 +419,9 @@ 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,17 +22,10 @@ const ETagSchema = CollectionSchema(
name: r'assetCount', name: r'assetCount',
type: IsarType.long, type: IsarType.long,
), ),
r'id': PropertySchema( r'id': PropertySchema(id: 1, name: r'id', type: IsarType.string),
id: 1, r'time': PropertySchema(id: 2, name: r'time', type: IsarType.dateTime),
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,
@@ -49,12 +42,13 @@ 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,
@@ -189,10 +183,9 @@ 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(IdWhereClause.between( return query.addWhereClause(
lower: isarId, IdWhereClause.between(lower: isarId, upper: isarId),
upper: isarId, );
));
}); });
} }
@@ -218,8 +211,10 @@ extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
}); });
} }
QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdGreaterThan(Id isarId, QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdGreaterThan(
{bool include = false}) { 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),
@@ -227,8 +222,10 @@ extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
}); });
} }
QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdLessThan(Id isarId, QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdLessThan(
{bool include = false}) { 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),
@@ -243,21 +240,22 @@ 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(IdWhereClause.between( return query.addWhereClause(
lower: lowerIsarId, IdWhereClause.between(
includeLower: includeLower, lower: lowerIsarId,
upper: upperIsarId, includeLower: includeLower,
includeUpper: includeUpper, upper: upperIsarId,
)); 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(IndexWhereClause.equalTo( return query.addWhereClause(
indexName: r'id', IndexWhereClause.equalTo(indexName: r'id', value: [id]),
value: [id], );
));
}); });
} }
@@ -265,32 +263,40 @@ 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(IndexWhereClause.between( .addWhereClause(
indexName: r'id', IndexWhereClause.between(
lower: [], indexName: r'id',
upper: [id], lower: [],
includeUpper: false, upper: [id],
)) includeUpper: false,
.addWhereClause(IndexWhereClause.between( ),
indexName: r'id', )
lower: [id], .addWhereClause(
includeLower: false, IndexWhereClause.between(
upper: [], indexName: r'id',
)); lower: [id],
includeLower: false,
upper: [],
),
);
} else { } else {
return query return query
.addWhereClause(IndexWhereClause.between( .addWhereClause(
indexName: r'id', IndexWhereClause.between(
lower: [id], indexName: r'id',
includeLower: false, lower: [id],
upper: [], includeLower: false,
)) upper: [],
.addWhereClause(IndexWhereClause.between( ),
indexName: r'id', )
lower: [], .addWhereClause(
upper: [id], IndexWhereClause.between(
includeUpper: false, indexName: r'id',
)); lower: [],
upper: [id],
includeUpper: false,
),
);
} }
}); });
} }
@@ -299,27 +305,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(const FilterCondition.isNull( return query.addFilterCondition(
property: r'assetCount', const FilterCondition.isNull(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(const FilterCondition.isNotNull( return query.addFilterCondition(
property: r'assetCount', const FilterCondition.isNotNull(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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'assetCount', FilterCondition.equalTo(property: r'assetCount', value: value),
value: value, );
));
}); });
} }
@@ -328,11 +334,13 @@ 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(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'assetCount', include: include,
value: value, property: r'assetCount',
)); value: value,
),
);
}); });
} }
@@ -341,11 +349,13 @@ 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(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'assetCount', include: include,
value: value, property: r'assetCount',
)); value: value,
),
);
}); });
} }
@@ -356,13 +366,15 @@ 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(FilterCondition.between( return query.addFilterCondition(
property: r'assetCount', FilterCondition.between(
lower: lower, property: r'assetCount',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); includeUpper: includeUpper,
),
);
}); });
} }
@@ -371,11 +383,13 @@ 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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'id', FilterCondition.equalTo(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
@@ -385,12 +399,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(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'id', include: include,
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
@@ -400,12 +416,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(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'id', include: include,
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
@@ -417,14 +435,16 @@ 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(FilterCondition.between( return query.addFilterCondition(
property: r'id', FilterCondition.between(
lower: lower, property: r'id',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
caseSensitive: caseSensitive, includeUpper: includeUpper,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
@@ -433,11 +453,13 @@ 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(FilterCondition.startsWith( return query.addFilterCondition(
property: r'id', FilterCondition.startsWith(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
@@ -446,60 +468,67 @@ 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(FilterCondition.endsWith( return query.addFilterCondition(
property: r'id', FilterCondition.endsWith(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> idContains(String value, QueryBuilder<ETag, ETag, QAfterFilterCondition> idContains(
{bool caseSensitive = true}) { String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.contains( return query.addFilterCondition(
property: r'id', FilterCondition.contains(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> idMatches(String pattern, QueryBuilder<ETag, ETag, QAfterFilterCondition> idMatches(
{bool caseSensitive = true}) { String pattern, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.matches( return query.addFilterCondition(
property: r'id', FilterCondition.matches(
wildcard: pattern, property: r'id',
caseSensitive: caseSensitive, wildcard: pattern,
)); 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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'id', FilterCondition.equalTo(property: r'id', value: ''),
value: '', );
));
}); });
} }
QueryBuilder<ETag, ETag, QAfterFilterCondition> idIsNotEmpty() { QueryBuilder<ETag, ETag, QAfterFilterCondition> idIsNotEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
property: r'id', FilterCondition.greaterThan(property: r'id', value: ''),
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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'isarId', FilterCondition.equalTo(property: r'isarId', value: value),
value: value, );
));
}); });
} }
@@ -508,11 +537,13 @@ 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(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'isarId', include: include,
value: value, property: r'isarId',
)); value: value,
),
);
}); });
} }
@@ -521,11 +552,13 @@ 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(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'isarId', include: include,
value: value, property: r'isarId',
)); value: value,
),
);
}); });
} }
@@ -536,38 +569,39 @@ 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(FilterCondition.between( return query.addFilterCondition(
property: r'isarId', FilterCondition.between(
lower: lower, property: r'isarId',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); 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(const FilterCondition.isNull( return query.addFilterCondition(
property: r'time', const FilterCondition.isNull(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(const FilterCondition.isNotNull( return query.addFilterCondition(
property: r'time', const FilterCondition.isNotNull(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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'time', FilterCondition.equalTo(property: r'time', value: value),
value: value, );
));
}); });
} }
@@ -576,11 +610,13 @@ 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(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'time', include: include,
value: value, property: r'time',
)); value: value,
),
);
}); });
} }
@@ -589,11 +625,13 @@ 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(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'time', include: include,
value: value, property: r'time',
)); value: value,
),
);
}); });
} }
@@ -604,13 +642,15 @@ 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(FilterCondition.between( return query.addFilterCondition(
property: r'time', FilterCondition.between(
lower: lower, property: r'time',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); includeUpper: includeUpper,
),
);
}); });
} }
} }
@@ -714,8 +754,9 @@ 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,17 +17,10 @@ const IOSDeviceAssetSchema = CollectionSchema(
name: r'IOSDeviceAsset', name: r'IOSDeviceAsset',
id: -1671546753821948030, id: -1671546753821948030,
properties: { properties: {
r'hash': PropertySchema( r'hash': PropertySchema(id: 0, name: r'hash', type: IsarType.byteList),
id: 0, r'id': PropertySchema(id: 1, name: r'id', type: IsarType.string),
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,
@@ -44,7 +37,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(
@@ -57,12 +50,13 @@ 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,
@@ -128,7 +122,10 @@ List<IsarLinkBase<dynamic>> _iOSDeviceAssetGetLinks(IOSDeviceAsset object) {
} }
void _iOSDeviceAssetAttach( void _iOSDeviceAssetAttach(
IsarCollection<dynamic> col, Id id, IOSDeviceAsset object) {} IsarCollection<dynamic> col,
Id id,
IOSDeviceAsset object,
) {}
extension IOSDeviceAssetByIndex on IsarCollection<IOSDeviceAsset> { extension IOSDeviceAssetByIndex on IsarCollection<IOSDeviceAsset> {
Future<IOSDeviceAsset?> getById(String id) { Future<IOSDeviceAsset?> getById(String id) {
@@ -179,8 +176,10 @@ extension IOSDeviceAssetByIndex on IsarCollection<IOSDeviceAsset> {
return putAllByIndex(r'id', objects); return putAllByIndex(r'id', objects);
} }
List<Id> putAllByIdSync(List<IOSDeviceAsset> objects, List<Id> putAllByIdSync(
{bool saveLinks = true}) { List<IOSDeviceAsset> objects, {
bool saveLinks = true,
}) {
return putAllByIndexSync(r'id', objects, saveLinks: saveLinks); return putAllByIndexSync(r'id', objects, saveLinks: saveLinks);
} }
} }
@@ -197,17 +196,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(IdWhereClause.between( return query.addWhereClause(
lower: isarId, IdWhereClause.between(lower: isarId, upper: 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
@@ -230,7 +229,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),
@@ -239,7 +238,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),
@@ -254,101 +253,120 @@ extension IOSDeviceAssetQueryWhere
bool includeUpper = true, bool includeUpper = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addWhereClause(IdWhereClause.between( return query.addWhereClause(
lower: lowerIsarId, IdWhereClause.between(
includeLower: includeLower, lower: lowerIsarId,
upper: upperIsarId, includeLower: includeLower,
includeUpper: includeUpper, upper: upperIsarId,
)); 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(IndexWhereClause.equalTo( return query.addWhereClause(
indexName: r'id', IndexWhereClause.equalTo(indexName: r'id', value: [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(IndexWhereClause.between( .addWhereClause(
indexName: r'id', IndexWhereClause.between(
lower: [], indexName: r'id',
upper: [id], lower: [],
includeUpper: false, upper: [id],
)) includeUpper: false,
.addWhereClause(IndexWhereClause.between( ),
indexName: r'id', )
lower: [id], .addWhereClause(
includeLower: false, IndexWhereClause.between(
upper: [], indexName: r'id',
)); lower: [id],
includeLower: false,
upper: [],
),
);
} else { } else {
return query return query
.addWhereClause(IndexWhereClause.between( .addWhereClause(
indexName: r'id', IndexWhereClause.between(
lower: [id], indexName: r'id',
includeLower: false, lower: [id],
upper: [], includeLower: false,
)) upper: [],
.addWhereClause(IndexWhereClause.between( ),
indexName: r'id', )
lower: [], .addWhereClause(
upper: [id], IndexWhereClause.between(
includeUpper: false, indexName: r'id',
)); 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(IndexWhereClause.equalTo( return query.addWhereClause(
indexName: r'hash', IndexWhereClause.equalTo(indexName: r'hash', value: [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(IndexWhereClause.between( .addWhereClause(
indexName: r'hash', IndexWhereClause.between(
lower: [], indexName: r'hash',
upper: [hash], lower: [],
includeUpper: false, upper: [hash],
)) includeUpper: false,
.addWhereClause(IndexWhereClause.between( ),
indexName: r'hash', )
lower: [hash], .addWhereClause(
includeLower: false, IndexWhereClause.between(
upper: [], indexName: r'hash',
)); lower: [hash],
includeLower: false,
upper: [],
),
);
} else { } else {
return query return query
.addWhereClause(IndexWhereClause.between( .addWhereClause(
indexName: r'hash', IndexWhereClause.between(
lower: [hash], indexName: r'hash',
includeLower: false, lower: [hash],
upper: [], includeLower: false,
)) upper: [],
.addWhereClause(IndexWhereClause.between( ),
indexName: r'hash', )
lower: [], .addWhereClause(
upper: [hash], IndexWhereClause.between(
includeUpper: false, indexName: r'hash',
)); lower: [],
upper: [hash],
includeUpper: false,
),
);
} }
}); });
} }
@@ -357,134 +375,97 @@ 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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'hash', FilterCondition.equalTo(property: r'hash', value: value),
value: value, );
));
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashElementGreaterThan( hashElementGreaterThan(int value, {bool include = false}) {
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'hash', include: include,
value: value, property: r'hash',
)); value: value,
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashElementLessThan( hashElementLessThan(int value, {bool include = false}) {
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'hash', include: include,
value: value, property: r'hash',
)); 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(FilterCondition.between( return query.addFilterCondition(
property: r'hash', FilterCondition.between(
lower: lower, property: r'hash',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); 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>
hashIsEmpty() { hashLengthEqualTo(int length) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength( return query.listLength(r'hash', length, true, length, true);
r'hash',
0,
true,
0,
true,
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashIsNotEmpty() { hashIsEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength( return query.listLength(r'hash', 0, true, 0, true);
r'hash',
0,
false,
999999,
true,
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashLengthLessThan( hashIsNotEmpty() {
int length, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength( return query.listLength(r'hash', 0, false, 999999, true);
r'hash',
0,
true,
length,
include,
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashLengthGreaterThan( hashLengthLessThan(int length, {bool include = false}) {
int length, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength( return query.listLength(r'hash', 0, true, length, include);
r'hash',
length,
include,
999999,
true,
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
hashLengthBetween( hashLengthGreaterThan(int length, {bool include = false}) {
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,
@@ -506,43 +487,45 @@ extension IOSDeviceAssetQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo( return query.addFilterCondition(
property: r'id', FilterCondition.equalTo(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); 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(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'id', include: include,
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
idLessThan( idLessThan(String value, {bool include = false, bool caseSensitive = true}) {
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'id', include: include,
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
@@ -554,141 +537,143 @@ extension IOSDeviceAssetQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between( return query.addFilterCondition(
property: r'id', FilterCondition.between(
lower: lower, property: r'id',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
caseSensitive: caseSensitive, includeUpper: includeUpper,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
idStartsWith( idStartsWith(String value, {bool caseSensitive = true}) {
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith( return query.addFilterCondition(
property: r'id', FilterCondition.startsWith(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
idEndsWith( idEndsWith(String value, {bool caseSensitive = true}) {
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith( return query.addFilterCondition(
property: r'id', FilterCondition.endsWith(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); 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(FilterCondition.contains( return query.addFilterCondition(
property: r'id', FilterCondition.contains(
value: value, property: r'id',
caseSensitive: caseSensitive, value: value,
)); 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(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.matches(
property: r'isarId', property: r'id',
value: value, wildcard: pattern,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
isarIdLessThan( idIsEmpty() {
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.equalTo(property: r'id', value: ''),
property: r'isarId', );
value: value,
));
}); });
} }
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
isarIdBetween( 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 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(FilterCondition.between( return query.addFilterCondition(
property: r'isarId', FilterCondition.between(
lower: lower, property: r'isarId',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); includeUpper: includeUpper,
),
);
}); });
} }
} }
@@ -735,7 +720,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);
}); });
@@ -750,8 +735,9 @@ 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);
void save() { Future<void> save() async {
final b64Str = base64Encode(data); final b64Str = base64Encode(data);
Store.put(StoreKey.sslClientCertData, b64Str); await Store.put(StoreKey.sslClientCertData, b64Str);
if (password != null) { if (password != null) {
Store.put(StoreKey.sslClientPasswd, password!); await Store.put(StoreKey.sslClientPasswd, password!);
} }
} }
@@ -31,8 +31,8 @@ class SSLClientCertStoreVal {
return SSLClientCertStoreVal(certData, passwd); return SSLClientCertStoreVal(certData, passwd);
} }
static void delete() { static Future<void> delete() async {
Store.delete(StoreKey.sslClientCertData); await Store.delete(StoreKey.sslClientCertData);
Store.delete(StoreKey.sslClientPasswd); await Store.delete(StoreKey.sslClientPasswd);
} }
} }

View File

@@ -15,16 +15,10 @@ 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( RegExp re = RegExp(r'^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$', caseSensitive: false);
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( final duration = Duration(hours: int.parse(m.group(1) ?? '0'), minutes: int.parse(m.group(2) ?? '0'));
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,10 +6,7 @@ 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({ List<E> uniqueConsecutive({int Function(E a, E b)? compare, void Function(E a, E b)? onDuplicate}) {
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++) {
@@ -45,9 +42,7 @@ 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({ Iterable<Asset> remoteOnly({void Function()? errorCallback}) {
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();
@@ -58,10 +53,7 @@ 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( Iterable<Asset> ownedOnly(UserDto? owner, {void Function()? errorCallback}) {
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,11 +47,7 @@ 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( static String formatDateRange(DateTime startDate, DateTime endDate, Locale? locale) {
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,9 +13,7 @@ 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( GeojsonSourceProperties(data: MapUtils.generateGeoJsonForMarkers(markers.toList())),
data: MapUtils.generateGeoJsonForMarkers(markers.toList()),
),
); );
} }
@@ -73,23 +71,13 @@ 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( return addSymbol(SymbolOptions(geometry: centre, iconImage: "mapMarker", iconSize: 0.15, iconAnchor: "bottom"));
SymbolOptions(
geometry: centre,
iconImage: "mapMarker",
iconSize: 0.15,
iconAnchor: "bottom",
),
);
} finally { } finally {
// no-op // no-op
} }
} }
Future<LatLngBounds> getBoundsFromPoint( Future<LatLngBounds> getBoundsFromPoint(Point<double> point, double distance) async {
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,11 +10,7 @@ class FastScrollPhysics extends ScrollPhysics {
} }
@override @override
SpringDescription get spring => const SpringDescription( SpringDescription get spring => const SpringDescription(mass: 1, stiffness: 402.49984375, damping: 40);
mass: 1,
stiffness: 402.49984375,
damping: 40,
);
} }
class FastClampingScrollPhysics extends ClampingScrollPhysics { class FastClampingScrollPhysics extends ClampingScrollPhysics {
@@ -27,12 +23,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,10 +1,6 @@
extension StringExtension on String { extension StringExtension on String {
String capitalize() { String capitalize() {
return split(" ") return split(" ").map((str) => str.isEmpty ? str : str[0].toUpperCase() + str.substring(1)).join(" ");
.map(
(str) => str.isEmpty ? str : str[0].toUpperCase() + str.substring(1),
)
.join(" ");
} }
} }

View File

@@ -7,16 +7,10 @@ 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( return Color.alphaBlend(Colors.white.withValues(alpha: amount), this);
Colors.white.withValues(alpha: amount),
this,
);
} }
Color darken({double amount = 0.1}) { Color darken({double amount = 0.1}) {
return Color.alphaBlend( return Color.alphaBlend(Colors.black.withValues(alpha: amount), this);
Colors.black.withValues(alpha: amount),
this,
);
} }
} }

View File

@@ -29,11 +29,7 @@ extension TextTranslateExtension on Text {
} }
} }
String _translateHelper( String _translateHelper(BuildContext? context, String key, [Map<String, Object>? args]) {
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

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

View File

@@ -17,22 +17,15 @@ const DeviceAssetEntitySchema = CollectionSchema(
name: r'DeviceAssetEntity', name: r'DeviceAssetEntity',
id: 6967030785073446271, id: 6967030785073446271,
properties: { properties: {
r'assetId': PropertySchema( r'assetId': PropertySchema(id: 0, name: r'assetId', type: IsarType.string),
id: 0, r'hash': PropertySchema(id: 1, name: r'hash', type: IsarType.byteList),
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,
@@ -49,7 +42,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(
@@ -62,12 +55,13 @@ 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,
@@ -133,12 +127,16 @@ 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, Id id, DeviceAssetEntity object) {} IsarCollection<dynamic> col,
Id id,
DeviceAssetEntity object,
) {}
extension DeviceAssetEntityByIndex on IsarCollection<DeviceAssetEntity> { extension DeviceAssetEntityByIndex on IsarCollection<DeviceAssetEntity> {
Future<DeviceAssetEntity?> getByAssetId(String assetId) { Future<DeviceAssetEntity?> getByAssetId(String assetId) {
@@ -189,8 +187,10 @@ extension DeviceAssetEntityByIndex on IsarCollection<DeviceAssetEntity> {
return putAllByIndex(r'assetId', objects); return putAllByIndex(r'assetId', objects);
} }
List<Id> putAllByAssetIdSync(List<DeviceAssetEntity> objects, List<Id> putAllByAssetIdSync(
{bool saveLinks = true}) { List<DeviceAssetEntity> objects, {
bool saveLinks = true,
}) {
return putAllByIndexSync(r'assetId', objects, saveLinks: saveLinks); return putAllByIndexSync(r'assetId', objects, saveLinks: saveLinks);
} }
} }
@@ -207,17 +207,14 @@ 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( return query.addWhereClause(IdWhereClause.between(lower: id, upper: id));
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
@@ -240,7 +237,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),
@@ -249,7 +246,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),
@@ -258,108 +255,124 @@ 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(IdWhereClause.between( return query.addWhereClause(
lower: lowerId, IdWhereClause.between(
includeLower: includeLower, lower: lowerId,
upper: upperId, includeLower: includeLower,
includeUpper: includeUpper, upper: upperId,
)); 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(IndexWhereClause.equalTo( return query.addWhereClause(
indexName: r'assetId', IndexWhereClause.equalTo(indexName: r'assetId', value: [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(IndexWhereClause.between( .addWhereClause(
indexName: r'assetId', IndexWhereClause.between(
lower: [], indexName: r'assetId',
upper: [assetId], lower: [],
includeUpper: false, upper: [assetId],
)) includeUpper: false,
.addWhereClause(IndexWhereClause.between( ),
indexName: r'assetId', )
lower: [assetId], .addWhereClause(
includeLower: false, IndexWhereClause.between(
upper: [], indexName: r'assetId',
)); lower: [assetId],
includeLower: false,
upper: [],
),
);
} else { } else {
return query return query
.addWhereClause(IndexWhereClause.between( .addWhereClause(
indexName: r'assetId', IndexWhereClause.between(
lower: [assetId], indexName: r'assetId',
includeLower: false, lower: [assetId],
upper: [], includeLower: false,
)) upper: [],
.addWhereClause(IndexWhereClause.between( ),
indexName: r'assetId', )
lower: [], .addWhereClause(
upper: [assetId], IndexWhereClause.between(
includeUpper: false, indexName: r'assetId',
)); 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(IndexWhereClause.equalTo( return query.addWhereClause(
indexName: r'hash', IndexWhereClause.equalTo(indexName: r'hash', value: [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(IndexWhereClause.between( .addWhereClause(
indexName: r'hash', IndexWhereClause.between(
lower: [], indexName: r'hash',
upper: [hash], lower: [],
includeUpper: false, upper: [hash],
)) includeUpper: false,
.addWhereClause(IndexWhereClause.between( ),
indexName: r'hash', )
lower: [hash], .addWhereClause(
includeLower: false, IndexWhereClause.between(
upper: [], indexName: r'hash',
)); lower: [hash],
includeLower: false,
upper: [],
),
);
} else { } else {
return query return query
.addWhereClause(IndexWhereClause.between( .addWhereClause(
indexName: r'hash', IndexWhereClause.between(
lower: [hash], indexName: r'hash',
includeLower: false, lower: [hash],
upper: [], includeLower: false,
)) upper: [],
.addWhereClause(IndexWhereClause.between( ),
indexName: r'hash', )
lower: [], .addWhereClause(
upper: [hash], IndexWhereClause.between(
includeUpper: false, indexName: r'hash',
)); lower: [],
upper: [hash],
includeUpper: false,
),
);
} }
}); });
} }
@@ -368,53 +381,56 @@ 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( assetIdEqualTo(String value, {bool caseSensitive = true}) {
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo( return query.addFilterCondition(
property: r'assetId', FilterCondition.equalTo(
value: value, property: r'assetId',
caseSensitive: caseSensitive, value: value,
)); 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(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'assetId', include: include,
value: value, property: r'assetId',
caseSensitive: caseSensitive, value: value,
)); 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(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'assetId', include: include,
value: value, property: r'assetId',
caseSensitive: caseSensitive, value: value,
)); 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,
@@ -422,216 +438,181 @@ extension DeviceAssetEntityQueryFilter
bool caseSensitive = true, bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between( return query.addFilterCondition(
property: r'assetId', FilterCondition.between(
lower: lower, property: r'assetId',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
caseSensitive: caseSensitive, includeUpper: includeUpper,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdStartsWith( assetIdStartsWith(String value, {bool caseSensitive = true}) {
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith( return query.addFilterCondition(
property: r'assetId', FilterCondition.startsWith(
value: value, property: r'assetId',
caseSensitive: caseSensitive, value: value,
)); caseSensitive: caseSensitive,
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdEndsWith( assetIdEndsWith(String value, {bool caseSensitive = true}) {
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith( return query.addFilterCondition(
property: r'assetId', FilterCondition.endsWith(
value: value, property: r'assetId',
caseSensitive: caseSensitive, value: value,
)); 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(FilterCondition.contains( return query.addFilterCondition(
property: r'assetId', FilterCondition.contains(
value: value, property: r'assetId',
caseSensitive: caseSensitive, value: value,
)); 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(FilterCondition.matches( return query.addFilterCondition(
property: r'assetId', FilterCondition.matches(
wildcard: pattern, property: r'assetId',
caseSensitive: caseSensitive, wildcard: pattern,
)); 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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'assetId', FilterCondition.equalTo(property: r'assetId', value: ''),
value: '', );
));
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
assetIdIsNotEmpty() { assetIdIsNotEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
property: r'assetId', FilterCondition.greaterThan(property: r'assetId', value: ''),
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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'hash', FilterCondition.equalTo(property: r'hash', value: value),
value: value, );
));
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
hashElementGreaterThan( hashElementGreaterThan(int value, {bool include = false}) {
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'hash', include: include,
value: value, property: r'hash',
)); value: value,
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
hashElementLessThan( hashElementLessThan(int value, {bool include = false}) {
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'hash', include: include,
value: value, property: r'hash',
)); 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(FilterCondition.between( return query.addFilterCondition(
property: r'hash', FilterCondition.between(
lower: lower, property: r'hash',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); 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>
hashIsEmpty() { hashLengthEqualTo(int length) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength( return query.listLength(r'hash', length, true, length, true);
r'hash',
0,
true,
0,
true,
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
hashIsNotEmpty() { hashIsEmpty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength( return query.listLength(r'hash', 0, true, 0, true);
r'hash',
0,
false,
999999,
true,
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
hashLengthLessThan( hashIsNotEmpty() {
int length, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength( return query.listLength(r'hash', 0, false, 999999, true);
r'hash',
0,
true,
length,
include,
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
hashLengthGreaterThan( hashLengthLessThan(int length, {bool include = false}) {
int length, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.listLength( return query.listLength(r'hash', 0, true, length, include);
r'hash',
length,
include,
999999,
true,
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
hashLengthBetween( hashLengthGreaterThan(int length, {bool include = false}) {
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,
@@ -649,114 +630,112 @@ 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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'id', FilterCondition.equalTo(property: r'id', value: value),
value: value, );
));
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
idGreaterThan( idGreaterThan(Id value, {bool include = false}) {
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'id', include: include,
value: value, property: r'id',
)); value: value,
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
idLessThan( idLessThan(Id value, {bool include = false}) {
Id value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'id', include: include,
value: value, property: r'id',
)); 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(FilterCondition.between( return query.addFilterCondition(
property: r'id', FilterCondition.between(
lower: lower, property: r'id',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); 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(FilterCondition.equalTo( return query.addFilterCondition(
property: r'modifiedTime', FilterCondition.equalTo(property: r'modifiedTime', value: value),
value: value, );
));
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
modifiedTimeGreaterThan( modifiedTimeGreaterThan(DateTime value, {bool include = false}) {
DateTime value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(
include: include, FilterCondition.greaterThan(
property: r'modifiedTime', include: include,
value: value, property: r'modifiedTime',
)); value: value,
),
);
}); });
} }
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition> QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
modifiedTimeLessThan( modifiedTimeLessThan(DateTime value, {bool include = false}) {
DateTime value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(
include: include, FilterCondition.lessThan(
property: r'modifiedTime', include: include,
value: value, property: r'modifiedTime',
)); 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(FilterCondition.between( return query.addFilterCondition(
property: r'modifiedTime', FilterCondition.between(
lower: lower, property: r'modifiedTime',
includeLower: includeLower, lower: lower,
upper: upper, includeLower: includeLower,
includeUpper: includeUpper, upper: upper,
)); includeUpper: includeUpper,
),
);
}); });
} }
} }
@@ -770,28 +749,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);
}); });
@@ -801,14 +780,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);
}); });
@@ -821,21 +800,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);
}); });
@@ -845,21 +824,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');
}); });
@@ -887,7 +866,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');
}); });

View File

@@ -52,49 +52,50 @@ class ExifInfo {
}); });
static ExifInfo fromDto(domain.ExifInfo dto) => ExifInfo( static ExifInfo fromDto(domain.ExifInfo dto) => ExifInfo(
id: dto.assetId, id: dto.assetId,
fileSize: dto.fileSize, fileSize: dto.fileSize,
dateTimeOriginal: dto.dateTimeOriginal, dateTimeOriginal: dto.dateTimeOriginal,
timeZone: dto.timeZone, timeZone: dto.timeZone,
make: dto.make, make: dto.make,
model: dto.model, model: dto.model,
lens: dto.lens, lens: dto.lens,
f: dto.f, f: dto.f,
mm: dto.mm, mm: dto.mm,
iso: dto.iso?.toInt(), iso: dto.iso?.toInt(),
exposureSeconds: dto.exposureSeconds, exposureSeconds: dto.exposureSeconds,
lat: dto.latitude, lat: dto.latitude,
long: dto.longitude, long: dto.longitude,
city: dto.city, city: dto.city,
state: dto.state, state: dto.state,
country: dto.country, country: dto.country,
description: dto.description, description: dto.description,
orientation: dto.orientation, orientation: dto.orientation,
); );
domain.ExifInfo toDto() => domain.ExifInfo( domain.ExifInfo toDto() => domain.ExifInfo(
assetId: id, assetId: id,
fileSize: fileSize, fileSize: fileSize,
description: description, description: description,
orientation: orientation, orientation: orientation,
timeZone: timeZone, timeZone: timeZone,
dateTimeOriginal: dateTimeOriginal, dateTimeOriginal: dateTimeOriginal,
isFlipped: ExifDtoConverter.isOrientationFlipped(orientation), isFlipped: ExifDtoConverter.isOrientationFlipped(orientation),
latitude: lat, latitude: lat,
longitude: long, longitude: long,
city: city, city: city,
state: state, state: state,
country: country, country: country,
make: make, make: make,
model: model, model: model,
lens: lens, lens: lens,
f: f, f: f,
mm: mm, mm: mm,
iso: iso?.toInt(), iso: iso?.toInt(),
exposureSeconds: exposureSeconds, exposureSeconds: exposureSeconds,
); );
} }
@TableIndex(name: 'idx_lat_lng', columns: {#latitude, #longitude})
class RemoteExifEntity extends Table with DriftDefaultsMixin { class RemoteExifEntity extends Table with DriftDefaultsMixin {
const RemoteExifEntity(); const RemoteExifEntity();
@@ -148,24 +149,24 @@ class RemoteExifEntity extends Table with DriftDefaultsMixin {
extension RemoteExifEntityDataDomainEx on RemoteExifEntityData { extension RemoteExifEntityDataDomainEx on RemoteExifEntityData {
domain.ExifInfo toDto() => domain.ExifInfo( domain.ExifInfo toDto() => domain.ExifInfo(
fileSize: fileSize, fileSize: fileSize,
dateTimeOriginal: dateTimeOriginal, dateTimeOriginal: dateTimeOriginal,
timeZone: timeZone, timeZone: timeZone,
make: make, make: make,
model: model, model: model,
iso: iso, iso: iso,
city: city, city: city,
state: state, state: state,
country: country, country: country,
description: description, description: description,
orientation: orientation, orientation: orientation,
latitude: latitude, latitude: latitude,
longitude: longitude, longitude: longitude,
f: fNumber?.toDouble(), f: fNumber?.toDouble(),
mm: focalLength?.toDouble(), mm: focalLength?.toDouble(),
lens: lens, lens: lens,
width: width?.toDouble(), width: width?.toDouble(),
height: height?.toDouble(), height: height?.toDouble(),
isFlipped: ExifDtoConverter.isOrientationFlipped(orientation), isFlipped: ExifDtoConverter.isOrientationFlipped(orientation),
); );
} }

File diff suppressed because it is too large Load Diff

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