Compare commits

...

124 Commits

Author SHA1 Message Date
Prateek Sunal
b35849d31e fix: try to initialize the db and access it correctly 2025-08-26 13:43:13 +05:30
Neeraj
923f2484fb [auth] Fix missing token (#6971)
## Description
When using Auth without backup, it was giving a error `Offline key is
missing`

**Reason**: During the `init` of `BaseConfiguration` if the `tokenKey`
is not set, we clear all the keys in the secure storage, and in this
process the `offlineAuthSecretKey` was also getting cleared

**Fix** Fixed by skipping the deletion of `offlineAuthSecretKey`  

## Tests
[Test Video](https://wormhole.app/qz3mol#Dlhr0NRpVQVQsrid2X-quA)
2025-08-26 13:02:43 +05:30
AmanRajSinghMourya
37928cd2c6 Code refractoring 2025-08-26 12:40:03 +05:30
AmanRajSinghMourya
fc32ba97c1 Refactor BaseConfiguration to ensure preserved keys are not deleted 2025-08-26 12:26:01 +05:30
AmanRajSinghMourya
e49084867e Revert "Refactor BaseConfiguration to preserve offlineAuthSecretKey during logout"
This reverts commit 5b5f563d47.
2025-08-26 12:21:00 +05:30
Laurens Priem
a046748ded [mob][photos] Minor fixes and changes (#6969)
## Description

Minor fixes and changes based on testing.

## Tests

Tested in debug mode on my pixel phone.
2025-08-26 10:08:42 +05:30
laurenspriem
047d708ef1 Merge branch 'main' into fix_modal 2025-08-26 10:08:18 +05:30
AmanRajSinghMourya
5b5f563d47 Refactor BaseConfiguration to preserve offlineAuthSecretKey during logout 2025-08-26 10:02:19 +05:30
Ashil
2b60ad3748 [mob][packages] Organize imports (#6968) 2025-08-26 10:01:40 +05:30
Neeraj
1f70043c83 [mob][photos] video streaming settings & create/recreate stream (#6923) 2025-08-26 10:00:08 +05:30
laurenspriem
7ce6f6a346 Check symlink permissions 2025-08-26 09:55:17 +05:30
ashilkn
03814bff0c Organize imports 2025-08-26 09:34:00 +05:30
laurenspriem
4c63a0ff13 Copy changes 2025-08-26 09:21:59 +05:30
laurenspriem
93552fb872 vectorDB flag check ML enabled 2025-08-26 09:05:06 +05:30
laurenspriem
1b61becdcf Fix modal on group-level delete 2025-08-26 08:37:16 +05:30
Prateek Sunal
0499cad3c9 chore: ignore generated mocks file 2025-08-26 04:48:32 +05:30
Prateek Sunal
79752ef4b8 chore: update file name 2025-08-26 04:35:51 +05:30
Prateek Sunal
c1bd6d3fdb Merge branch 'taking-streaming-oob' of https://github.com/ente-io/ente into taking-streaming-oob 2025-08-26 04:35:30 +05:30
Prateek Sunal
621423d9a4 fix: refactor code 2025-08-26 04:35:27 +05:30
Prateek Sunal
edb11c89ba fix: update mobile/apps/photos/lib/ui/settings/streaming/video_streaming_settings_page.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-26 04:31:44 +05:30
Prateek Sunal
adb71fe09c fix: update mobile/apps/photos/lib/services/video_preview_service.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-26 04:31:12 +05:30
Prateek Sunal
c20cee2406 feat: state update event, tests, total logic 2025-08-26 04:27:38 +05:30
Prateek Sunal
dcfad86c47 fix: ensure preview ids are present 2025-08-25 23:32:57 +05:30
Prateek Sunal
0a2bff67bf fix: delete file from upload locks db if not found 2025-08-25 23:31:51 +05:30
Prateek Sunal
7aaa689cfb fix: simplify logic 2025-08-25 23:26:34 +05:30
Prateek Sunal
ad2a0ce897 refactor: simplify StreamingStatus handling in VideoPreviewService 2025-08-25 23:22:39 +05:30
Prateek Sunal
d99615b24f fix: remove skipped 2025-08-25 22:16:22 +05:30
Prateek Sunal
09cc48ae55 fix: add comments 2025-08-25 21:50:07 +05:30
Prateek Sunal
6ab2223a80 fix: mostly all review comments 2025-08-25 21:42:40 +05:30
Prateek Sunal
6fd86162e0 Merge remote-tracking branch 'origin/main' into taking-streaming-oob 2025-08-25 20:58:09 +05:30
Prateek Sunal
707e8dbfcf fix: show processing status, fix when to not show popup buttons, update getFiles logic 2025-08-25 20:57:18 +05:30
Prateek Sunal
5869bec781 feat: create and recreate stream buttons 2025-08-25 20:11:08 +05:30
Laurens Priem
e311a8bb32 [mob][photos] Similar images UI (#6963)
## Description

Minor fixes and UI changes.

## Tests

Tested in debug mode on my pixel phone.
2025-08-25 16:55:29 +05:30
laurenspriem
547ccfceca Use shared preferences for tracking migration 2025-08-25 16:53:33 +05:30
Keerthana
3a1917949b [mobile/photos] New translations (#6955)
New translations from
[Crowdin](https://crowdin.com/project/ente-photos-app)
2025-08-25 13:30:03 +05:30
Keerthana
3a1ce3258e [auth] New translations (#6956)
New translations from
[Crowdin](https://crowdin.com/project/ente-authenticator-app)
2025-08-25 13:10:39 +05:30
Prateek Sunal
13b2542bea fix: update logic 2025-08-25 12:02:56 +05:30
Prateek Sunal
6db3741a3b Merge remote-tracking branch 'origin/main' into taking-streaming-oob 2025-08-25 11:48:49 +05:30
laurenspriem
ce17eccd68 Fix delete issue 2025-08-25 11:11:57 +05:30
Ashil
95dc683088 Update internal change log (#6959) 2025-08-25 11:11:28 +05:30
Neeraj
cf9d5f72f7 [mob] Fix query for duplicate cleanup (#6962)
## Description
Only consider owned files
## Tests
2025-08-25 11:10:36 +05:30
Neeraj Gupta
3096e1550a Merge remote-tracking branch 'origin/main' into fixQuery 2025-08-25 11:03:45 +05:30
Neeraj Gupta
1b39435735 Fix query 2025-08-25 11:02:25 +05:30
laurenspriem
8f3d8505bb Better UI when selection is not possible 2025-08-25 11:02:03 +05:30
Manav Rathi
47e8aafe25 [desktop] Update changelog (#6960) 2025-08-25 10:50:10 +05:30
Manav Rathi
edf32d065e [desktop] Update changelog 2025-08-25 10:47:43 +05:30
ashilkn
1fa6a0c3b9 Update internal change log 2025-08-25 10:41:16 +05:30
Manav Rathi
2388989dd0 [web] Enable Czech (#6958) 2025-08-25 10:35:06 +05:30
laurenspriem
9e392277b1 Fix initState issue 2025-08-25 10:31:41 +05:30
Neeraj
4609c375db Revert "[auth] Add smaller Activision icon" (#6953)
Reverts ente-io/ente#6950

I rushed a bit, sorry. The PR wasn't meant to be merged yet (if ever)
and it won't work right now anyway. It was meant to create conversation
on the topic and then possibly merged and there may be concerns to this
as a company may not want their logo/wordmark altered but I'm not well
versed in this topic (idk maybe I'm overthinking this).

Discussion: #6951
2025-08-25 10:31:20 +05:30
Manav Rathi
839c62ea72 [web] Enable Czech 2025-08-25 10:28:23 +05:30
Neeraj
dceef49f33 [mob][photos] Pre-cache thumbnails fetched from LRU cache to Flutter's ImageCache for faster rendering (#6957)
## Description

In Gallery, even if thumbnails are stored in LRU cache, there was a
delay in rendering thumbnails when scrolling fast enough. Pre-caching
these thumbnails to flutter's `ImageCache` right before they're rendered
has made the rendering fast enough for seamless UX.

#### Before:


https://github.com/user-attachments/assets/c47958fb-fbda-4e1f-9ce7-26b51ca87938

#### After:


https://github.com/user-attachments/assets/cbaf4427-f52f-4544-a0c2-820eb2b43953
2025-08-25 10:18:05 +05:30
laurenspriem
acbdc3111a Remove use of withOpacity 2025-08-25 10:15:49 +05:30
laurenspriem
98b91a6935 Remove duplicate string 2025-08-25 10:11:07 +05:30
laurenspriem
e1640e67d4 Extract strings 2025-08-25 10:09:03 +05:30
laurenspriem
e875758419 Simplify sort options 2025-08-25 09:48:33 +05:30
Manav Rathi
214b120472 [web] New translations (#6954)
New translations from
[Crowdin](https://crowdin.com/project/ente-photos-web)
2025-08-25 09:43:37 +05:30
ashilkn
f139e0a098 Fix flickering of GalleryFileWidget on hero animation after closing it's open full view 2025-08-25 09:21:57 +05:30
laurenspriem
e3c9a61887 Align 2025-08-25 09:20:19 +05:30
ashilkn
0da3dc5084 Skip clearing flutter image cache since default (current) limit is 100MB and the threshold to clear is 250MB 2025-08-25 09:20:08 +05:30
ashilkn
a856a82249 Refactor 2025-08-25 09:18:29 +05:30
ashilkn
fbdec00a62 Improve lru cache thumbnail rendering speed when scrolling gallery by precaching it it flutter's image cache 2025-08-25 09:16:59 +05:30
Crowdin Bot
6a7f980a0d New Crowdin translations by GitHub Action 2025-08-25 01:18:00 +00:00
Crowdin Bot
10a855fe27 New Crowdin translations by GitHub Action 2025-08-25 01:05:02 +00:00
Crowdin Bot
b4f8a2b27c New Crowdin translations by GitHub Action 2025-08-25 00:39:57 +00:00
dnred
89489b4d7c Revert "[auth] Add smaller Activision icon" 2025-08-24 23:48:21 +02:00
Aman Raj Singh Mourya
50296f8dfa [auth] Add smaller Activision icon (#6950)
## Description

The current Activision icon is too wide and small to be nicely displayed
in Auth so this PR adds a smaller one, just like the favicon on
Activision's [website](https://activision.com).

I know the Activision icon is pulled from simple-icons and I don't want
to get rid of that, just add an option for a smaller one, but I see that
the smaller Allegro icon is also added but it isn't displayed in the
icon picker and the icon from simple-icons takes precedence so you'd
have to figure this out.

## Tests

I haven't tested this.
2025-08-24 23:15:44 +05:30
dnred
f69cec864b Rename activision2.svg to activision.svg 2025-08-24 16:42:49 +02:00
dnred
73d5d33fc5 Update custom-icons.json 2025-08-24 16:25:47 +02:00
dnred
4d8ea12ddd Add logo 2025-08-24 16:17:25 +02:00
Prateek Sunal
7beb267ba7 chore: remove unused import 2025-08-24 02:15:09 +05:30
Prateek Sunal
7e13ef3537 chore: remove formatting for files_db 2025-08-24 02:10:06 +05:30
Prateek Sunal
47edca5bf5 chore: fix formatting 2025-08-24 02:08:00 +05:30
Prateek Sunal
925ba10b15 chore: revert remote_sync formatting 2025-08-24 02:06:28 +05:30
Prateek Sunal
db2d0bb7e9 fix: remove formatting from ml_service 2025-08-24 02:04:09 +05:30
Prateek Sunal
f3a2b2af0c fix: include it in if loop 2025-08-24 02:02:47 +05:30
Prateek Sunal
967e88f88d Merge remote-tracking branch 'origin/main' into taking-streaming-oob 2025-08-24 02:00:33 +05:30
Prateek Sunal
b44734a493 fix: add streaming static image 2025-08-24 01:59:23 +05:30
Manav Rathi
6478b08a19 [docs] Minor improvements to self-hosted docs (#6936)
## Description
- Small correction on the self-hosted docker exec command.
- Added tip on how to install Ente CLI.

In spirit of starting with a small PR :p
2025-08-23 21:54:47 +05:30
Laurens Priem
314e81565b Fix linter issues (#6939)
## Description

Linter was failing because it didn't first run
`flutter_rust_bridge_codegen generate` to generate the dart bindings to
rust code.
2025-08-23 20:34:02 +05:30
laurenspriem
f95e20d00f Consistent tap behaviour 2025-08-23 17:35:12 +05:30
laurenspriem
35a04d6e7e Don't unnecessarily sort 2025-08-23 17:34:53 +05:30
laurenspriem
403264d2c9 Fix linter issues 2025-08-23 17:20:22 +05:30
Toby
6b06a4c388 Add instructions on how to install Ente CLI 2025-08-23 13:13:08 +02:00
Toby
678bce89b2 Add small corrections to docker commands 2025-08-23 13:06:34 +02:00
Laurens Priem
2f1d4b9f1a Update rust to solve bindings generation issue (#6935)
## Description

Update rust to potentially solve bindings generation issue
2025-08-23 10:44:27 +05:30
laurenspriem
af20eadff0 Update rust to solve bindings generation issue 2025-08-23 10:39:54 +05:30
Prateek Sunal
3264ea046c [mob][photos] add named params for translations (#6932)
## Description

Parameters were sorted based on name by intl plugin which is a breaking
change.

We now have shifted to named params for translations so position won't
change.

## Tests
2025-08-22 22:50:07 +05:30
Laurens Priem
d81a73c833 [mob][photos] Similar images various improvements (#6931)
## Description

- Put the rust generated bindings in gitignore
- Use `view` instead of `load` on VectorDB index to use less RAM
- Various UI changes

## Tests

Tested in debug mode on my pixel phone.
2025-08-22 21:12:00 +05:30
laurenspriem
ac9c63fe29 Log updates 2025-08-22 21:11:25 +05:30
laurenspriem
53cb217dbc Fix MediaQuery in initState issue (for large files view) 2025-08-22 21:06:59 +05:30
Prateek Sunal
fca9a42e0a fix: add named params for translations to fix position 2025-08-22 19:41:45 +05:30
Prateek Sunal
8b708228be fix: add different ui for enabling it 2025-08-22 19:04:16 +05:30
laurenspriem
d379262f56 Small animation 2025-08-22 18:57:37 +05:30
laurenspriem
9282632af1 Exclude dart linter checks for rust 2025-08-22 18:14:13 +05:30
laurenspriem
6a43d6a567 Generate rust bindings on internal release 2025-08-22 18:11:53 +05:30
laurenspriem
1cdbef1a01 More fancy loading 2025-08-22 15:12:12 +05:30
laurenspriem
fa84bb0845 Delete progress indicator 2025-08-22 14:33:19 +05:30
laurenspriem
cbb6f07d0d Improve empty state 2025-08-22 12:38:37 +05:30
laurenspriem
fad9cf8559 Add rust bindings generation to readme 2025-08-22 11:57:45 +05:30
laurenspriem
371ba9c552 Put generated rust bindings in gitignore 2025-08-22 11:54:59 +05:30
laurenspriem
19086e43cc Remove generated rust bindings 2025-08-22 11:54:24 +05:30
laurenspriem
964c837c40 Remove scrollbar 2025-08-22 11:36:48 +05:30
laurenspriem
d85121862d Use view of index instead of loading in memory 2025-08-22 11:34:40 +05:30
Prateek Sunal
42d31a73a3 fix: update localization & fix lint 2025-08-21 23:32:45 +05:30
Prateek Sunal
946d2ae522 fix: remove unnecessary blank line in analysis_options.yaml + circular button 2025-08-21 22:51:01 +05:30
Prateek Sunal
8e9eb50783 fix: downgrade Dart SDK version to 3.7.2 2025-08-21 22:50:24 +05:30
Prateek Sunal
af3bc7757f fix: downgrade dart sdk again 2025-08-21 22:50:04 +05:30
Prateek Sunal
eda1d05216 fix: revert dart sdk 2025-08-21 22:49:49 +05:30
Prateek Sunal
b58e0f8331 fix: remove analysis options for now 2025-08-21 22:49:37 +05:30
Prateek Sunal
6dcf53650d fix: re-add captioned text 2025-08-21 22:48:42 +05:30
Prateek Sunal
bff53d9081 chore: add back space 2025-08-21 22:47:42 +05:30
Prateek Sunal
f3306e14c7 fix: revert 2025-08-21 22:47:30 +05:30
Prateek Sunal
b5c075bac4 fix: add space at end 2025-08-21 22:45:38 +05:30
Prateek Sunal
241d21c2aa fix: revert things 2025-08-21 22:44:34 +05:30
Prateek Sunal
789d77747c fix: update other contact page 2025-08-21 22:35:24 +05:30
Prateek Sunal
35050aa32f fix: delete generated intl_utils locale 2025-08-21 22:33:23 +05:30
Prateek Sunal
40e6bd9fae Merge remote-tracking branch 'origin/main' into taking-streaming-oob 2025-08-21 22:32:41 +05:30
Prateek Sunal
b317df2000 Merge branch 'main' into taking-streaming-oob 2025-08-21 18:11:42 +05:30
Prateek Sunal
2e706228ee feat: separate settings page improvements 2025-08-21 17:22:57 +05:30
Prateek Sunal
fe40185889 fix: redirect video streaming to setting page 2025-08-20 14:43:54 +05:30
Prateek Sunal
6bb4428a8a chore: update generated translations 2025-08-20 14:41:57 +05:30
Prateek Sunal
0881685915 feat: add video streaming settings page 2025-08-20 14:34:16 +05:30
Prateek Sunal
3e13932d03 chore: format files and update analysis file 2025-08-20 14:33:35 +05:30
143 changed files with 5084 additions and 4209 deletions

View File

@@ -8,7 +8,7 @@ on:
env:
FLUTTER_VERSION: "3.32.8"
RUST_VERSION: "1.85.1"
RUST_VERSION: "1.86.0"
permissions:
contents: read
@@ -47,6 +47,9 @@ jobs:
- name: Install Flutter Rust Bridge
run: cargo install flutter_rust_bridge_codegen
- name: Generate Rust bindings
run: flutter_rust_bridge_codegen generate
- name: Increment version code for build
run: |
CURRENT_VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //')

View File

@@ -9,6 +9,7 @@ on:
env:
FLUTTER_VERSION: "3.32.8"
RUST_VERSION: "1.86.0"
permissions:
contents: read
@@ -31,7 +32,18 @@ jobs:
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- run: flutter pub get
- name: Install Rust ${{ env.RUST_VERSION }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Install Flutter Rust Bridge
run: cargo install flutter_rust_bridge_codegen
- name: Generate Rust bindings
run: flutter_rust_bridge_codegen generate
- run: flutter analyze --no-fatal-infos

View File

@@ -2,6 +2,8 @@
## v1.7.15 (Unreleased)
- Custom domains.
- Support Czech translations.
- .
## v1.7.14

View File

@@ -8,6 +8,12 @@ description: Guide to configuring Ente CLI for Self Hosted Instance
If you are self-hosting, you can configure Ente CLI to export data & perform
basic administrative actions.
::: tip Installing Ente CLI
For instructions on installing the Ente CLI, see the [README available on Github](https://github.com/ente-io/ente/tree/main/cli/README.md).
:::
## Step 1: Configure endpoint
To do this, first configure the CLI to use your server's endpoint.

View File

@@ -22,8 +22,7 @@ can achieve this the following steps:
# Change the DB name and DB user name if you use different
# values.
# If using Docker
docker exec -it <postgres-ente-container-name>
docker exec -it <postgres-ente-container-name> sh
psql -U pguser -d ente_db
# Or when using psql directly

View File

@@ -46,7 +46,7 @@ If running Museum without Docker, the code should be visible in the terminal
# Change the DB name and DB user name if you use different
# values.
# If using Docker docker exec -it <postgres-ente-container-name>
# If using Docker docker exec -it <postgres-ente-container-name> sh
psql -U pguser -d ente_db
# Or when using psql directly

View File

@@ -111,6 +111,7 @@
"importAegisGuide": "Použijte možnost \"Export the vault\" v nastavení aplikace Aegis.",
"import2FasGuide": "Použijte možnost \"Settings->Backup -Export\" v 2FA.\n\nPokud je Vaše záloha šifrovaná, budete muset zadat heslo pro její odemčení",
"importLastpassGuide": "V nastavení aplikace Lastpass Authenticator vyberte možnost \"Transfer accounts\" a poté \"Export accounts to file\". Vygenerovaný soubor JSON následně nahrajte sem.",
"importProtonAuthGuide": "K exportu kódů použijte možnost „Exportovat“ v nastavení aplikace Proton Authenticator.",
"exportCodes": "Exportovat kódy",
"importLabel": "Importovat",
"importInstruction": "Vyberte, prosím, soubor obsahující seznam Vašich kódů v následujícím formátu",
@@ -124,6 +125,7 @@
"authToChangeYourEmail": "Pro změnu svého e-mailu se, prosím, ověřte",
"authToChangeYourPassword": "Pro změnu svého hesla se, prosím, ověřte",
"authToViewSecrets": "Pro zobrazení svých tajných údajů se musíte ověřit",
"authToInitiateSignIn": "Proveďte ověření a přihlaste se k zálohování.",
"ok": "Ok",
"cancel": "Zrušit",
"yes": "Ano",
@@ -171,6 +173,7 @@
"invalidQRCode": "Neplatný QR kód",
"noRecoveryKeyTitle": "Nemáte obnovovací klíč?",
"enterEmailHint": "Zadejte svou e-mailovou adresu",
"enterNewEmailHint": "Zadejte svou novou e-mailovou adresu",
"invalidEmailTitle": "Neplatná e-mailová adresa",
"invalidEmailMessage": "Prosím, zadejte platnou e-mailovou adresu.",
"deleteAccount": "Odstranit účet",
@@ -509,6 +512,19 @@
"supportEnte": "Podpořte <bold-green>ente</bold-green>",
"giveUsAStarOnGithub": "Dejte nám hvězdu na Githubu",
"free5GB": "5GB zdarma na <bold-green>ente</bold-green> Fotky",
"loginWithAuthAccount": "Přihlaste se pomocí svého účtu Auth",
"freeStorageOffer": "10% sleva na <bold-green>ente</bold-green> fotky",
"freeStorageOfferDescription": "Použijte kód \"AUTH\" pro získání 10% slevy na první rok"
"freeStorageOfferDescription": "Použijte kód \"AUTH\" pro získání 10% slevy na první rok",
"advanced": "Pokročilé",
"algorithm": "Algoritmus",
"type": "Typ",
"period": "Období",
"digits": "Digitální",
"importFromGallery": "Importovat z galerie",
"errorCouldNotReadImage": "Nelze přečíst vybraný obrazový soubor.",
"errorInvalidQRCode": "Neplatný QR kód",
"errorInvalidQRCodeBody": "Naskenovaný QR kód není platným účtem 2FA.",
"errorNoQRCode": "Nenalezen žádný QR kód",
"errorGenericTitle": "Došlo k chybě",
"errorGenericBody": "Při importu došlo k neočekávané chybě."
}

View File

@@ -111,6 +111,7 @@
"importAegisGuide": "Verwenden Sie die Option \"Tresor exportieren\" in den Einstellungen von Aegis.\n\nFalls Ihr Tresor verschlüsselt ist, müssen Sie das Passwort für den Tresor eingeben, um ihn zu entschlüsseln.",
"import2FasGuide": "Verwenden Sie unter \"Einstellungen → Backup\" die Option \"Exportieren\" in 2FAS.\n\nFalls Ihr Backup verschlüsselt ist, müssen Sie das Passwort eingeben, um das Backup zu entschlüsseln.",
"importLastpassGuide": "Verwenden Sie die Option \"Konten übertragen → Konten in Datei exportieren\" in den Lastpass Authenticator Einstellungen. \nImportieren Sie anschließend die heruntergeladene JSON-Datei.",
"importProtonAuthGuide": "Verwenden Sie die Option \"Exportieren\" in den Proton Authenticator Settings um Ihre Codes zu exportieren.",
"exportCodes": "Codes exportieren",
"importLabel": "Importieren",
"importInstruction": "Bitte wählen Sie eine Datei die Codes in folgendem Format beinhaltet",
@@ -519,5 +520,12 @@
"algorithm": "Algorithmus",
"type": "Typ",
"period": "Periode",
"digits": "Ziffern"
"digits": "Ziffern",
"importFromGallery": "Aus Galerie importieren",
"errorCouldNotReadImage": "Die ausgewählte Bild-Datei konnte nicht verarbeitet werden.",
"errorInvalidQRCode": "Ungültiger QR-Code",
"errorInvalidQRCodeBody": "Der gescannte QR-Code ist kein gültiges 2FA-Konto.",
"errorNoQRCode": "Kein QR-Code gefunden",
"errorGenericTitle": "Ein Fehler ist aufgetreten",
"errorGenericBody": "Beim Importieren ist ein unerwarteter Fehler aufgetreten."
}

View File

@@ -111,6 +111,7 @@
"importAegisGuide": "Utilisez l'option \"Exporter le coffre-fort\" dans les paramètres d'Aegis.\n\nSi votre coffre-fort est crypté, vous devrez saisir le mot de passe du coffre-fort pour déchiffrer le coffre-fort.",
"import2FasGuide": "Utilisez l'option \"Paramètres->Sauvegarde -Export\" dans 2FAS.\n\nSi votre sauvegarde est chiffrée, vous devrez entrer le mot de passe pour déchiffrer la sauvegarde",
"importLastpassGuide": "Utilisez l'option \"Transférer des comptes\" dans les paramètres de l'authentificateur Lastpass et appuyez sur \"Exporter des comptes vers un fichier\". Importez le JSON téléchargé.",
"importProtonAuthGuide": "Utilisez l'option \"Export\" dans les paramètres de Proton Authenticator pour exporter vos codes.",
"exportCodes": "Exporter les codes",
"importLabel": "Importer",
"importInstruction": "Veuillez sélectionner un fichier qui contient une liste de vos codes dans le format suivant",
@@ -519,5 +520,12 @@
"algorithm": "Algorithme",
"type": "Type",
"period": "Période",
"digits": "Chiffres"
"digits": "Chiffres",
"importFromGallery": "Importer depuis la galerie",
"errorCouldNotReadImage": "Impossible de lire le fichier sélectionné.",
"errorInvalidQRCode": "QR Code invalide",
"errorInvalidQRCodeBody": "Le code QR scanné n'est pas un compte 2FA valide.",
"errorNoQRCode": "Aucun code QR trouvé",
"errorGenericTitle": "Une erreur s'est produite",
"errorGenericBody": "Une erreur inattendue est survenue lors de l'importation."
}

View File

@@ -111,6 +111,7 @@
"importAegisGuide": "Naudokite „Aegis“ nustatymuose esančią parinktį Eksportuoti slėptuvę.\n\nJei jūsų saugykla užšifruota, turėsite įvesti saugyklos slaptažodį, kad iššifruotumėte saugyklą.",
"import2FasGuide": "Naudokite programoje 2FAS esančią parinktį „Settings->2FAS Backup->Export to file“.\n\nJei atsarginė kopija užšifruota, turėsite įvesti slaptažodį, kad iššifruotumėte atsarginę kopiją.",
"importLastpassGuide": "Naudokite „Lastpass Authenticator“ nustatymuose esančią parinktį „Transfer accounts“ (perkelti paskyras) ir paspauskite „Export accounts to file“ (eksportuoti paskyras į failą). Importuokite atsisiųstą JSON failą.",
"importProtonAuthGuide": "Naudokite „Proton Authenticator“ nustatymuose esančią parinktį „Export“ (eksportuoti), kad eksportuotumėte savo kodus.",
"exportCodes": "Eksportuoti kodus",
"importLabel": "Importuoti",
"importInstruction": "Pasirinkite failą, kuriame yra tokio formato jūsų kodų sąrašas",
@@ -519,5 +520,12 @@
"algorithm": "Algoritmas",
"type": "Tipas",
"period": "Laikotarpis",
"digits": "Skaitmenys"
"digits": "Skaitmenys",
"importFromGallery": "Importuoti iš galerijos",
"errorCouldNotReadImage": "Nepavyko perskaityti pasirinkto vaizdo failo.",
"errorInvalidQRCode": "Netinkamas QR kodas",
"errorInvalidQRCodeBody": "Nuskenuotas QR kodas nėra tinkama 2FA paskyra.",
"errorNoQRCode": "QR kodas nerastas.",
"errorGenericTitle": "Įvyko klaida",
"errorGenericBody": "Importuojant įvyko netikėta klaida."
}

View File

@@ -111,6 +111,7 @@
"importAegisGuide": "Użyj opcji \"Eksportuj sejf\" w ustawieniach Aegis.\n\nJeśli twój sejf jest zaszyfrowany, musisz wprowadzić hasło sejfu, aby odszyfrować sejf.",
"import2FasGuide": "Użyj opcji \"Ustawienia->Kopia Zapasowa-Eksport\" w 2FAS.\n\nJeśli twoja kopia zapasowa jest zaszyfrowana, musisz wprowadzić hasło, aby odszyfrować kopię zapasową",
"importLastpassGuide": "Użyj opcji \"Przenieś konta\" w Ustawieniach Lastpass Authenticator i naciśnij \"Eksportuj konta do pliku\". Zaimportuj pobrany plik JSON.",
"importProtonAuthGuide": "Użyj opcji „Eksportuj” w ustawieniach Proton Authenticator, aby wyeksportować kody.",
"exportCodes": "Eksportuj kody",
"importLabel": "Importuj",
"importInstruction": "Wybierz plik, który zawiera listę twoich kodów w następującym formacie",
@@ -519,5 +520,12 @@
"algorithm": "Algorytm",
"type": "Rodzaj",
"period": "Okres",
"digits": "Cyfry"
"digits": "Cyfry",
"importFromGallery": "Importuj z galerii",
"errorCouldNotReadImage": "Nie można odczytać wybranego pliku obrazu.",
"errorInvalidQRCode": "Nieprawidłowy kod QR",
"errorInvalidQRCodeBody": "Zeskanowany kod QR nie wskazuje na prawidłowe konto 2FA.",
"errorNoQRCode": "Nie znaleziono kodu QR",
"errorGenericTitle": "Wystąpił błąd",
"errorGenericBody": "Podczas importowania wystąpił nieoczekiwany błąd."
}

View File

@@ -18,7 +18,7 @@
"incorrectDetails": "Felaktiga uppgifter",
"pleaseVerifyDetails": "Kontrollera dina detaljer och försök igen",
"codeIssuerHint": "Utfärdare",
"codeSecretKeyHint": "Secret Key",
"codeSecretKeyHint": "Hemlig nyckel",
"secret": "Säkerhetsnyckel",
"all": "Alla",
"notes": "Anteckningar",
@@ -33,7 +33,7 @@
}
}
},
"codeAccountHint": "Konto (du@domän.com)",
"codeAccountHint": "Konto (du@domain.com)",
"codeTagHint": "Tagg",
"accountKeyType": "Typ av nyckel",
"sessionExpired": "Sessionen har gått ut",
@@ -68,7 +68,7 @@
"reportABug": "Rapportera en bugg",
"crashAndErrorReporting": "Krasch och felrapportering",
"reportBug": "Rapportera bugg",
"emailUsMessage": "Skicka e-mail till {email}",
"emailUsMessage": "Skicka e-post till {email}",
"@emailUsMessage": {
"placeholders": {
"email": {
@@ -79,7 +79,7 @@
"contactSupport": "Kontakta support",
"rateUsOnStore": "Betygsätt på {storeName}",
"blog": "Blogg",
"merchandise": "Merchandise",
"merchandise": "Produkter",
"verifyPassword": "Bekräfta lösenord",
"pleaseWait": "Vänligen vänta...",
"generatingEncryptionKeysTitle": "Skapar krypteringsnycklar...",
@@ -104,13 +104,14 @@
"importFromApp": "Importera koder från {appName}",
"importGoogleAuthGuide": "Exportera dina konton från Google Authenticator till en QR-kod med alternativet \"Överföra konton\". Använd sedan en annan enhet och skanna QR-koden.\n\nTips: Du kan använda din bärbara dators webbkamera för att ta en bild av QR-koden.",
"importSelectJsonFile": "Välj JSON-fil",
"importSelectAppExport": "Välj {appName} exportfil",
"importSelectAppExport": "Välj {appName} exporteringsfil",
"importEnteEncGuide": "Välj den krypterade JSON-filen som exporteras från Ente",
"importRaivoGuide": "Använd alternativet \"Exportera OTPs till zip-arkiv\" i Raivos inställningar.\n\nExtrahera zip-filen och importera JSON-filen.",
"importBitwardenGuide": "Använd alternativet \"Exportera valv\" inom Bitwarden Tools och importera den okrypterade JSON-filen.",
"importAegisGuide": "Använd alternativet \"Exportera valvet\" i Aegis inställningar.\n\nOm ditt valv är krypterat måste du ange valvlösenordet för att dekryptera valvet.",
"import2FasGuide": "Använd alternativet \"Inställningar->Säkerhetskopiera -Exportera\" i 2FAS.\n\nOm din säkerhetskopia är krypterad måste du ange lösenordet för att dekryptera säkerhetskopian.",
"importLastpassGuide": "Använd alternativet \"Överför konton\" i LastPass Authenticators inställningar och tryck på \"Exportera konton till fil\". Importera JSON-filen som laddas ner.",
"importProtonAuthGuide": "Använd alternativet \"Exportera\" i Proton Authenticator-inställningarna för att exportera koder.",
"exportCodes": "Exportera koder",
"importLabel": "Importera",
"importInstruction": "Vänligen välj en fil som innehåller en lista över dina koder i följande format",
@@ -119,11 +120,11 @@
"emailVerificationToggle": "E-postverifiering",
"emailVerificationEnableWarning": "För att undvika att bli låst från ditt konto, se till att spara en kopia av din e-post 2FA utanför Ente Auth innan du aktiverar e-postverifiering.",
"authToChangeEmailVerificationSetting": "Autentisera för att ändra din e-postadress",
"authenticateGeneric": "Var god autentisera",
"authenticateGeneric": "Vänligen autentisera",
"authToViewYourRecoveryKey": "Autentisera för att visa din återställningsnyckel",
"authToChangeYourEmail": "Autentisera för att ändra din e-postadress",
"authToChangeYourPassword": "Autentisera för att ändra ditt lösenord",
"authToViewSecrets": "Autentisera för att visa din återställningsnyckel",
"authToViewSecrets": "Vänligen autentisera för att visa din återställningsnyckel",
"authToInitiateSignIn": "Vänligen autentisera för att initiera inloggning för säkerhetskopiering.",
"ok": "OK",
"cancel": "Avbryt",
@@ -147,7 +148,7 @@
"leaveFamily": "Lämna familjen",
"leaveFamilyMessage": "Är du säker på att du vill lämna familjeplanen?",
"inFamilyPlanMessage": "Du är på en familjeplan!",
"hintForMobile": "Håll i på en kod för att redigera eller ta bort.",
"hintForMobile": "Tryck länge på en kod för att redigera eller ta bort.",
"hintForDesktop": "Högerklicka på en kod för att redigera eller ta bort.",
"scan": "Skanna",
"scanACode": "Skanna kod",
@@ -191,7 +192,7 @@
"oopsSomethingWentWrong": "Hoppsan! Något gick fel.",
"selectLanguage": "Välj språk",
"language": "Språk",
"social": "Social",
"social": "Socialt",
"security": "Säkerhet",
"lockscreen": "Låsskärm",
"authToChangeLockscreenSetting": "Vänligen autentisera för att ändra låsskärms inställningar",
@@ -200,7 +201,7 @@
"authToViewYourActiveSessions": "Autentisera för att visa dina aktiva sessioner",
"searchHint": "Sök...",
"search": "Sök",
"sorryUnableToGenCode": "Tyvärr, det gick inte att generera en kod för {issuerName}",
"sorryUnableToGenCode": "Tyvärr, kunde inte generera en kod för {issuerName}",
"noResult": "Inga resultat",
"addCode": "Lägg till kod",
"scanAQrCode": "Skanna en QR-kod",
@@ -215,7 +216,7 @@
"error": "Fel",
"recoveryKeyCopiedToClipboard": "Återställningsnyckel kopierad till urklipp",
"recoveryKeyOnForgotPassword": "Om du glömmer ditt lösenord är det enda sättet du kan återställa dina data med denna nyckel.",
"recoveryKeySaveDescription": "Vi lagrar inte och har därför inte åtkomst till denna nyckel, vänligen spara denna 24 ords nyckel på en säker plats.",
"recoveryKeySaveDescription": "Vi lagrar inte och har därför inte åtkomst till denna nyckel, vänligen spara denna 24 ordsnyckeln på en säker plats.",
"doThisLater": "Gör detta senare",
"saveKey": "Spara nyckel",
"save": "Spara",
@@ -254,7 +255,7 @@
"insecureDevice": "Osäker enhet",
"sorryWeCouldNotGenerateSecureKeysOnThisDevicennplease": "Tyvärr, kunde vi inte generera säkra nycklar på den här enheten.\n\nvänligen registrera dig från en annan enhet.",
"howItWorks": "Så här fungerar det",
"ackPasswordLostWarning": "Jag förstår att om jag förlorar mitt lösenord kan jag förlora mina data eftersom min data är <underline>end-to-end-krypterad</underline>.",
"ackPasswordLostWarning": "Jag förstår att om jag förlorar mitt lösenord kan jag förlora mina data eftersom min data är <underline>totalsträckskrypterad</underline>.",
"loginTerms": "Jag samtycker till <u-terms>användarvillkoren</u-terms> och <u-policy>integritetspolicyn</u-policy>",
"logInLabel": "Logga in",
"logout": "Logga ut",
@@ -278,7 +279,7 @@
"recoveryKeyVerifyReason": "Din återställningsnyckel är det enda sättet att återställa dina foton om du glömmer ditt lösenord. Du hittar din återställningsnyckel i Inställningar > Säkerhet.\n\nAnge din återställningsnyckel här för att verifiera att du har sparat den ordentligt.",
"confirmYourRecoveryKey": "Bekräfta din återställningsnyckel",
"confirm": "Bekräfta",
"emailYourLogs": "Maila dina loggar",
"emailYourLogs": "E-posta dina loggar",
"pleaseSendTheLogsTo": "Vänligen skicka loggarna till \n{toEmail}",
"copyEmailAddress": "Kopiera e-postadress",
"exportLogs": "Exportera loggar",
@@ -297,7 +298,7 @@
"criticalUpdateAvailable": "Kritisk uppdatering tillgänglig",
"updateAvailable": "Uppdatering tillgänglig",
"update": "Uppdatera",
"checking": "Kontrollerar ...",
"checking": "Kontrollerar...",
"youAreOnTheLatestVersion": "Du är på den senaste versionen",
"warning": "Varning",
"exportWarningDesc": "Den exporterade filen innehåller känslig information. Förvara den på ett säkert sätt.",
@@ -306,7 +307,7 @@
"description": "Text for the button to confirm the user understands the warning"
},
"authToExportCodes": "Autentisera för att exportera dina koder",
"importSuccessTitle": "Jippi!",
"importSuccessTitle": "Hurra!",
"importSuccessDesc": "Du har importerat {count} koder!",
"@importSuccessDesc": {
"placeholders": {
@@ -324,7 +325,7 @@
"checkInboxAndSpamFolder": "Vänligen kontrollera din inkorg (och skräppost) för att slutföra verifieringen",
"tapToEnterCode": "Tryck för att ange kod",
"resendEmail": "Skicka e-post igen",
"weHaveSendEmailTo": "Vi har skickat ett mail till <green>{email}</green>",
"weHaveSendEmailTo": "Vi har skickat ett e-postmeddelande till <green>{email}</green>",
"@weHaveSendEmailTo": {
"description": "Text to indicate that we have sent a mail to the user",
"placeholders": {
@@ -362,7 +363,7 @@
"selectExportFormat": "Välj exportformat",
"exportDialogDesc": "Krypterad export skyddas av ett lösenord som du väljer.",
"encrypted": "Krypterad",
"plainText": "Enkel text",
"plainText": "Oformaterad text",
"passwordToEncryptExport": "Lösenord för att kryptera export",
"export": "Exportera",
"useOffline": "Använd utan säkerhetskopior",
@@ -374,14 +375,14 @@
"compactMode": "Kompakt läge",
"shouldHideCode": "Dölj koder",
"doubleTapToViewHiddenCode": "Du kan dubbeltrycka på en post för att visa koden",
"focusOnSearchBar": "Fokusera på sök vid appstart",
"focusOnSearchBar": "Fokusera på sök vid uppstart av app",
"confirmUpdatingkey": "Är du säker på att du vill uppdatera den hemliga nyckeln?",
"minimizeAppOnCopy": "Minimera appen vid kopiering",
"editCodeAuthMessage": "Autentisera för att redigera kod",
"deleteCodeAuthMessage": "Autentisera för att radera kod",
"showQRAuthMessage": "Autentisera för att visa QR-kod",
"confirmAccountDeleteTitle": "Bekräfta radering av kontot",
"confirmAccountDeleteMessage": "Detta konto är kopplat till andra Ente apps, om du använder någon.\n\nDina uppladdade data, över alla Ente appar, kommer att schemaläggas för radering och ditt konto kommer att raderas permanent.",
"confirmAccountDeleteMessage": "Detta konto är kopplat till andra Ente applikationer, om du använder någon.\n\nDina uppladdade data, över alla Ente applikationer, kommer att schemaläggas för radering och ditt konto kommer att raderas permanent.",
"androidBiometricHint": "Verifiera identitet",
"@androidBiometricHint": {
"description": "Hint message advising the user how to authenticate with biometrics. It is used on Android side. Maximum 60 characters."
@@ -390,7 +391,7 @@
"@androidBiometricNotRecognized": {
"description": "Message to let the user know that authentication was failed. It is used on Android side. Maximum 60 characters."
},
"androidBiometricSuccess": "Slutförd",
"androidBiometricSuccess": "Lyckades",
"@androidBiometricSuccess": {
"description": "Message to let the user know that authentication was successful. It is used on Android side. Maximum 60 characters."
},
@@ -441,7 +442,7 @@
"signOutOtherDevices": "Logga ut andra enheter",
"doNotSignOut": "Logga inte ut",
"hearUsWhereTitle": "Hur hörde du talas om Ente? (valfritt)",
"hearUsExplanation": "Vi spårar inte appinstallationer, Det skulle hjälpa oss om du berättade var du hittade oss!",
"hearUsExplanation": "Vi spårar inte installationer. Det skulle hjälpa oss om du berättade hur du hittade oss!",
"recoveryKeySaved": "Återställningsnyckel sparad i nedladdningsmappen!",
"waitingForBrowserRequest": "Väntar på webbläsarbegäran...",
"waitingForVerification": "Väntar på verifiering...",
@@ -488,6 +489,8 @@
"hideContent": "Dölj innehåll",
"hideContentDescriptionAndroid": "Döljer appinnehåll i app-växlaren och inaktiverar skärmdumpar",
"hideContentDescriptioniOS": "Döljer appinnehåll i app-växlaren",
"autoLockFeatureDescription": "Tid efter vilken appen låses efter att ha satts i bakgrunden",
"appLockDescription": "Välj mellan enhetens förvalda låsskärm och en anpassad låsskärm med en PIN-kod eller lösenord.",
"pinLock": "Pinkodslås",
"enterPin": "Ange PIN-kod",
"setNewPin": "Ställ in ny PIN-kod",
@@ -498,9 +501,31 @@
"appLockOfflineModeWarning": "Du har valt att fortsätta utan säkerhetskopior. Om du glömmer ditt applås, kommer du att bli utelåst från att komma åt dina data.",
"duplicateCodes": "Dubblettkoder",
"noDuplicates": "✨ Inga dubbletter",
"youveNoDuplicateCodesThatCanBeCleared": "Du har inga dubbla koder som kan rensas",
"deduplicateCodes": "Deduplicera koder",
"deselectAll": "Avmarkera alla",
"selectAll": "Markera alla",
"deleteDuplicates": "Radera dubbletter",
"plainHTML": "Ren HTML"
"plainHTML": "Ren HTML",
"tellUsWhatYouThink": "Berätta vad du tycker",
"dropReviewiOS": "Skriv en recension på App Store",
"dropReviewAndroid": "Skriv en recension på Play Store",
"supportEnte": "Stöd <bold-green>ente</bold-green>",
"giveUsAStarOnGithub": "Ge oss en stjärna på Github",
"free5GB": "5 GB gratis på <bold-green>ente</bold-green> Foton",
"loginWithAuthAccount": "Logga in med ditt Auth-konto",
"freeStorageOffer": "10% rabatt på <bold-green>ente</bold-green> foton",
"freeStorageOfferDescription": "Använd koden \"AUTH\" för att få 10% rabatt första året",
"advanced": "Avancerad",
"algorithm": "Algoritm",
"type": "Typ",
"period": "Tidsperiod",
"digits": "Siffror",
"importFromGallery": "Importera från galleri",
"errorCouldNotReadImage": "Kunde inte läsa den valda bildfilen.",
"errorInvalidQRCode": "Ogiltig QR-kod",
"errorInvalidQRCodeBody": "Den skannade QR-koden är inte ett giltigt 2FA konto.",
"errorNoQRCode": "Ingen QR-kod hittades",
"errorGenericTitle": "Ett fel inträffade",
"errorGenericBody": "Ett oväntat fel inträffade vid import."
}

View File

@@ -6,7 +6,7 @@
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
},
"onBoardingBody": "妥善保管您的两步验证码",
"onBoardingBody": "妥善保管您的双重认证代码",
"onBoardingGetStarted": "开始",
"setupFirstAccount": "设置您的第一个账户",
"importScanQrCode": "扫描二维码",
@@ -111,13 +111,14 @@
"importAegisGuide": "使用 Aegis 设置中的“导出密码库”选项。\n\n如果您的密码库已加密则需要输入密码库密码才能解密密码库。",
"import2FasGuide": "使用 2FAS 中的“设置 -> 备份 -> 导出”选项。\n\n如果您的备份已加密则需要输入密码来解密备份",
"importLastpassGuide": "使用 Lastpass Authenticator 设置中的“转移账户”选项,然后按“将账户导出到文件”。导入下载的 JSON。",
"importProtonAuthGuide": "使用 Proton Authenticator 设置中的“导出”选项导出您的代码。",
"exportCodes": "导出代码",
"importLabel": "导入",
"importInstruction": "请选择一个包含以下格式的代码列表的文件",
"importCodeDelimiterInfo": "代码可以用逗号或换行符分隔",
"selectFile": "选择文件",
"emailVerificationToggle": "电子邮件验证",
"emailVerificationEnableWarning": "为避免被锁在您的账户之外,请在启用电子邮件验证之前确保在 Ente Auth 之外存储电子邮件两步验证的副本。",
"emailVerificationEnableWarning": "为避免被锁在您的账户之外,请在启用电子邮件验证之前确保在 Ente Auth 之外存储电子邮件双重认证的副本。",
"authToChangeEmailVerificationSetting": "请进行身份验证以更改电子邮件验证",
"authenticateGeneric": "请验证",
"authToViewYourRecoveryKey": "请验证以查看您的恢复密钥",
@@ -155,7 +156,7 @@
"verifyEmail": "验证电子邮件",
"enterCodeHint": "从你的身份验证器应用中\n输入6位数字代码",
"lostDeviceTitle": "丢失了设备吗?",
"twoFactorAuthTitle": "两步验证",
"twoFactorAuthTitle": "双重认证",
"passkeyAuthTitle": "通行密钥验证",
"verifyPasskey": "验证通行密钥",
"loginWithTOTP": "使用 TOTP 登录",
@@ -519,5 +520,12 @@
"algorithm": "算法",
"type": "类型",
"period": "周期",
"digits": "数字"
"digits": "数字",
"importFromGallery": "从图库导入",
"errorCouldNotReadImage": "无法读取所选图片文件。",
"errorInvalidQRCode": "二维码无效",
"errorInvalidQRCodeBody": "扫描的二维码不是有效的双重认证账户。",
"errorNoQRCode": "未找到二维码",
"errorGenericTitle": "出错了",
"errorGenericBody": "导入时发生意外错误。"
}

View File

@@ -47,4 +47,9 @@ android/app/build/
# FVM Version Cache
.fvm/
lib/generated/intl/app_localizations*.dart
lib/generated/intl/app_localizations*.dart
# Generated rust bindings
lib/src/rust/*
rust/src/frb_generated*
test/**/*.mocks.dart

View File

@@ -48,7 +48,7 @@ You can alternatively install the build from PlayStore or F-Droid.
1. Install [Flutter v3.32.8](https://flutter.dev/docs/get-started/install) and [Rust](https://www.rust-lang.org/tools/install).
2. Install [Flutter Rust Bridge](https://cjycode.com/flutter_rust_bridge/) with `cargo install flutter_rust_bridge_codegen`
2. Install [Flutter Rust Bridge](https://cjycode.com/flutter_rust_bridge/) with `cargo install flutter_rust_bridge_codegen` and run `flutter_rust_bridge_codegen generate` to generate the Rust bindings.
3. Pull in all submodules with `git submodule update --init --recursive`

View File

@@ -73,3 +73,6 @@ analyzer:
- thirdparty/**
- lib/generated/**
- rust_builder/**
- lib/src/rust/**
- rust/src/**
- test/**

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@@ -1,36 +1,36 @@
ente is a simple app to backup and share your photos and videos.
ente je jednoduchá aplikace pro automatické zálohování a organizaci vašich fotek a videí.
If you've been looking for a privacy-friendly alternative to Google Photos, you've come to the right place. With ente, they are stored end-to-end encrypted (e2ee). This means that only you can view them.
Pokud hledáte alternativu ke službě Google Photos, která respektuje vaše soukromí, jste na správném místě. S Ente jsou uloženy s koncovým "end-to-end" šifrováním (e2ee). To znamená, že je můžete vidět pouze vy.
We have open-source apps across Android, iOS, web and desktop, and your photos will seamlessly sync between all of them in an end-to-end encrypted (e2ee) manner.
Máme aplikace napříč všemi platformami a vaše fotky se budou bezproblémově synchronizovat mezi všemi vašimi zařízeními tak, aby byly koncově šifrovány mezi jednotlivými zařízeními (e2ee).
ente also makes it simple to share your albums with your loved ones, even if they aren't on ente. You can share publicly viewable links, where they can view your album and collaborate by adding photos to it, even without an account or app.
ente také usnadňuje sdílení vašich alb s vašimi blízkými, i když nejsou na ente. Můžete sdílet veřejně přístupné odkazy, kde si mohou prohlížet vaše album a spolupracovat přidáváním fotografií, a to i bez účtu nebo aplikace.
Your encrypted data is replicated to 3 different locations, including a fall-out shelter in Paris. We take posterity seriously and make it easy to ensure that your memories outlive you.
Vaše šifrovaná data jsou uložena na 3 místech, včetně protiatomového krytu v Paříži. Bereme budoucnost vážně a usnadňujeme vám zajistit, aby vaše vzpomínky přežily vás samotné.
We are here to make the safest photos app ever, come join our journey!
Jsme tu, abychom vytvořili nejbezpečnější aplikaci pro fotografie, jaká kdy byla. Přidejte se k nám!
FEATURES
- Original quality backups, because every pixel is important
- Family plans, so you can share storage with your family
- Collaborative albums, so you can pool together photos after a trip
- Shared folders, in case you want your partner to enjoy your "Camera" clicks
- Album links, that can be protected with a password
- Ability to free up space, by removing files that have been safely backed up
- Human support, because you're worth it
- Descriptions, so you can caption your memories and find them easily
- Image editor, to add finishing touches
- Favorite, hide and relive your memories, for they are precious
- One-click import from Google, Apple, your hard drive and more
- Dark theme, because your photos look good in it
- 2FA, 3FA, biometric auth
- and a LOT more!
VLASTNOSTI
- Zálohování v původní kvalitě, protože každý pixel je důležitý
- Rodinné plány, takže můžete sdílet úložiště s rodinou
- Společná alba, do kterých můžete po cestě shromažďovat fotografie
- Sdílené složky, aby i váš partner mohl obdivovat vaše fotografie
- Odkazy na alba, které lze chránit heslem a nastavit jejich platnost
- Možnost uvolnit místo odstraněním souborů, které byly bezpečně zálohovány
- Lidská podpora, protože si to zasloužíte
- Popisy, abyste mohli své vzpomínky opatřit popisky a snadno je najít
- Editor obrázků pro doladění detailů
- Označte si své oblíbené fotografie, skryjte je a nebo je prožijte znovu pomocí vzpomínek
- Import jedním kliknutím z Google, Apple, pevného disku a dalších zdrojů
- Tmavý motiv, protože vaše fotografie v něm vypadají dobře
- 2FA, 3FA, biometrické ověření
- a ještě MNOHEM víc!
OPRÁVNĚNÍ
ente requests for certain permissions to serve the purpose of a photo storage provider, which can be reviewed here: https://github.com/ente-io/ente/blob/f-droid/mobile/android/permissions.md
ente žádá o určitá oprávnění, aby mohla plnit funkci poskytovatele úložiště fotografií. Tyto oprávnění si můžete prohlédnout zde: https://github.com/ente-io/ente/blob/f-droid/mobile/android/permissions.md
PRICING
We don't offer forever free plans, because it is important to us that we remain sustainable and withstand the test of time. Instead we offer affordable plans that you can freely share with your family. You can find more information at ente.io.
CENY
Nenabízíme doživotní tarify, protože je pro nás důležité zůstat udržitelnými a obstát ve zkoušce času. Místo toho nabízíme cenově dostupné plány, které můžete svobodně sdílet se svou rodinou. Více informací najdete na ente.io.
PODPORA
We take pride in offering human support. If you are our paid customer, you can reach out to team@ente.io and expect a response from our team within 24 hours.
Jsme hrdí na to, že poskytujeme lidskou podporu. Pokud máte placený tarif, můžete se obrátit na team@ente.io a do 24 hodin od našeho týmu očekávat odpověď.

View File

@@ -1 +1 @@
ente is an end-to-end encrypted photo storage app
ente je aplikace pro ukládání fotografií a videí s koncovým šifrováním

View File

@@ -1 +1 @@
ente - encrypted photo storage
ente šifrované úložiště fotografií

View File

@@ -1,33 +1,33 @@
Ente is a simple app to automatically backup and organize your photos and videos.
Ente je jednoduchá aplikace pro automatické zálohování a organizaci vašich fotek a videí.
If you've been looking for a privacy-friendly alternative to preserve your memories, you've come to the right place. With Ente, they are stored end-to-end encrypted (e2ee). This means that only you can view them.
Pokud hledáte alternativu, která respektuje vaše soukromí a umožní vám uchovat vaše vzpomínky, jste na správném místě. S Ente jsou uloženy s koncovým "end-to-end" šifrováním (e2ee). To znamená, že je můžete vidět pouze vy.
We have apps across all platforms, and your photos will seamlessly sync between all your devices in an end-to-end encrypted (e2ee) manner.
Máme aplikace napříč všemi platformami a vaše fotky se budou bezproblémově synchronizovat mezi všemi vašimi zařízeními tak, aby byly koncově šifrovány mezi jednotlivými zařízeními (e2ee).
Ente also makes it simple to share your albums with your loved ones. You can either share them directly with other Ente users, end-to-end encrypted; or with publicly viewable links.
Ente také zjednodušuje sdílení alb s vašimi blízkými. Můžete je buď sdílet přímo s ostatními uživateli Ente, koncově šifrované; nebo s pomocí veřejně přístupných odkazů.
Your encrypted data is stored across multiple locations, including a fall-out shelter in Paris. We take posterity seriously and make it easy to ensure that your memories outlive you.
Vaše šifrovaná data jsou uložena na několika místech, včetně protiatomového krytu v Paříži. Bereme budoucnost vážně a usnadňujeme vám zajistit, aby vaše vzpomínky přežily vás samotné.
We are here to make the safest photos app ever, come join our journey!
Jsme tu, abychom vytvořili nejbezpečnější aplikaci pro fotografie, jaká kdy byla. Přidejte se k nám!
FEATURES
- Original quality backups, because every pixel is important
- Family plans, so you can share storage with your family
- Shared folders, in case you want your partner to enjoy your "Camera" clicks
- Album links, that can be protected with a password and set to expire
- Ability to free up space, by removing files that have been safely backed up
- Image editor, to add finishing touches
- Favorite, hide and relive your memories, for they are precious
- One-click import from all major storage providers
- Dark theme, because your photos look good in it
- 2FA, 3FA, biometric auth
- and a LOT more!
VLASTNOSTI
- Zálohování v původní kvalitě, protože každý pixel je důležitý
- Rodinné plány, takže můžete sdílet úložiště s rodinou
- Sdílené složky, aby i váš partner mohl obdivovat vaše fotografie
- Odkazy na alba, které lze chránit heslem a nastavit jejich platnost
- Možnost uvolnit místo odstraněním souborů, které byly bezpečně zálohovány
- Editor obrázků, pro finální doladění detailů
- Označte si své oblíbené fotografie, skryjte je a nebo je prožijte znovu pomocí vzpomínek
- Import jedním kliknutím ze všech velkých poskytovatelů úložišť
- Tmavý motiv, protože vaše fotografie v něm vypadají dobře
- 2FA, 3FA, biometrické ověření
- a ještě MNOHEM víc!
PRICING
We don't offer forever free plans, because it is important to us that we remain sustainable and withstand the test of time. Instead we offer affordable plans that you can freely share with your family. You can find more information at ente.io.
CENY
Nenabízíme doživotní tarify, protože je pro nás důležité zůstat udržitelnými a obstát ve zkoušce času. Místo toho nabízíme cenově dostupné plány, které můžete svobodně sdílet se svou rodinou. Více informací najdete na ente.io.
SUPPORT
We take pride in offering human support. If you are our paid customer, you can reach out to team@ente.io and expect a response from our team within 24 hours.
PODPORA
Jsme hrdí na to, že poskytujeme lidskou podporu. Pokud máte placený tarif, můžete se obrátit na team@ente.io a do 24 hodin od našeho týmu očekávat odpověď.
TERMS
PODMÍNKY
https://ente.io/terms

View File

@@ -1 +1 @@
photos,photography,family,privacy,cloud,backup,videos,photo,encryption,storage,album,alternative
fotky,fotografie,rodina,soukromí,cloud,zálohování,videa,fotka,šifrování,úložiště,album,alternativa

View File

@@ -1 +1 @@
Ente Photos
Ente Fotky

View File

@@ -1 +1 @@
Encrypted photo storage
Šifrované úložiště fotografií

View File

@@ -1,30 +1,30 @@
Ente is a simple app to automatically backup and organize your photos and videos.
Ente je jednoduchá aplikace pro automatické zálohování a organizaci vašich fotek a videí.
If you've been looking for a privacy-friendly alternative to preserve your memories, you've come to the right place. With Ente, they are stored end-to-end encrypted (e2ee). This means that only you can view them.
Pokud hledáte alternativu, která respektuje vaše soukromí a umožní vám uchovat vaše vzpomínky, jste na správném místě. S Ente jsou uloženy s koncovým "end-to-end" šifrováním (e2ee). To znamená, že je můžete vidět pouze vy.
We have apps across Android, iOS, web and Desktop, and your photos will seamlessly sync between all your devices in an end-to-end encrypted (e2ee) manner.
Máme aplikace napříč všemi platformami a vaše fotky se budou bezproblémově synchronizovat mezi všemi vašimi zařízeními tak, aby byly koncově šifrovány mezi jednotlivými zařízeními (e2ee).
Ente also makes it simple to share your albums with your loved ones. You can either share them directly with other Ente users, end-to-end encrypted; or with publicly viewable links.
Ente také zjednodušuje sdílení alb s vašimi blízkými. Můžete je buď sdílet přímo s ostatními uživateli Ente, koncově šifrované; nebo s pomocí veřejně přístupných odkazů.
Your encrypted data is stored across multiple locations, including a fall-out shelter in Paris. We take posterity seriously and make it easy to ensure that your memories outlive you.
Vaše šifrovaná data jsou uložena na několika místech, včetně protiatomového krytu v Paříži. Bereme budoucnost vážně a usnadňujeme vám zajistit, aby vaše vzpomínky přežily vás samotné.
We are here to make the safest photos app ever, come join our journey!
Jsme tu, abychom vytvořili nejbezpečnější aplikaci pro fotografie, jaká kdy byla. Přidejte se k nám!
FEATURES
- Original quality backups, because every pixel is important
- Family plans, so you can share storage with your family
- Shared folders, in case you want your partner to enjoy your "Camera" clicks
- Album links, that can be protected with a password and set to expire
- Ability to free up space, by removing files that have been safely backed up
- Image editor, to add finishing touches
- Favorite, hide and relive your memories, for they are precious
- One-click import from Google, Apple, your hard drive and more
- Dark theme, because your photos look good in it
- 2FA, 3FA, biometric auth
- and a LOT more!
VLASTNOSTI
- Zálohování v původní kvalitě, protože každý pixel je důležitý
- Rodinné plány, takže můžete sdílet úložiště s rodinou
- Sdílené složky, aby i váš partner mohl obdivovat vaše fotografie
- Odkazy na alba, které lze chránit heslem a nastavit jejich platnost
- Možnost uvolnit místo odstraněním souborů, které byly bezpečně zálohovány
- Editor obrázků, pro finální doladění detailů
- Označte si své oblíbené fotografie, skryjte je a nebo je prožijte znovu pomocí vzpomínek
- Import jedním kliknutím ze všech velkých poskytovatelů úložišť
- Tmavý motiv, protože vaše fotografie v něm vypadají dobře
- 2FA, 3FA, biometrické ověření
- a ještě MNOHEM víc!
💲 PRICING
We don't offer forever free plans, because it is important to us that we remain sustainable and withstand the test of time. Instead we offer affordable plans that you can freely share with your family. You can find more information at ente.io.
💲 CENY
Nenabízíme doživotní tarify, protože je pro nás důležité zůstat udržitelnými a obstát ve zkoušce času. Místo toho nabízíme cenově dostupné plány, které můžete svobodně sdílet se svou rodinou. Více informací najdete na ente.io.
🙋 SUPPORT
We take pride in offering human support. If you are our paid customer, you can reach out to team@ente.io and expect a response from our team within 24 hours.
🙋 PODPORA
Jsme hrdí na to, že poskytujeme lidskou podporu. Pokud máte placený tarif, můžete se obrátit na team@ente.io a do 24 hodin od našeho týmu očekávat odpověď.

View File

@@ -1 +1 @@
Encrypted photo storage - backup, organize and share your photos and videos
Šifrované úložiště fotografií zálohujte, organizujte a sdílejte své fotografie a videa

View File

@@ -1 +1 @@
Ente Photos
Ente Fotky

View File

@@ -3,3 +3,4 @@ output-dir: lib/generated/intl
template-arb-file: intl_en.arb
output-localization-file: app_localizations.dart
nullable-getter: false
use-named-parameters: true

View File

@@ -981,7 +981,8 @@ class FilesDB with SqlDbBase {
// remove references for local files which are either already uploaded
// or queued for upload but not yet uploaded
Future<int> removeQueuedLocalFiles(Set<String> localIDs) async {
// Remove queued local files that have duplicate uploaded entries with same localID
Future<int> removeQueuedLocalFiles(Set<String> localIDs, int ownerID) async {
if (localIDs.isEmpty) {
_logger.finest("No local IDs provided for removal");
return 0;
@@ -990,54 +991,63 @@ class FilesDB with SqlDbBase {
final db = await instance.sqliteAsyncDB;
const batchSize = 10000;
int totalRemoved = 0;
final localIDsList = localIDs.toList();
for (int i = 0; i < localIDsList.length; i += batchSize) {
final endIndex = (i + batchSize > localIDsList.length)
? localIDsList.length
: i + batchSize;
final batch = localIDsList.sublist(i, endIndex);
final placeholders = List.filled(batch.length, '?').join(',');
final List<String> alreadyUploaded = [];
// find localIDs that are already uploaded
final result = await db.execute('''
// Find localIDs that already have uploaded entries
final result = await db.execute(
'''
SELECT DISTINCT $columnLocalID
FROM $filesTable
WHERE $columnLocalID IN ($placeholders)
WHERE
$columnOwnerID = $ownerID
AND $columnLocalID IN ($placeholders)
AND ($columnUploadedFileID IS NOT NULL AND $columnUploadedFileID != -1)
''');
for (final row in result) {
alreadyUploaded.add(row[columnLocalID] as String);
}
final uploadedPlaceholders =
alreadyUploaded.map((id) => "'$id'").join(',');
final r = await db.execute(
'''
DELETE FROM $filesTable
WHERE $columnLocalID IN ($uploadedPlaceholders)
AND ($columnUploadedFileID IS NULL OR $columnUploadedFileID = -1)
''',
''',
batch,
);
if (r.isNotEmpty) {
_logger.warning(
"Batch ${(i ~/ batchSize) + 1}: Removed duplicate ${r.length} files",
if (result.isNotEmpty) {
final alreadyUploadedLocalIDs =
result.map((row) => row[columnLocalID] as String).toList();
final localIdPlaceholder =
List.filled(alreadyUploadedLocalIDs.length, '?').join(',');
// Delete queued entries for localIDs that already have uploaded versions
final deleteResult = await db.execute(
'''
DELETE FROM $filesTable
WHERE $columnLocalID IN ($localIdPlaceholder)
AND ($columnUploadedFileID IS NULL OR $columnUploadedFileID = -1)
''',
alreadyUploadedLocalIDs,
);
totalRemoved += r.length;
final removedCount =
deleteResult.length; // or however your DB returns affected rows
if (removedCount > 0) {
_logger.warning(
"Batch ${(i ~/ batchSize) + 1}: Removed $removedCount queued duplicates",
);
totalRemoved += removedCount;
}
}
}
if (totalRemoved > 0) {
_logger.warning(
"Removed $totalRemoved potential dups for already queued local files",
"Removed $totalRemoved queued files that had uploaded duplicates",
);
} else {
_logger.finest("No duplicate id found for queued/uploaded files");
_logger.finest("No queued duplicates found for uploaded files");
}
return totalRemoved;
}
@@ -1677,26 +1687,36 @@ class FilesDB with SqlDbBase {
);
}
Future<List<EnteFile>> getAllFilesAfterDate({
required FileType fileType,
required DateTime beginDate,
Future<List<EnteFile>> getStreamingEligibleVideoFiles({
DateTime? beginDate,
required int userID,
bool onlyFilesWithLocalId = false,
}) async {
final db = await instance.sqliteAsyncDB;
final results = await db.getAll(
'''
String query = '''
SELECT * FROM $filesTable
WHERE $columnFileType = ?
AND $columnCreationTime > ?
AND $columnUploadedFileID != -1
AND $columnOwnerID = $userID
AND $columnLocalID IS NOT NULL
AND ($columnUploadedFileID IS NOT NULL AND $columnUploadedFileID != -1)
AND $columnOwnerID = ?
AND ($columnFileSize IS NOT NULL AND $columnFileSize <= 524288000)
AND ($columnDuration IS NOT NULL AND ($columnDuration <= 60 AND $columnDuration > 0))
ORDER BY $columnCreationTime DESC
''',
[getInt(fileType), beginDate.microsecondsSinceEpoch],
);
''';
final List<Object> queryArgs = [getInt(FileType.video), userID];
if (beginDate != null) {
query += ' AND $columnCreationTime > ?';
queryArgs.add(beginDate.microsecondsSinceEpoch);
}
if (onlyFilesWithLocalId) {
query += ' AND $columnLocalID IS NOT NULL';
}
query += ' ORDER BY $columnCreationTime DESC';
final results = await db.getAll(query, queryArgs);
return convertToFiles(results);
}

View File

@@ -1,4 +1,3 @@
import "dart:io" show File;
import "dart:typed_data" show Float32List;
import "package:flutter_rust_bridge/flutter_rust_bridge.dart" show Uint64List;
@@ -8,11 +7,13 @@ import "package:path_provider/path_provider.dart";
import "package:photos/models/ml/vector.dart";
import "package:photos/services/machine_learning/semantic_search/query_result.dart";
import "package:photos/src/rust/api/usearch_api.dart";
import "package:shared_preferences/shared_preferences.dart";
class ClipVectorDB {
static final Logger _logger = Logger("ClipVectorDB");
static const _databaseName = "ente.ml.vectordb.clip";
static const _kMigrationKey = "clip_vector_migration";
static final BigInt _embeddingDimension = BigInt.from(512);
@@ -51,10 +52,9 @@ class ClipVectorDB {
Future<bool> checkIfMigrationDone() async {
if (_migrationDone != null) return _migrationDone!;
_logger.info("Checking if ClipVectorDB migration has run");
final documentsDirectory = await getApplicationDocumentsDirectory();
final migrationFlagFile =
File(join(documentsDirectory.path, 'clip_vector_migration_done'));
if (await migrationFlagFile.exists()) {
final prefs = await SharedPreferences.getInstance();
final migrationDone = prefs.getBool(_kMigrationKey) ?? false;
if (migrationDone) {
_logger.info("ClipVectorDB migration already done");
_migrationDone = true;
return _migrationDone!;
@@ -67,10 +67,8 @@ class ClipVectorDB {
Future<void> setMigrationDone() async {
_logger.info("Setting ClipVectorDB migration done");
final documentsDirectory = await getApplicationDocumentsDirectory();
final migrationFlagFile =
File(join(documentsDirectory.path, 'clip_vector_migration_done'));
await migrationFlagFile.create(recursive: true);
final prefs = await SharedPreferences.getInstance();
await prefs.setBool(_kMigrationKey, true);
_migrationDone = true;
}

View File

@@ -6,6 +6,7 @@ import 'package:path_provider/path_provider.dart';
import "package:photos/module/upload/model/multipart.dart";
import 'package:sqflite/sqflite.dart';
import "package:sqflite_migration/sqflite_migration.dart";
import 'package:synchronized/synchronized.dart';
class UploadLocksDB {
static const _databaseName = "ente.upload_locks.db";
@@ -53,12 +54,20 @@ class UploadLocksDB {
columnCreatedAt: "created_at",
);
static const _streamQueueTable = (
table: "stream_queue",
columnUploadedFileID: "uploaded_file_id",
columnQueueType: "queue_type", // 'create' or 'recreate'
columnCreatedAt: "created_at",
);
static final initializationScript = [
..._createUploadLocksTable(),
];
static final migrationScripts = [
..._createTrackUploadsTable(),
..._createStreamQueueTable(),
];
final dbConfig = MigrationConfig(
@@ -69,17 +78,23 @@ class UploadLocksDB {
UploadLocksDB._privateConstructor();
static final UploadLocksDB instance = UploadLocksDB._privateConstructor();
// only have a single app-wide reference to the database
static Future<Database>? _dbFuture;
static final Lock _lock = Lock();
Future<Database> get database async {
_dbFuture ??= _initDatabase();
return _dbFuture!;
// Use synchronized access to prevent concurrent initialization
return _lock.synchronized(() async {
_dbFuture ??= _initDatabase();
return _dbFuture!;
});
}
// this opens the database (and creates it if it doesn't exist)
Future<Database> _initDatabase() async {
final Directory documentsDirectory =
await getApplicationDocumentsDirectory();
final String path = join(documentsDirectory.path, _databaseName);
return await openDatabaseWithMigration(path, dbConfig);
}
@@ -137,11 +152,24 @@ class UploadLocksDB {
];
}
static List<String> _createStreamQueueTable() {
return [
'''
CREATE TABLE IF NOT EXISTS ${_streamQueueTable.table} (
${_streamQueueTable.columnUploadedFileID} INTEGER PRIMARY KEY,
${_streamQueueTable.columnQueueType} TEXT NOT NULL,
${_streamQueueTable.columnCreatedAt} INTEGER DEFAULT CURRENT_TIMESTAMP NOT NULL
)
''',
];
}
Future<void> clearTable() async {
final db = await instance.database;
await db.delete(_uploadLocksTable.table);
await db.delete(_trackUploadTable.table);
await db.delete(_partsTable.table);
await db.delete(_streamQueueTable.table);
}
Future<void> acquireLock(String id, String owner, int time) async {
@@ -187,7 +215,7 @@ class UploadLocksDB {
Future<int> releaseLock(String id, String owner) async {
final db = await instance.database;
return db.delete(
return await db.delete(
_uploadLocksTable.table,
where:
'${_uploadLocksTable.columnID} = ? AND ${_uploadLocksTable.columnOwner} = ?',
@@ -197,7 +225,7 @@ class UploadLocksDB {
Future<int> releaseLocksAcquiredByOwnerBefore(String owner, int time) async {
final db = await instance.database;
return db.delete(
return await db.delete(
_uploadLocksTable.table,
where:
'${_uploadLocksTable.columnOwner} = ? AND ${_uploadLocksTable.columnTime} < ?',
@@ -207,7 +235,7 @@ class UploadLocksDB {
Future<int> releaseAllLocksAcquiredBefore(int time) async {
final db = await instance.database;
return db.delete(
return await db.delete(
_uploadLocksTable.table,
where: '${_uploadLocksTable.columnTime} < ?',
whereArgs: [time],
@@ -519,4 +547,56 @@ class UploadLocksDB {
return row[_trackUploadTable.columnEncryptedFileName] as String;
});
}
// Stream Queue Management Methods
Future<void> addToStreamQueue(
int uploadedFileID,
String queueType, // 'create' or 'recreate'
) async {
final db = await instance.database;
await db.insert(
_streamQueueTable.table,
{
_streamQueueTable.columnUploadedFileID: uploadedFileID,
_streamQueueTable.columnQueueType: queueType,
},
conflictAlgorithm: ConflictAlgorithm.replace,
);
}
Future<void> removeFromStreamQueue(int uploadedFileID) async {
final db = await instance.database;
await db.delete(
_streamQueueTable.table,
where: '${_streamQueueTable.columnUploadedFileID} = ?',
whereArgs: [uploadedFileID],
);
}
Future<Map<int, String>> getStreamQueue() async {
final db = await instance.database;
final rows = await db.query(
_streamQueueTable.table,
columns: [
_streamQueueTable.columnUploadedFileID,
_streamQueueTable.columnQueueType,
],
);
final map = <int, String>{};
for (final row in rows) {
map[row[_streamQueueTable.columnUploadedFileID] as int] =
row[_streamQueueTable.columnQueueType] as String;
}
return map;
}
Future<bool> isInStreamQueue(int uploadedFileID) async {
final db = await instance.database;
final rows = await db.query(
_streamQueueTable.table,
where: '${_streamQueueTable.columnUploadedFileID} = ?',
whereArgs: [uploadedFileID],
);
return rows.isNotEmpty;
}
}

View File

@@ -497,7 +497,8 @@ class _EmergencyPageState extends State<EmergencyPage> {
isInAlert: true,
),
],
body: AppLocalizations.of(context).legacyInvite(contact.user.email),
body:
AppLocalizations.of(context).legacyInvite(email: contact.user.email),
actionSheetType: ActionSheetType.defaultActionSheet,
);
return;
@@ -550,7 +551,7 @@ class _EmergencyPageState extends State<EmergencyPage> {
isInAlert: true,
),
],
body: context.l10n.recoveryWarningBody(emergencyContactEmail),
body: context.l10n.recoveryWarningBody(email: emergencyContactEmail),
actionSheetType: ActionSheetType.defaultActionSheet,
);
return;

View File

@@ -117,7 +117,7 @@ class _OtherContactPageState extends State<OtherContactPage> {
)
: (recoverySession!.status == "READY"
? Text(
context.l10n.recoveryReady(accountEmail),
context.l10n.recoveryReady(email: accountEmail),
style: textTheme.body,
)
: Text(
@@ -155,8 +155,8 @@ class _OtherContactPageState extends State<OtherContactPage> {
context,
context.l10n.recoveryInitiated,
context.l10n.recoveryInitiatedDesc(
widget.contact.recoveryNoticeInDays,
Configuration.instance.getEmail()!,
days: widget.contact.recoveryNoticeInDays,
email: Configuration.instance.getEmail()!,
),
);
}

View File

@@ -284,8 +284,9 @@ class _RecoverOthersAccountState extends State<RecoverOthersAccount> {
padding:
const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
child: Text(
AppLocalizations.of(context)
.passwordStrength(passwordStrengthText),
AppLocalizations.of(context).passwordStrength(
passwordStrengthValue: passwordStrengthText,
),
style: TextStyle(
color: passwordStrengthColor,
),

View File

@@ -193,8 +193,8 @@ class _AddContactPage extends State<AddContactPage> {
title: AppLocalizations.of(context).warning,
body: AppLocalizations.of(context)
.confirmAddingTrustedContact(
emailToAdd,
30,
email: emailToAdd,
numOfDays: 30,
),
firstButtonLabel:
AppLocalizations.of(context).proceed,

View File

@@ -0,0 +1,12 @@
import "package:photos/events/event.dart";
import "package:photos/models/preview/preview_item_status.dart";
class VideoPreviewStateChangedEvent extends Event {
final int fileId;
final PreviewItemStatus status;
VideoPreviewStateChangedEvent(this.fileId, this.status);
@override
String get reason => '$runtimeType: fileId=$fileId, status=$status';
}

File diff suppressed because it is too large Load Diff

View File

@@ -1827,5 +1827,119 @@
"type": "int"
}
}
}
}
},
"videosProcessed": "Videos processed",
"totalVideos": "Total videos",
"skippedVideos": "Skipped videos",
"videoStreamingDescription": "Play videos instantly on any device. Enable to process video streams on this device.",
"videoStreamingNote": "Only videos from last 60 days and under 1 minute are processed on this device. For older/longer videos, enable streaming in the desktop app.",
"createStream": "Create stream",
"recreateStream": "Recreate stream",
"addedToStreamCreationQueue": "Added to stream creation queue",
"addedToStreamRecreationQueue": "Added to stream recreation queue",
"videoPreviewAlreadyExists": "Video preview already exists",
"videoAlreadyInQueue": "Video file already present in the queue",
"addedToQueue": "Added to queue",
"creatingStream": "Creating stream",
"similarImages": "Similar images",
"deletingProgress": "Deleting... {progress}",
"@deletingProgress": {
"placeholders": {
"progress": {
"type": "String"
}
}
},
"findSimilarImages": "Find similar images",
"noSimilarImagesFound": "No similar images found",
"yourPhotosLookUnique": "Your photos look unique",
"similarGroupsFound": "{count, plural, =1{{count} group found} other{{count} groups found}}",
"@similarGroupsFound": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"reviewAndRemoveSimilarImages": "Review and remove similar images",
"deletePhotosWithSize": "Delete {count} photos ({size})",
"@deletePhotosWithSize": {
"placeholders": {
"count": {
"type": "int"
},
"size": {
"type": "String"
}
}
},
"selectionOptions": "Selection options",
"selectExactWithCount": "Exactly similar ({count})",
"@selectExactWithCount": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"selectExact": "Select exact",
"selectSimilarWithCount": "Mostly similar ({count})",
"@selectSimilarWithCount": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"selectSimilar": "Select similar",
"selectAllWithCount": "All similarities ({count})",
"@selectAllWithCount": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"selectSimilarImagesTitle": "Select similar images",
"chooseSimilarImagesToSelect": "Select images based on their visual similarity",
"clearSelection": "Clear selection",
"similarImagesCount": "{count} similar images",
"@similarImagesCount": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"deleteWithCount": "Delete ({count})",
"@deleteWithCount": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"deleteFiles": "Delete files",
"areYouSureDeleteFiles": "Are you sure you want to delete these files?",
"greatJob": "Great job!",
"cleanedUpSimilarImages": "You cleaned up {count, plural, =1{{count} similar image} other{{count} similar images}} and freed up {size}",
"@cleanedUpSimilarImages": {
"placeholders": {
"count": {
"type": "int"
},
"size": {
"type": "String"
}
}
},
"size": "Size",
"similarity": "Similarity",
"analyzingPhotosLocally": "Analyzing your photos locally",
"lookingForVisualSimilarities": "Looking for visual similarities",
"comparingImageDetails": "Comparing image details",
"findingSimilarImages": "Finding similar images",
"almostDone": "Almost done",
"processingLocally": "Processing locally",
"useMLToFindSimilarImages": "Use ML to find images that look similar to each other."
}

View File

@@ -1776,5 +1776,56 @@
"same": "Igual",
"different": "Diferente",
"sameperson": "la misma persona?",
"indexingPausedStatusDescription": "La indexación está pausada. Se reanudará automáticamente cuando el dispositivo esté listo. El dispositivo se considera listo cuando su nivel de batería, la salud de la batería y temperatura están en un rango saludable."
"cLTitle1": "Editor avanzado de imágenes",
"cLDesc1": "Estamos lanzando un nuevo y avanzado editor de imágenes que añade más marcos de recorte, preajustes de filtros para edición rápida, opciones de ajuste finas incluyendo saturación, contraste, brillo, temperatura y mucho más. El nuevo editor también incluye la capacidad de dibujar en tus fotos y añadir emojis como pegatinas.",
"cLTitle2": "Álbumes Inteligentes",
"cLDesc2": "Ahora puedes añadir automáticamente fotos de personas seleccionadas a cualquier álbum. Solo tienes que ir al álbum, y seleccionar \"Agregar personas automáticamente\" del menú desbordante. Si se utiliza junto con el álbum compartido, puedes compartir fotos con cero clics.",
"cLTitle3": "Galería mejorada",
"cLDesc3": "Hemos añadido la capacidad de agrupar tu galería por semanas, meses y años. Ahora puedes personalizar tu galería exactamente como quieras con estas nuevas opciones de agrupación, junto con rejillas personalizadas",
"cLTitle4": "Desplazamiento más rápido",
"cLDesc4": "Junto con un montón de mejoras bajo el capó para mejorar la experiencia del desplazamiento de la galería también hemos rediseñado la barra de desplazamiento para mostrar los marcadores, permitiéndote saltar rápidamente a través de la línea de tiempo.",
"indexingPausedStatusDescription": "La indexación está pausada. Se reanudará automáticamente cuando el dispositivo esté listo. El dispositivo se considera listo cuando su nivel de batería, la salud de la batería y temperatura están en un rango saludable.",
"thisWeek": "Esta semana",
"lastWeek": "Semana pasada",
"thisMonth": "Este mes",
"thisYear": "Este año",
"groupBy": "Agrupar por",
"faceThumbnailGenerationFailed": "No se pueden generar las miniaturas de cara",
"fileAnalysisFailed": "No se puede analizar el archivo",
"editAutoAddPeople": "Editar agregar personas automáticamente",
"autoAddPeople": "Agregar personas automáticamente",
"autoAddToAlbum": "Añadir al álbum automáticamente",
"shouldRemoveFilesSmartAlbumsDesc": "¿Deben eliminarse los archivos relacionados con la persona previamente seleccionada en los álbumes inteligentes?",
"addingPhotos": "Añadiendo fotos",
"gettingReady": "Preparándose",
"addSomePhotosDesc1": "Añadir algunas fotos o elegir ",
"addSomePhotosDesc2": "caras familiares",
"addSomePhotosDesc3": "\npara comenzar con",
"ignorePerson": "Ignorar persona",
"mixedGrouping": "¿Grupo mixto?",
"analysis": "Análisis",
"doesGroupContainMultiplePeople": "¿Esta agrupación contiene varias personas?",
"automaticallyAnalyzeAndSplitGrouping": "Analizaremos automáticamente la agrupación para determinar si hay varias personas presentes, y separarlas de nuevo. Esto puede tardar unos segundos.",
"layout": "Disposición",
"day": "Día",
"peopleAutoAddDesc": "Selecciona las personas que quieres añadir automáticamente al álbum",
"undo": "Deshacer",
"redo": "Rehacer",
"filter": "Filtro",
"adjust": "Ajustar",
"draw": "Dibujar",
"sticker": "Pegatina",
"brushColor": "Color del pincel",
"font": "Fuente",
"background": "Fondo",
"align": "Alinear",
"addedToAlbums": "{count, plural, one {}=1{Añadido con éxito a 1 álbum} other{Añadido con éxito a {count} álbumes}}",
"@addedToAlbums": {
"description": "Message shown when items are added to albums",
"placeholders": {
"count": {
"type": "int"
}
}
}
}

View File

@@ -347,9 +347,11 @@
"deletePhotos": "Radera foton",
"inviteToEnte": "Bjud in till Ente",
"removePublicLink": "Ta bort publik länk",
"disableLinkMessage": "Detta kommer att ta bort den publika länken för att komma åt \"{albumName}\".",
"sharing": "Delar...",
"youCannotShareWithYourself": "Du kan inte dela med dig själv",
"archive": "Arkiv",
"createAlbumActionHint": "Långtryck för att välja foton och klicka på + för att skapa ett album",
"importing": "Importerar....",
"failedToLoadAlbums": "Det gick inte att läsa in album",
"hidden": "Dold",
@@ -360,16 +362,96 @@
"videoSmallCase": "video",
"photoSmallCase": "foto",
"singleFileDeleteHighlight": "Det kommer att tas bort från alla album.",
"singleFileInBothLocalAndRemote": "Denna {fileType} finns i både Ente och din enhet.",
"singleFileInRemoteOnly": "Denna {fileType} kommer att raderas från Ente.",
"singleFileDeleteFromDevice": "Denna {fileType} kommer att raderas från din enhet.",
"deleteFromEnte": "Radera från ente",
"yesDelete": "Ja, radera",
"movedToTrash": "Flyttad till papperskorgen",
"deleteFromDevice": "Radera från enhet",
"deleteFromBoth": "",
"newAlbum": "Nytt album",
"albums": "Album",
"memoryCount": "{count, plural, =0{inga minnen} one{{formattedCount} minne} other{{formattedCount} minnen}}",
"@memoryCount": {
"description": "The text to display the number of memories",
"type": "text",
"placeholders": {
"count": {
"example": "1",
"type": "int"
},
"formattedCount": {
"type": "String",
"example": "11.513, 11,511"
}
}
},
"selectedPhotos": "{count} markerade",
"@selectedPhotos": {
"description": "Display the number of selected photos",
"type": "text",
"placeholders": {
"count": {
"example": "5",
"type": "int"
}
}
},
"selectedPhotosWithYours": "{count} markerade ({yourCount} din)",
"@selectedPhotosWithYours": {
"description": "Display the number of selected photos, including the number of selected photos owned by the user",
"type": "text",
"placeholders": {
"count": {
"example": "12",
"type": "int"
},
"yourCount": {
"example": "2",
"type": "int"
}
}
},
"advancedSettings": "Avancerad",
"@advancedSettings": {
"description": "The text to display in the advanced settings section"
},
"photoGridSize": "Storlek på bildrutnät",
"manageDeviceStorage": "Hantera enhetscache",
"manageDeviceStorageDesc": "Granska och rensa lokal cachelagring.",
"machineLearning": "Maskininlärning",
"mlConsent": "Aktivera maskininlärning",
"mlConsentTitle": "Aktivera maskininlärning?",
"mlConsentDescription": "Om du aktiverar maskininlärning, kommer Ente extrahera information som ansiktsgeometri från filer, inklusive de som delas med dig.\n\nDetta kommer att hända på din enhet, och all genererad biometrisk information kommer att helsträckskrypteras.",
"mlConsentPrivacy": "Klicka här för mer information om denna funktion i vår integritetspolicy",
"mlConsentConfirmation": "Jag förstår och vill aktivera maskininlärning",
"magicSearch": "Magisk sökning",
"discover": "Upptäck",
"@discover": {
"description": "The text to display for the discover section under which we show receipts, screenshots, sunsets, greenery, etc."
},
"discover_identity": "Identitet",
"discover_screenshots": "Skärmdumpar",
"discover_receipts": "Kvitton",
"discover_notes": "Anteckningar",
"discover_memes": "Memes",
"discover_visiting_cards": "Besökskort",
"discover_babies": "Barn",
"discover_pets": "Husdjur",
"discover_selfies": "Selfies",
"discover_wallpapers": "Bakgrundsbilder",
"discover_food": "Mat",
"discover_celebrations": "Firanden",
"discover_sunset": "Solnedgång",
"discover_hills": "Berg",
"discover_greenery": "Grönt landskap",
"mlIndexingDescription": "Observera att maskininlärning kommer att resultera i en högre bandbredd och batterianvändning tills alla objekt är indexerade. Överväg att använda skrivbordsappen för snabbare indexering, alla resultat kommer att synkroniseras automatiskt.",
"loadingModel": "Laddar ner modeller...",
"waitingForWifi": "Väntar på WiFi...",
"status": "Status",
"indexedItems": "Indexerade objekt",
"pendingItems": "Väntande objekt",
"clearIndexes": "Rensa index",
"selectFoldersForBackup": "Välj mappar för säkerhetskopiering",
"selectedFoldersWillBeEncryptedAndBackedUp": "Valda mappar kommer att krypteras och säkerhetskopieras",
@@ -398,19 +480,47 @@
"yearsAgo": "{count, plural, one{{count} år sedan} other{{count} år sedan}}",
"backupSettings": "Säkerhetskopieringsinställningar",
"backupStatus": "Säkerhetskopieringsstatus",
"backupStatusDescription": "Objekt som har säkerhetskopierats kommer att visas här",
"backupOverMobileData": "Säkerhetskopiera via mobildata",
"backupVideos": "Säkerhetskopiera videor",
"disableAutoLock": "Inaktivera automatisk låsning",
"deviceLockExplanation": "Inaktivera enhetens skärmlås när Ente är i förgrunden och säkerhetskopiering pågår. Detta är normalt inte nödvändigt, men kan hjälpa stora uppladdningar och initial import av stora bibliotek slutföra snabbare.",
"about": "Om",
"weAreOpenSource": "Vi har öppen källkod!",
"privacy": "Sekretess",
"terms": "Villkor",
"checkForUpdates": "Sök efter uppdateringar",
"checkStatus": "Kontrollera status",
"checking": "Kontrollerar...",
"youAreOnTheLatestVersion": "Du är på den senaste versionen",
"account": "Konto",
"manageSubscription": "Hantera prenumeration",
"authToChangeYourEmail": "Autentisera för att ändra din e-postadress",
"changePassword": "Ändra lösenord",
"authToChangeYourPassword": "Autentisera för att ändra ditt lösenord",
"emailVerificationToggle": "E-postverifiering",
"exportYourData": "Exportera din data",
"logout": "Logga ut",
"authToInitiateAccountDeletion": "Vänligen autentisera för att initiera borttagning av konto",
"areYouSureYouWantToLogout": "Är du säker på att du vill logga ut?",
"yesLogout": "Ja, logga ut",
"aNewVersionOfEnteIsAvailable": "En ny version av Ente är tillgänglig.",
"update": "Uppdatera",
"installManually": "Installera manuellt",
"criticalUpdateAvailable": "Kritisk uppdatering tillgänglig",
"updateAvailable": "Uppdatering tillgänglig",
"ignoreUpdate": "Ignorera",
"downloading": "Laddar ner...",
"cannotDeleteSharedFiles": "Kan inte ta bort delade filer",
"theDownloadCouldNotBeCompleted": "Nedladdningen kunde inte slutföras",
"retry": "Försök igen",
"backedUpFolders": "Säkerhetskopiera mappar",
"backup": "Säkerhetskopiera",
"freeUpDeviceSpace": "Frigör enhetens lagringsutrymme",
"freeUpDeviceSpaceDesc": "Spara utrymme på din enhet genom att rensa filer som redan har säkerhetskopierats.",
"allClear": "✨ Allt klart",
"noDeviceThatCanBeDeleted": "Du har inga filer på denna enhet som kan tas bort",
"removeDuplicates": "Ta bort dubbletter",
"viewActiveSessions": "Visa aktiva sessioner",
"no": "Nej",
"yes": "Ja",

View File

@@ -280,7 +280,6 @@ Future<void> _init(bool isBackground, {String via = ''}) async {
}).ignore();
}
_logger.info("PushService/HomeWidget done $tlog");
VideoPreviewService.instance.init(preferences);
unawaited(SemanticSearchService.instance.init());
unawaited(MLService.instance.init());
await PersonService.init(

View File

@@ -22,6 +22,6 @@ class FillerMemory extends SmartMemory {
@override
String createTitle(AppLocalizations locals, String languageCode) {
return locals.yearsAgo(yearsAgo);
return locals.yearsAgo(count: yearsAgo);
}
}

View File

@@ -75,25 +75,25 @@ String activityTitle(
) {
switch (activity) {
case PeopleActivity.admiring:
return locals.admiringThem(personName);
return locals.admiringThem(name: personName);
case PeopleActivity.embracing:
return locals.embracingThem(personName);
return locals.embracingThem(name: personName);
case PeopleActivity.party:
return locals.partyWithThem(personName);
return locals.partyWithThem(name: personName);
case PeopleActivity.hiking:
return locals.hikingWithThem(personName);
return locals.hikingWithThem(name: personName);
case PeopleActivity.feast:
return locals.feastingWithThem(personName);
return locals.feastingWithThem(name: personName);
case PeopleActivity.selfies:
return locals.selfiesWithThem(personName);
return locals.selfiesWithThem(name: personName);
case PeopleActivity.posing:
return locals.posingWithThem(personName);
return locals.posingWithThem(name: personName);
case PeopleActivity.background:
return locals.backgroundWithThem(personName);
return locals.backgroundWithThem(name: personName);
case PeopleActivity.sports:
return locals.sportsWithThem(personName);
return locals.sportsWithThem(name: personName);
case PeopleActivity.roadtrip:
return locals.roadtripWithThem(personName);
return locals.roadtripWithThem(name: personName);
}
}
@@ -154,7 +154,7 @@ class PeopleMemory extends SmartMemory {
switch (peopleMemoryType) {
case PeopleMemoryType.youAndThem:
assert(personName != null);
return locals.youAndThem(personName!);
return locals.youAndThem(name: personName!);
case PeopleMemoryType.doingSomethingTogether:
assert(activity != null);
assert(personName != null);
@@ -163,16 +163,16 @@ class PeopleMemory extends SmartMemory {
if (personName == null) {
return locals.spotlightOnYourself;
} else if (newAge == null) {
return locals.spotlightOnThem(personName!);
return locals.spotlightOnThem(name: personName!);
} else {
if (isBirthday!) {
return locals.personIsAge(personName!, newAge!);
return locals.personIsAge(name: personName!, age: newAge!);
} else {
return locals.personTurningAge(personName!, newAge!);
return locals.personTurningAge(name: personName!, age: newAge!);
}
}
case PeopleMemoryType.lastTimeYouSawThem:
return locals.lastTimeWithThem(personName!);
return locals.lastTimeWithThem(name: personName!);
}
}
}

View File

@@ -31,21 +31,21 @@ class TimeMemory extends SmartMemory {
if (day != null) {
final dayFormat = DateFormat.MMMd(languageCode).format(day!);
if (yearsAgo != null) {
return "$dayFormat, " + locals.yearsAgo(yearsAgo!);
return "$dayFormat, " + locals.yearsAgo(count: yearsAgo!);
} else {
return locals.throughTheYears(dayFormat);
return locals.throughTheYears(dateFormat: dayFormat);
}
}
if (month != null) {
final monthFormat = DateFormat.MMMM(languageCode).format(month!);
if (yearsAgo != null) {
return "$monthFormat, " + locals.yearsAgo(yearsAgo!);
return "$monthFormat, " + locals.yearsAgo(count: yearsAgo!);
} else {
return locals.throughTheYears(monthFormat);
return locals.throughTheYears(dateFormat: monthFormat);
}
}
if (yearsAgo != null) {
return locals.thisWeekXYearsAgo(yearsAgo!);
return locals.thisWeekXYearsAgo(count: yearsAgo!);
} else {
return locals.thisWeekThroughTheYears;
}

View File

@@ -51,13 +51,13 @@ class TripMemory extends SmartMemory {
assert(locationName != null || tripYear != null);
if (locationName != null) {
if (locationName!.toLowerCase().contains("base")) return locationName!;
return locals.tripToLocation(locationName!);
return locals.tripToLocation(location: locationName!);
}
if (tripYear != null) {
if (tripYear == DateTime.now().year - 1) {
return locals.lastYearsTrip;
} else {
return locals.tripInYear(tripYear!);
return locals.tripInYear(year: tripYear!);
}
}
throw ArgumentError("TripMemory must have a location name or trip year");

View File

@@ -15,7 +15,6 @@ class SimilarFiles {
int get totalSize => files.fold(0, (sum, file) => sum + (file.fileSize ?? 0));
// TODO: lau: check if we're not using this wrong
bool get isEmpty => files.isEmpty;
int get length => files.length;

View File

@@ -6,6 +6,7 @@ import "package:package_info_plus/package_info_plus.dart";
import "package:photos/gateways/entity_gw.dart";
import "package:photos/module/download/manager.dart";
import "package:photos/services/account/billing_service.dart";
import "package:photos/services/collections_service.dart";
import "package:photos/services/entity_service.dart";
import "package:photos/services/filedata/filedata_service.dart";
import "package:photos/services/location_service.dart";
@@ -183,3 +184,9 @@ SmartAlbumsService get smartAlbumsService {
_smartAlbumsService ??= SmartAlbumsService();
return _smartAlbumsService!;
}
CollectionsService? _collectionsService;
CollectionsService get collectionsService {
_collectionsService ??= CollectionsService.instance;
return _collectionsService!;
}

View File

@@ -527,7 +527,7 @@ class UserService {
if (response.statusCode == 200) {
showShortToast(
context,
AppLocalizations.of(context).emailChangedTo(email),
AppLocalizations.of(context).emailChangedTo(newEmail: email),
);
await setEmail(email);
Navigator.of(context).popUntil((route) => route.isFirst);

View File

@@ -7,12 +7,17 @@ import "package:flutter/services.dart";
import "package:photos/utils/ffprobe_util.dart";
class IsolatedFfmpegService {
static Future<Map> runFfmpeg(String command) async {
IsolatedFfmpegService._privateConstructor();
static final IsolatedFfmpegService instance =
IsolatedFfmpegService._privateConstructor();
Future<Map> runFfmpeg(String command) async {
final rootIsolateToken = RootIsolateToken.instance!;
return await Isolate.run<Map>(() => _ffmpegRun(command, rootIsolateToken));
}
static Future<Map> getVideoInfo(String file) async {
Future<Map> getVideoInfo(String file) async {
final rootIsolateToken = RootIsolateToken.instance!;
return await Isolate.run<Map>(() => _getVideoProps(file, rootIsolateToken));
}

View File

@@ -76,13 +76,15 @@ class ComputeController {
_logger.info("Device not healthy or user interacting, denying request.");
return false;
}
bool result = false;
if (ml) {
return _requestML();
result = _requestML();
} else if (stream) {
return _requestStream();
result = _requestStream();
} else {
_logger.severe("No compute request specified, denying request.");
}
_logger.severe("No compute request specified, denying request.");
return false;
return result;
}
bool _requestML() {

View File

@@ -71,6 +71,9 @@ class MLService {
// Listen on ComputeController
Bus.instance.on<ComputeControlEvent>().listen((event) {
if (!flagService.hasGrantedMLConsent) {
if (event.shouldRun) {
VideoPreviewService.instance.queueFiles(duration: Duration.zero);
}
return;
}

View File

@@ -764,7 +764,7 @@ class MemoriesCacheService {
final s = await LanguageService.locals;
await NotificationService.instance.scheduleNotification(
memory.personName != null
? s.wishThemAHappyBirthday(memory.personName!)
? s.wishThemAHappyBirthday(name: memory.personName!)
: s.happyBirthday,
id: memory.id.hashCode,
channelID: "birthday",

View File

@@ -17,6 +17,7 @@ import 'package:photos/events/files_updated_event.dart';
import 'package:photos/events/force_reload_home_gallery_event.dart';
import 'package:photos/events/local_photos_updated_event.dart';
import 'package:photos/events/sync_status_update_event.dart';
import "package:photos/main.dart" show isProcessBg;
import 'package:photos/models/device_collection.dart';
import "package:photos/models/file/extensions/file_props.dart";
import 'package:photos/models/file/file.dart';
@@ -31,7 +32,6 @@ import 'package:photos/services/local_file_update_service.dart';
import "package:photos/services/notification_service.dart";
import 'package:photos/services/sync/diff_fetcher.dart';
import 'package:photos/services/sync/sync_service.dart';
import "package:photos/services/video_preview_service.dart";
import 'package:photos/utils/file_uploader.dart';
import 'package:photos/utils/file_util.dart';
import 'package:shared_preferences/shared_preferences.dart';
@@ -132,13 +132,9 @@ class RemoteSyncService {
}
if (
// Only Uploading Previews in fg to prevent heating issues
AppLifecycleService.instance.isForeground &&
// if ML is enabled the MLService will queue when ML is done
!flagService.hasGrantedMLConsent) {
fileDataService.syncFDStatus().then((_) {
VideoPreviewService.instance.queueFiles();
}).ignore();
// We don't need syncFDStatus here if in background
!isProcessBg) {
fileDataService.syncFDStatus().ignore();
}
final filesToBeUploaded = await _getFilesToBeUploaded();
@@ -377,7 +373,7 @@ class RemoteSyncService {
localIDsToSync.removeAll(alreadyClaimedLocalIDs);
if (alreadyClaimedLocalIDs.isNotEmpty && !_hasCleanupStaleEntry) {
try {
await _db.removeQueuedLocalFiles(alreadyClaimedLocalIDs);
await _db.removeQueuedLocalFiles(alreadyClaimedLocalIDs, ownerID);
} catch (e, s) {
_logger.severe("removeQueuedLocalFiles failed", e, s);
}

View File

@@ -15,19 +15,21 @@ import "package:path_provider/path_provider.dart";
import "package:photos/core/cache/video_cache_manager.dart";
import "package:photos/core/configuration.dart";
import "package:photos/core/event_bus.dart";
import "package:photos/core/network/network.dart";
import 'package:photos/db/files_db.dart';
import "package:photos/db/upload_locks_db.dart";
import "package:photos/events/video_preview_state_changed_event.dart";
import "package:photos/events/video_streaming_changed.dart";
import 'package:photos/generated/intl/app_localizations.dart';
import "package:photos/models/base/id.dart";
import "package:photos/models/ffmpeg/ffprobe_props.dart";
import "package:photos/models/file/file.dart";
import "package:photos/models/file/file_type.dart";
import "package:photos/models/metadata/file_magic.dart";
import "package:photos/models/preview/playlist_data.dart";
import "package:photos/models/preview/preview_item.dart";
import "package:photos/models/preview/preview_item_status.dart";
import "package:photos/service_locator.dart";
import "package:photos/services/collections_service.dart";
import "package:photos/services/file_magic_service.dart";
import "package:photos/services/filedata/model/file_data.dart";
import "package:photos/services/isolated_ffmpeg_service.dart";
import "package:photos/ui/notification/toast.dart";
@@ -36,7 +38,6 @@ import "package:photos/utils/file_key.dart";
import "package:photos/utils/file_util.dart";
import "package:photos/utils/gzip.dart";
import "package:photos/utils/network_util.dart";
import "package:shared_preferences/shared_preferences.dart";
const _maxRetryCount = 3;
@@ -47,39 +48,54 @@ class VideoPreviewService {
final int _maxPreviewSizeLimitForCache = 50 * 1024 * 1024; // 50 MB
Set<int>? _failureFiles;
bool _hasQueuedFile = false;
bool get _hasQueuedFile => fileQueue.isNotEmpty;
VideoPreviewService._privateConstructor();
VideoPreviewService._privateConstructor()
: serviceLocator = ServiceLocator.instance,
filesDB = FilesDB.instance,
uploadLocksDB = UploadLocksDB.instance,
ffmpegService = IsolatedFfmpegService.instance,
fileMagicService = FileMagicService.instance,
cacheManager = DefaultCacheManager(),
videoCacheManager = VideoCacheManager.instance,
config = Configuration.instance;
VideoPreviewService(
this.config,
this.serviceLocator,
this.filesDB,
this.uploadLocksDB,
this.fileMagicService,
this.ffmpegService,
this.cacheManager,
this.videoCacheManager,
);
static final VideoPreviewService instance =
VideoPreviewService._privateConstructor();
final cacheManager = DefaultCacheManager();
final videoCacheManager = VideoCacheManager.instance;
int uploadingFileId = -1;
final _enteDio = NetworkClient.instance.enteDio;
final _nonEnteDio = NetworkClient.instance.getDio();
final CollectionsService collectionsService = CollectionsService.instance;
final Configuration config;
final ServiceLocator serviceLocator;
final FilesDB filesDB;
final UploadLocksDB uploadLocksDB;
final FileMagicService fileMagicService;
final IsolatedFfmpegService ffmpegService;
final DefaultCacheManager cacheManager;
final CacheManager videoCacheManager;
void init(SharedPreferences prefs) {
_prefs = prefs;
}
late final SharedPreferences _prefs;
static const String _videoStreamingEnabled = "videoStreamingEnabled";
bool get isVideoStreamingEnabled {
return _prefs.getBool(_videoStreamingEnabled) ?? false;
return serviceLocator.prefs.getBool(_videoStreamingEnabled) ?? false;
}
Future<void> setIsVideoStreamingEnabled(bool value) async {
_prefs.setBool(_videoStreamingEnabled, value).ignore();
serviceLocator.prefs.setBool(_videoStreamingEnabled, value).ignore();
Bus.instance.fire(VideoStreamingChanged());
if (isVideoStreamingEnabled) {
await fileDataService.syncFDStatus();
queueFiles(duration: Duration.zero);
} else {
clearQueue();
@@ -87,13 +103,81 @@ class VideoPreviewService {
}
void clearQueue() {
// Fire events for all items being cleared
for (final entry in _items.entries) {
_fireVideoPreviewStateChange(entry.key, PreviewItemStatus.uploaded);
}
fileQueue.clear();
_items.clear();
_hasQueuedFile = false;
}
void _fireVideoPreviewStateChange(int fileId, PreviewItemStatus status) {
Bus.instance.fire(VideoPreviewStateChangedEvent(fileId, status));
}
// Return value indicates file was successfully added to queue or not
Future<bool> addToManualQueue(EnteFile file, String queueType) async {
if (file.uploadedFileID == null) return false;
// Check if already in queue
final bool alreadyInQueue =
await uploadLocksDB.isInStreamQueue(file.uploadedFileID!);
if (alreadyInQueue) {
return false; // Indicates file was already in queue
}
// Add to persistent database queue
await uploadLocksDB.addToStreamQueue(file.uploadedFileID!, queueType);
// Start processing if not already processing
if (uploadingFileId < 0) {
queueFiles(duration: Duration.zero);
} else {
_items[file.uploadedFileID!] = PreviewItem(
status: PreviewItemStatus.inQueue,
file: file,
retryCount: 0,
collectionID: file.collectionID ?? 0,
);
_fireVideoPreviewStateChange(
file.uploadedFileID!,
PreviewItemStatus.inQueue,
);
fileQueue[file.uploadedFileID!] = file;
}
return true;
}
bool isCurrentlyProcessing(int? uploadedFileID) {
if (uploadedFileID == null) return false;
return uploadingFileId == uploadedFileID;
}
Future<bool> _isRecreateOperation(EnteFile file) async {
if (file.uploadedFileID == null) return false;
try {
// Check database directly instead of relying on in-memory _manualQueueFiles
// which might not be populated yet
final manualQueueFiles = await uploadLocksDB.getStreamQueue();
final queueType = manualQueueFiles[file.uploadedFileID!];
return queueType == 'recreate';
} catch (_) {
return false;
}
}
Future<void> _ensurePreviewIdsInitialized() async {
// Ensure fileDataService previewIds is initialized before using it
if (fileDataService.previewIds.isEmpty) {
await fileDataService.syncFDStatus();
}
}
Future<bool> isSharedFileStreamble(EnteFile file) async {
try {
await _ensurePreviewIdsInitialized();
if (fileDataService.previewIds.containsKey(file.uploadedFileID)) {
return true;
}
@@ -104,6 +188,66 @@ class VideoPreviewService {
}
}
Future<List<EnteFile>> _getFiles({
DateTime? beginDate,
bool onlyFilesWithLocalId = true,
}) async {
return await filesDB.getStreamingEligibleVideoFiles(
beginDate: beginDate,
userID: config.getUserID()!,
onlyFilesWithLocalId: onlyFilesWithLocalId,
);
}
Future<double> calcStatus(
List<EnteFile> files,
Map<int, PreviewInfo> previewIds,
) async {
// This is the total video files that have streams
final Set<int> processed = previewIds.keys.toSet();
// Total: Total Remote video files owned - skipped video files
// + processed videos (any platform)
final Set<int> total = {...processed};
for (final file in files) {
// skipped -> don't add
if (file.pubMagicMetadata?.sv == 1) {
continue;
}
// Include the file to total set
total.add(file.uploadedFileID!);
}
// If total is empty then mark all as processed else compute the ratio
// of processed files and total remote video files
// netProcessedItems = processed / total
final double netProcessedItems =
total.isEmpty ? 1 : (processed.length / total.length).clamp(0, 1);
// Store the data and return it
final status = netProcessedItems;
return status;
}
Future<double> getStatus() async {
try {
await _ensurePreviewIdsInitialized();
// This will get us all the video files that are present on remote
// and also that could be / have been skipped due to device
// limitations
final files = await _getFiles(
beginDate: null,
onlyFilesWithLocalId: false,
);
return calcStatus(files, fileDataService.previewIds);
} catch (e, s) {
_logger.severe('Error getting Streaming status', e, s);
rethrow;
}
}
Future<void> chunkAndUploadVideo(
BuildContext? ctx,
EnteFile enteFile, [
@@ -126,10 +270,14 @@ class VideoPreviewService {
return;
}
try {
// check if playlist already exist
if (await getPlaylist(enteFile) != null) {
// check if playlist already exist, but skip this check for 'recreate' operations
final isRecreateOperation = await _isRecreateOperation(enteFile);
if (!isRecreateOperation && await getPlaylist(enteFile) != null) {
if (ctx != null && ctx.mounted) {
showShortToast(ctx, 'Video preview already exists');
showShortToast(
ctx,
AppLocalizations.of(ctx).videoPreviewAlreadyExists,
);
}
removeFile = true;
return;
@@ -143,6 +291,9 @@ class VideoPreviewService {
return;
}
}
_logger.info(
"Starting video preview generation for ${enteFile.displayName}",
);
// elimination case for <=10 MB with H.264
var (props, result, file) = await _checkFileForPreviewCreation(enteFile);
if (result) {
@@ -162,6 +313,10 @@ class VideoPreviewService {
: _items[enteFile.uploadedFileID!]?.retryCount ?? 0,
collectionID: enteFile.collectionID ?? 0,
);
_fireVideoPreviewStateChange(
enteFile.uploadedFileID!,
PreviewItemStatus.inQueue,
);
fileQueue[enteFile.uploadedFileID!] = enteFile;
return;
}
@@ -175,6 +330,10 @@ class VideoPreviewService {
forceUpload ? 0 : _items[enteFile.uploadedFileID!]?.retryCount ?? 0,
collectionID: enteFile.collectionID ?? 0,
);
_fireVideoPreviewStateChange(
enteFile.uploadedFileID!,
PreviewItemStatus.compressing,
);
// get file
file ??= await getFile(enteFile, isOrigin: true);
@@ -187,8 +346,9 @@ class VideoPreviewService {
props ??= await getVideoPropsAsync(file);
final fileSize = enteFile.fileSize ?? file.lengthSync();
final videoData = List.from(props?.propData?["streams"] ?? [])
.firstWhereOrNull((e) => e["type"] == "video");
final videoData = List.from(
props?.propData?["streams"] ?? [],
).firstWhereOrNull((e) => e["type"] == "video");
final codec = videoData["codec_name"]?.toString().toLowerCase();
final isH264 = codec?.contains("h264") ?? false;
@@ -203,7 +363,7 @@ class VideoPreviewService {
(colorTransfer == "smpte2084" || colorTransfer == "arib-std-b67");
// create temp file & directory for preview generation
final String tempDir = Configuration.instance.getTempDirectory();
final String tempDir = config.getTempDirectory();
final String prefix =
"${tempDir}_${enteFile.uploadedFileID}_${newID("pv")}";
Directory(prefix).createSync();
@@ -214,8 +374,10 @@ class VideoPreviewService {
keyfile.writeAsBytesSync(key.bytes);
final keyinfo = File('$prefix/mykey.keyinfo');
keyinfo.writeAsStringSync("data:text/plain;base64,${key.base64}\n"
"${keyfile.path}\n");
keyinfo.writeAsStringSync(
"data:text/plain;base64,${key.base64}\n"
"${keyfile.path}\n",
);
_logger.info(
'Generating HLS Playlist ${enteFile.displayName} at $prefix/output.m3u8',
@@ -267,19 +429,19 @@ class VideoPreviewService {
_logger.info(command);
final playlistGenResult = await IsolatedFfmpegService.runFfmpeg(
final playlistGenResult = await ffmpegService
.runFfmpeg(
// input file path
'-i "${file.path}" ' +
// main params for streaming
command +
// output file path
'$prefix/output.m3u8',
).onError(
(error, stackTrace) {
_logger.warning("FFmpeg command failed", error, stackTrace);
return {};
},
);
)
.onError((error, stackTrace) {
_logger.warning("FFmpeg command failed", error, stackTrace);
return {};
});
final playlistGenReturnCode = playlistGenResult["returnCode"] as int?;
@@ -294,6 +456,10 @@ class VideoPreviewService {
collectionID: enteFile.collectionID ?? 0,
retryCount: _items[enteFile.uploadedFileID!]?.retryCount ?? 0,
);
_fireVideoPreviewStateChange(
enteFile.uploadedFileID!,
PreviewItemStatus.uploading,
);
_logger.info('Playlist Generated ${enteFile.displayName}');
@@ -305,18 +471,18 @@ class VideoPreviewService {
objectSize = result.$2;
// Fetch resolution of generated stream by decrypting a single frame
final playlistFrameResult = await IsolatedFfmpegService.runFfmpeg(
final playlistFrameResult = await ffmpegService
.runFfmpeg(
'-allowed_extensions ALL -i "$prefix/output.m3u8" -frames:v 1 -c copy "$prefix/frame.ts"',
).onError(
(error, stackTrace) {
_logger.warning(
"FFmpeg command failed for frame",
error,
stackTrace,
);
return {};
},
);
)
.onError((error, stackTrace) {
_logger.warning(
"FFmpeg command failed for frame",
error,
stackTrace,
);
return {};
});
final playlistFrameReturnCode =
playlistFrameResult["returnCode"] as int?;
int? width, height;
@@ -373,11 +539,14 @@ class VideoPreviewService {
retryCount: _items[enteFile.uploadedFileID!]!.retryCount,
collectionID: enteFile.collectionID ?? 0,
);
_fireVideoPreviewStateChange(
enteFile.uploadedFileID!,
PreviewItemStatus.uploaded,
);
_removeFromLocks(enteFile).ignore();
Directory(prefix).delete(recursive: true).ignore();
}
} finally {
computeController.releaseCompute(stream: true);
if (error != null) {
_retryFile(enteFile, error);
} else if (removeFile) {
@@ -397,6 +566,8 @@ class VideoPreviewService {
final file = entry.value;
fileQueue.remove(entry.key);
await chunkAndUploadVideo(ctx, file);
} else {
computeController.releaseCompute(stream: true);
}
}
}
@@ -404,16 +575,27 @@ class VideoPreviewService {
Future<void> _removeFromLocks(EnteFile enteFile) async {
final bool isFailurePresent =
_failureFiles?.contains(enteFile.uploadedFileID!) ?? false;
final bool isInManualQueue =
await uploadLocksDB.isInStreamQueue(enteFile.uploadedFileID!);
if (isFailurePresent) {
await UploadLocksDB.instance
.deleteStreamUploadErrorEntry(enteFile.uploadedFileID!);
await uploadLocksDB.deleteStreamUploadErrorEntry(
enteFile.uploadedFileID!,
);
_failureFiles?.remove(enteFile.uploadedFileID!);
}
if (isInManualQueue) {
await uploadLocksDB.removeFromStreamQueue(enteFile.uploadedFileID!);
}
}
void _removeFile(EnteFile enteFile) {
_items.remove(enteFile.uploadedFileID!);
final fileId = enteFile.uploadedFileID!;
_items.remove(fileId);
// Note: Using 'uploaded' status as there's no 'removed' status in PreviewItemStatus
// This indicates the item has been successfully processed and removed from queue
_fireVideoPreviewStateChange(fileId, PreviewItemStatus.uploaded);
}
void _retryFile(EnteFile enteFile, Object error) {
@@ -424,6 +606,10 @@ class VideoPreviewService {
retryCount: _items[enteFile.uploadedFileID!]!.retryCount + 1,
collectionID: enteFile.collectionID ?? 0,
);
_fireVideoPreviewStateChange(
enteFile.uploadedFileID!,
PreviewItemStatus.retry,
);
fileQueue[enteFile.uploadedFileID!] = enteFile;
} else {
_items[enteFile.uploadedFileID!] = PreviewItem(
@@ -433,17 +619,21 @@ class VideoPreviewService {
collectionID: enteFile.collectionID ?? 0,
error: error,
);
_fireVideoPreviewStateChange(
enteFile.uploadedFileID!,
PreviewItemStatus.failed,
);
final bool isFailurePresent =
_failureFiles?.contains(enteFile.uploadedFileID!) ?? false;
if (isFailurePresent) {
UploadLocksDB.instance.appendStreamEntry(
uploadLocksDB.appendStreamEntry(
enteFile.uploadedFileID!,
error.toString(),
);
} else {
UploadLocksDB.instance.appendStreamEntry(
uploadLocksDB.appendStreamEntry(
enteFile.uploadedFileID!,
error.toString(),
);
@@ -474,7 +664,7 @@ class VideoPreviewService {
},
encryptionKey,
);
final _ = await _enteDio.put(
final _ = await serviceLocator.enteDio.put(
"/files/video-data",
data: {
"fileID": file.uploadedFileID!,
@@ -493,7 +683,7 @@ class VideoPreviewService {
Future<(String, int)> _uploadPreviewVideo(EnteFile file, File preview) async {
_logger.info("Pushing preview for $file");
try {
final response = await _enteDio.get(
final response = await serviceLocator.enteDio.get(
"/files/data/preview-upload-url",
queryParameters: {
"fileID": file.uploadedFileID!,
@@ -503,14 +693,10 @@ class VideoPreviewService {
final uploadURL = response.data["url"];
final String objectID = response.data["objectID"];
final objectSize = preview.lengthSync();
final _ = await _enteDio.put(
final _ = await serviceLocator.enteDio.put(
uploadURL,
data: preview.openRead(),
options: Options(
headers: {
Headers.contentLengthHeader: objectSize,
},
),
options: Options(headers: {Headers.contentLengthHeader: objectSize}),
);
return (objectID, objectSize);
} catch (e) {
@@ -538,6 +724,7 @@ class VideoPreviewService {
Future<PlaylistData?> _getPlaylist(EnteFile file) async {
_logger.info("Getting playlist for $file");
int? width, height, size;
try {
late final String objectID;
final PreviewInfo? previewInfo =
@@ -553,8 +740,9 @@ class VideoPreviewService {
objectID = previewInfo.objectId;
}
final FileInfo? playlistCache =
await cacheManager.getFileFromCache(_getCacheKey(objectID));
final FileInfo? playlistCache = await cacheManager.getFileFromCache(
_getCacheKey(objectID),
);
final detailsCache = await cacheManager.getFileFromCache(
_getDetailsCacheKey(objectID),
);
@@ -576,9 +764,7 @@ class VideoPreviewService {
unawaited(
cacheManager.putFile(
_getCacheKey(objectID),
Uint8List.fromList(
(playlistData["playlist"] as String).codeUnits,
),
Uint8List.fromList((playlistData["playlist"] as String).codeUnits),
),
);
unawaited(
@@ -594,8 +780,9 @@ class VideoPreviewService {
),
);
}
final videoFile = (await videoCacheManager
.getFileFromCache(_getVideoPreviewKey(objectID)))
final videoFile = (await videoCacheManager.getFileFromCache(
_getVideoPreviewKey(objectID),
))
?.file;
if (videoFile == null) {
previewURLResult = previewURLResult ?? await _getPreviewUrl(file);
@@ -607,21 +794,26 @@ class VideoPreviewService {
),
);
}
finalPlaylist =
finalPlaylist.replaceAll('\noutput.ts', '\n${previewURLResult.$1}');
finalPlaylist = finalPlaylist.replaceAll(
'\noutput.ts',
'\n${previewURLResult.$1}',
);
} else {
finalPlaylist =
finalPlaylist.replaceAll('\noutput.ts', '\n${videoFile.path}');
finalPlaylist = finalPlaylist.replaceAll(
'\noutput.ts',
'\n${videoFile.path}',
);
}
final tempDir = await getTemporaryDirectory();
final playlistFile = File("${tempDir.path}/${file.uploadedFileID}.m3u8");
await playlistFile.writeAsString(finalPlaylist);
final String log = (StringBuffer()
..write("[CACHE-STATUS] ")
..write("Video: ${videoFile != null ? '' : ''} | ")
..write("Details: ${detailsCache != null ? '' : ''} | ")
..write("Playlist: ${playlistCache != null ? '' : ''}"))
.toString();
final String log = (
StringBuffer()
..write("[CACHE-STATUS] ")
..write("Video: ${videoFile != null ? '' : ''} | ")
..write("Details: ${detailsCache != null ? '' : ''} | ")
..write("Playlist: ${playlistCache != null ? '' : ''}"),
).toString();
_logger.info("Mapped playlist to ${playlistFile.path}, $log");
final data = PlaylistData(
preview: playlistFile,
@@ -631,11 +823,7 @@ class VideoPreviewService {
durationInSeconds: parseDurationFromHLS(finalPlaylist),
);
if (shouldAppendPreview) {
fileDataService.appendPreview(
file.uploadedFileID!,
objectID,
size!,
);
fileDataService.appendPreview(file.uploadedFileID!, objectID, size!);
}
return data;
} catch (_) {
@@ -646,24 +834,19 @@ class VideoPreviewService {
Future<Map<String, dynamic>> _getPlaylistData(EnteFile file) async {
late Response<dynamic> response;
if (collectionsService.isSharedPublicLink(file.collectionID!)) {
response = await _nonEnteDio.get(
"${Configuration.instance.getHttpEndpoint()}/public-collection/files/data/fetch/",
queryParameters: {
"fileID": file.uploadedFileID,
"type": "vid_preview",
},
response = await serviceLocator.nonEnteDio.get(
"${config.getHttpEndpoint()}/public-collection/files/data/fetch/",
queryParameters: {"fileID": file.uploadedFileID, "type": "vid_preview"},
options: Options(
headers:
collectionsService.publicCollectionHeaders(file.collectionID!),
headers: collectionsService.publicCollectionHeaders(
file.collectionID!,
),
),
);
} else {
response = await _enteDio.get(
response = await serviceLocator.enteDio.get(
"/files/data/fetch/",
queryParameters: {
"fileID": file.uploadedFileID,
"type": "vid_preview",
},
queryParameters: {"fileID": file.uploadedFileID, "type": "vid_preview"},
);
}
final encryptedData = response.data["data"]["encryptedData"];
@@ -683,10 +866,7 @@ class VideoPreviewService {
for (final line in lines) {
if (line.startsWith("#EXTINF:")) {
// Extract duration value (e.g., "#EXTINF:2.400000," → "2.400000")
final durationStr = line.substring(
8,
line.length - 1,
);
final durationStr = line.substring(8, line.length - 1);
final duration = double.tryParse(durationStr);
if (duration != null) {
totalDuration += duration;
@@ -700,21 +880,22 @@ class VideoPreviewService {
try {
late String url;
if (collectionsService.isSharedPublicLink(file.collectionID!)) {
final response = await _nonEnteDio.get(
"${Configuration.instance.getHttpEndpoint()}/public-collection/files/data/preview",
final response = await serviceLocator.nonEnteDio.get(
"${config.getHttpEndpoint()}/public-collection/files/data/preview",
queryParameters: {
"fileID": file.uploadedFileID,
"type":
file.fileType == FileType.video ? "vid_preview" : "img_preview",
},
options: Options(
headers:
collectionsService.publicCollectionHeaders(file.collectionID!),
headers: collectionsService.publicCollectionHeaders(
file.collectionID!,
),
),
);
url = (response.data["url"] as String);
} else {
final response = await _enteDio.get(
final response = await serviceLocator.enteDio.get(
"/files/data/preview",
queryParameters: {
"fileID": file.uploadedFileID,
@@ -739,9 +920,7 @@ class VideoPreviewService {
EnteFile enteFile,
) async {
if ((enteFile.pubMagicMetadata?.sv ?? 0) == 1) {
_logger.info(
"Skip Preview due to sv=1 for ${enteFile.displayName}",
);
_logger.info("Skip Preview due to sv=1 for ${enteFile.displayName}");
return (null, true, null);
}
if (enteFile.fileSize == null || enteFile.duration == null) {
@@ -753,9 +932,7 @@ class VideoPreviewService {
final int size = enteFile.fileSize!;
final int duration = enteFile.duration!;
if (size >= 500 * 1024 * 1024 || duration > 60) {
_logger.info(
"Skip Preview due to size: $size or duration: $duration",
);
_logger.info("Skip Preview due to size: $size or duration: $duration");
return (null, true, null);
}
FFProbeProps? props;
@@ -767,8 +944,9 @@ class VideoPreviewService {
file = await getFile(enteFile, isOrigin: true);
if (file != null) {
props = await getVideoPropsAsync(file);
final videoData = List.from(props?.propData?["streams"] ?? [])
.firstWhereOrNull((e) => e["type"] == "video");
final videoData = List.from(
props?.propData?["streams"] ?? [],
).firstWhereOrNull((e) => e["type"] == "video");
final codec = videoData["codec_name"]?.toString().toLowerCase();
skipFile = codec?.contains("h264") ?? false;
@@ -776,6 +954,10 @@ class VideoPreviewService {
_logger.info(
"[init] Ignoring file ${enteFile.displayName} for preview due to codec",
);
await fileMagicService.updatePublicMagicMetadata(
[enteFile],
{streamVersionKey: 1},
);
return (props, skipFile, file);
}
}
@@ -787,35 +969,96 @@ class VideoPreviewService {
}
// generate stream for all files after cutoff date
Future<void> _putFilesForPreviewCreation([bool updateInit = false]) async {
Future<void> _putFilesForPreviewCreation() async {
if (!isVideoStreamingEnabled || !await canUseHighBandwidth()) return;
if (updateInit) _hasQueuedFile = true;
Map<int, String> failureFiles = {};
Map<int, String> manualQueueFiles = {};
try {
failureFiles = await UploadLocksDB.instance.getStreamUploadError();
failureFiles = await uploadLocksDB.getStreamUploadError();
_failureFiles = {...failureFiles.keys};
manualQueueFiles = await uploadLocksDB.getStreamQueue();
// handle case when failures are already previewed
for (final failure in _failureFiles!) {
if (_items.containsKey(failure)) {
UploadLocksDB.instance.deleteStreamUploadErrorEntry(failure).ignore();
uploadLocksDB.deleteStreamUploadErrorEntry(failure).ignore();
}
}
// handle case when manual queue items are already previewed (for 'create' type only)
for (final queueItem in manualQueueFiles.keys) {
final queueType = manualQueueFiles[queueItem];
final hasPreview = fileDataService.previewIds[queueItem] != null;
if (hasPreview && queueType == 'create') {
// Remove from queue only if it's a 'create' type and preview exists
await uploadLocksDB.removeFromStreamQueue(queueItem);
}
}
// Refresh manual queue after cleanup
manualQueueFiles = await uploadLocksDB.getStreamQueue();
} catch (_) {}
final files = await FilesDB.instance.getAllFilesAfterDate(
fileType: FileType.video,
beginDate: DateTime.now().subtract(
const Duration(days: 30),
),
userID: Configuration.instance.getUserID()!,
final files = await _getFiles(
beginDate: DateTime.now().subtract(const Duration(days: 60)),
onlyFilesWithLocalId: true,
);
final previewIds = fileDataService.previewIds;
_logger.info(
"[init] Found ${files.length} files in last 60 days, ${manualQueueFiles.length} manual queue files: ${manualQueueFiles.keys.toList()}",
);
final previewIds = fileDataService.previewIds;
final allFiles =
files.where((file) => previewIds[file.uploadedFileID] == null).toList();
// Add manual queue files first (they have priority)
for (final queueFileId in manualQueueFiles.keys) {
final queueType = manualQueueFiles[queueFileId] ?? 'create';
final hasPreview = previewIds[queueFileId] != null;
// For create, only add if no preview exists
if (queueType == 'create' && hasPreview) {
_logger.info(
"[manual-queue] Skipping file $queueFileId (type=$queueType, hasPreview=$hasPreview)",
);
continue;
}
// First try to find the file in the 60-day list
var queueFile =
files.firstWhereOrNull((f) => f.uploadedFileID == queueFileId);
// If not found in 60-day list, fetch it individually
queueFile ??=
await filesDB.getAnyUploadedFile(queueFileId).catchError((e) => null);
if (queueFile == null) {
await uploadLocksDB
.removeFromStreamQueue(queueFileId)
.catchError((e) {});
continue;
}
_items[queueFile.uploadedFileID!] = PreviewItem(
status: PreviewItemStatus.inQueue,
file: queueFile,
collectionID: queueFile.collectionID ?? 0,
);
_fireVideoPreviewStateChange(
queueFile.uploadedFileID!,
PreviewItemStatus.inQueue,
);
fileQueue[queueFile.uploadedFileID!] = queueFile;
}
// Then add regular files that need processing
final allFiles = files
.where(
(file) =>
previewIds[file.uploadedFileID] == null &&
!manualQueueFiles.containsKey(file.uploadedFileID),
)
.toList();
// set all video status to in queue
var n = allFiles.length, i = 0;
@@ -831,6 +1074,10 @@ class VideoPreviewService {
retryCount: _maxRetryCount,
error: failureFiles[enteFile.uploadedFileID!],
);
_fireVideoPreviewStateChange(
enteFile.uploadedFileID!,
PreviewItemStatus.failed,
);
}
if (isFailure) {
_logger.info(
@@ -846,25 +1093,29 @@ class VideoPreviewService {
file: enteFile,
collectionID: enteFile.collectionID ?? 0,
);
_fireVideoPreviewStateChange(
enteFile.uploadedFileID!,
PreviewItemStatus.inQueue,
);
fileQueue[enteFile.uploadedFileID!] = enteFile;
i++;
}
if (allFiles.isEmpty) {
final totalFiles = fileQueue.length;
if (totalFiles == 0) {
_logger.info("[init] No preview to cache");
return;
}
_logger.info("[init] Processing ${allFiles.length} items for streaming");
_logger.info(
"[init] Processing $totalFiles items for streaming (${manualQueueFiles.length} manual requested, ${fileQueue.length} queued, ${allFiles.length} regular)",
);
// take first file and put it for stream generation
final file = allFiles.removeAt(0);
for (final enteFile in allFiles) {
if (_items.containsKey(enteFile.uploadedFileID!)) {
continue;
}
fileQueue[enteFile.uploadedFileID!] = enteFile;
}
final entry = fileQueue.entries.first;
final file = entry.value;
fileQueue.remove(entry.key);
chunkAndUploadVideo(null, file).ignore();
}
@@ -874,12 +1125,14 @@ class VideoPreviewService {
}
void queueFiles({Duration duration = const Duration(seconds: 5)}) {
Future.delayed(duration, () {
if (!_hasQueuedFile && _allowStream()) {
_putFilesForPreviewCreation(true).catchError((_) {
_hasQueuedFile = false;
});
}
Future.delayed(duration, () async {
if (_hasQueuedFile) return;
final isStreamAllowed = _allowStream();
if (!isStreamAllowed) return;
await _ensurePreviewIdsInitialized();
await _putFilesForPreviewCreation();
});
}
}

View File

@@ -1,12 +0,0 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.11.1.
// ignore_for_file: require_trailing_commas
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
import 'package:photos/src/rust/frb_generated.dart';
String greet({required String name}) =>
RustLib.instance.api.crateApiSimpleGreet(name: name);

View File

@@ -1,57 +0,0 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.11.1.
// ignore_for_file: require_trailing_commas
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
import 'package:photos/src/rust/frb_generated.dart';
// These functions are ignored because they are not marked as `pub`: `ensure_capacity`, `save_index`
// Rust type: RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<VectorDB>>
abstract class VectorDb implements RustOpaqueInterface {
Future<void> addVector({required BigInt key, required List<double> vector});
Future<void> bulkAddVectors(
{required Uint64List keys, required List<Float32List> vectors});
Future<List<Float32List>> bulkGetVectors({required Uint64List keys});
Future<BigInt> bulkRemoveVectors({required Uint64List keys});
Future<(Uint64List, List<Uint64List>, List<Float32List>)> bulkSearchKeys(
{required Uint64List potentialKeys,
required BigInt count,
required bool exact});
Future<(List<Uint64List>, List<Float32List>)> bulkSearchVectors(
{required List<Float32List> queries,
required BigInt count,
required bool exact});
/// Check if a vector with the given key exists in the index.
/// `true` if the index contains the vector with the given key, `false` otherwise.
Future<bool> containsVector({required BigInt key});
Future<void> deleteIndex();
Future<(BigInt, BigInt, BigInt, BigInt, BigInt, BigInt, BigInt)>
getIndexStats();
Future<Float32List> getVector({required BigInt key});
factory VectorDb({required String filePath, required BigInt dimensions}) =>
RustLib.instance.api.crateApiUsearchApiVectorDbNew(
filePath: filePath, dimensions: dimensions);
Future<BigInt> removeVector({required BigInt key});
Future<void> resetIndex();
Future<(Uint64List, Float32List)> searchVectors(
{required List<double> query,
required BigInt count,
required bool exact});
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,315 +0,0 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.11.1.
// ignore_for_file: require_trailing_commas
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
import 'dart:async';
import 'dart:convert';
import 'dart:ffi' as ffi;
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart';
import 'package:photos/src/rust/api/simple.dart';
import 'package:photos/src/rust/api/usearch_api.dart';
import 'package:photos/src/rust/frb_generated.dart';
abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
RustLibApiImplPlatform({
required super.handler,
required super.wire,
required super.generalizedFrbRustBinding,
required super.portManager,
});
CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_VectorDbPtr => wire
._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDBPtr;
@protected
VectorDb
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
dynamic raw);
@protected
VectorDb
dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
dynamic raw);
@protected
VectorDb
dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
dynamic raw);
@protected
String dco_decode_String(dynamic raw);
@protected
bool dco_decode_bool(dynamic raw);
@protected
double dco_decode_f_32(dynamic raw);
@protected
List<Float32List> dco_decode_list_list_prim_f_32_strict(dynamic raw);
@protected
List<Uint64List> dco_decode_list_list_prim_u_64_strict(dynamic raw);
@protected
List<double> dco_decode_list_prim_f_32_loose(dynamic raw);
@protected
Float32List dco_decode_list_prim_f_32_strict(dynamic raw);
@protected
Uint64List dco_decode_list_prim_u_64_strict(dynamic raw);
@protected
Uint8List dco_decode_list_prim_u_8_strict(dynamic raw);
@protected
(List<Uint64List>, List<Float32List>)
dco_decode_record_list_list_prim_u_64_strict_list_list_prim_f_32_strict(
dynamic raw);
@protected
(
Uint64List,
List<Uint64List>,
List<Float32List>
) dco_decode_record_list_prim_u_64_strict_list_list_prim_u_64_strict_list_list_prim_f_32_strict(
dynamic raw);
@protected
(
Uint64List,
Float32List
) dco_decode_record_list_prim_u_64_strict_list_prim_f_32_strict(dynamic raw);
@protected
(BigInt, BigInt, BigInt, BigInt, BigInt, BigInt, BigInt)
dco_decode_record_usize_usize_usize_usize_usize_usize_usize(dynamic raw);
@protected
BigInt dco_decode_u_64(dynamic raw);
@protected
int dco_decode_u_8(dynamic raw);
@protected
void dco_decode_unit(dynamic raw);
@protected
BigInt dco_decode_usize(dynamic raw);
@protected
VectorDb
sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
SseDeserializer deserializer);
@protected
VectorDb
sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
SseDeserializer deserializer);
@protected
VectorDb
sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
SseDeserializer deserializer);
@protected
String sse_decode_String(SseDeserializer deserializer);
@protected
bool sse_decode_bool(SseDeserializer deserializer);
@protected
double sse_decode_f_32(SseDeserializer deserializer);
@protected
List<Float32List> sse_decode_list_list_prim_f_32_strict(
SseDeserializer deserializer);
@protected
List<Uint64List> sse_decode_list_list_prim_u_64_strict(
SseDeserializer deserializer);
@protected
List<double> sse_decode_list_prim_f_32_loose(SseDeserializer deserializer);
@protected
Float32List sse_decode_list_prim_f_32_strict(SseDeserializer deserializer);
@protected
Uint64List sse_decode_list_prim_u_64_strict(SseDeserializer deserializer);
@protected
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer);
@protected
(List<Uint64List>, List<Float32List>)
sse_decode_record_list_list_prim_u_64_strict_list_list_prim_f_32_strict(
SseDeserializer deserializer);
@protected
(
Uint64List,
List<Uint64List>,
List<Float32List>
) sse_decode_record_list_prim_u_64_strict_list_list_prim_u_64_strict_list_list_prim_f_32_strict(
SseDeserializer deserializer);
@protected
(Uint64List, Float32List)
sse_decode_record_list_prim_u_64_strict_list_prim_f_32_strict(
SseDeserializer deserializer);
@protected
(BigInt, BigInt, BigInt, BigInt, BigInt, BigInt, BigInt)
sse_decode_record_usize_usize_usize_usize_usize_usize_usize(
SseDeserializer deserializer);
@protected
BigInt sse_decode_u_64(SseDeserializer deserializer);
@protected
int sse_decode_u_8(SseDeserializer deserializer);
@protected
void sse_decode_unit(SseDeserializer deserializer);
@protected
BigInt sse_decode_usize(SseDeserializer deserializer);
@protected
int sse_decode_i_32(SseDeserializer deserializer);
@protected
void
sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
VectorDb self, SseSerializer serializer);
@protected
void
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
VectorDb self, SseSerializer serializer);
@protected
void
sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
VectorDb self, SseSerializer serializer);
@protected
void sse_encode_String(String self, SseSerializer serializer);
@protected
void sse_encode_bool(bool self, SseSerializer serializer);
@protected
void sse_encode_f_32(double self, SseSerializer serializer);
@protected
void sse_encode_list_list_prim_f_32_strict(
List<Float32List> self, SseSerializer serializer);
@protected
void sse_encode_list_list_prim_u_64_strict(
List<Uint64List> self, SseSerializer serializer);
@protected
void sse_encode_list_prim_f_32_loose(
List<double> self, SseSerializer serializer);
@protected
void sse_encode_list_prim_f_32_strict(
Float32List self, SseSerializer serializer);
@protected
void sse_encode_list_prim_u_64_strict(
Uint64List self, SseSerializer serializer);
@protected
void sse_encode_list_prim_u_8_strict(
Uint8List self, SseSerializer serializer);
@protected
void sse_encode_record_list_list_prim_u_64_strict_list_list_prim_f_32_strict(
(List<Uint64List>, List<Float32List>) self, SseSerializer serializer);
@protected
void
sse_encode_record_list_prim_u_64_strict_list_list_prim_u_64_strict_list_list_prim_f_32_strict(
(Uint64List, List<Uint64List>, List<Float32List>) self,
SseSerializer serializer);
@protected
void sse_encode_record_list_prim_u_64_strict_list_prim_f_32_strict(
(Uint64List, Float32List) self, SseSerializer serializer);
@protected
void sse_encode_record_usize_usize_usize_usize_usize_usize_usize(
(BigInt, BigInt, BigInt, BigInt, BigInt, BigInt, BigInt) self,
SseSerializer serializer);
@protected
void sse_encode_u_64(BigInt self, SseSerializer serializer);
@protected
void sse_encode_u_8(int self, SseSerializer serializer);
@protected
void sse_encode_unit(void self, SseSerializer serializer);
@protected
void sse_encode_usize(BigInt self, SseSerializer serializer);
@protected
void sse_encode_i_32(int self, SseSerializer serializer);
}
// Section: wire_class
class RustLibWire implements BaseWire {
factory RustLibWire.fromExternalLibrary(ExternalLibrary lib) =>
RustLibWire(lib.ffiDynamicLibrary);
/// Holds the symbol lookup function.
final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
_lookup;
/// The symbols are looked up in [dynamicLibrary].
RustLibWire(ffi.DynamicLibrary dynamicLibrary)
: _lookup = dynamicLibrary.lookup;
void
rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
ffi.Pointer<ffi.Void> ptr,
) {
return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
ptr,
);
}
late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDBPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
'frbgen_photos_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB');
late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB =
_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDBPtr
.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
void
rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
ffi.Pointer<ffi.Void> ptr,
) {
return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB(
ptr,
);
}
late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDBPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
'frbgen_photos_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB');
late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDB =
_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerVectorDBPtr
.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
}

View File

@@ -345,8 +345,9 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
child: Row(
children: [
Text(
AppLocalizations.of(context)
.passwordStrength(passwordStrengthText),
AppLocalizations.of(context).passwordStrength(
passwordStrengthValue: passwordStrengthText,
),
style: TextStyle(
color: passwordStrengthColor,
fontWeight: FontWeight.w500,

View File

@@ -118,7 +118,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
padding: const EdgeInsets.fromLTRB(0, 0, 0, 12),
child: StyledText(
text: AppLocalizations.of(context)
.weHaveSendEmailTo(widget.email),
.weHaveSendEmailTo(email: widget.email),
style: Theme.of(context)
.textTheme
.titleMedium!

View File

@@ -343,8 +343,8 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
padding:
const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
child: Text(
AppLocalizations.of(context)
.passwordStrength(passwordStrengthText),
AppLocalizations.of(context).passwordStrength(
passwordStrengthValue: passwordStrengthText,),
style: TextStyle(
color: passwordStrengthColor,
),

View File

@@ -91,7 +91,7 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
context,
AppLocalizations.of(context).contactSupport,
AppLocalizations.of(context)
.dropSupportEmail("support@ente.io"),
.dropSupportEmail(supportEmail: "support@ente.io"),
);
},
child: Container(

View File

@@ -93,7 +93,7 @@ class CollectionActions {
body:
//'This will remove the public link for accessing "${collection.name}".',
AppLocalizations.of(context)
.disableLinkMessage(collection.displayName),
.disableLinkMessage(albumName: collection.displayName),
);
if (actionResult?.action != null) {
if (actionResult!.action == ButtonAction.error) {
@@ -195,7 +195,7 @@ class CollectionActions {
],
title: AppLocalizations.of(context).removeWithQuestionMark,
body: AppLocalizations.of(context)
.removeParticipantBody(user.displayName ?? user.email),
.removeParticipantBody(userEmail: user.displayName ?? user.email),
);
if (actionResult?.action != null) {
if (actionResult!.action == ButtonAction.error) {
@@ -296,7 +296,7 @@ class CollectionActions {
context: context,
title: AppLocalizations.of(context).inviteToEnte,
icon: Icons.info_outline,
body: AppLocalizations.of(context).emailNoEnteAccount(email),
body: AppLocalizations.of(context).emailNoEnteAccount(email: email),
isDismissible: true,
buttons: [
ButtonWidget(
@@ -394,7 +394,7 @@ class CollectionActions {
],
bodyWidget: StyledText(
text: AppLocalizations.of(context)
.deleteMultipleAlbumDialog(collections.length),
.deleteMultipleAlbumDialog(count: collections.length),
style: textTheme.body.copyWith(color: textMutedDark),
tags: {
'bold': StyledTextTag(

View File

@@ -35,12 +35,14 @@ Future<void> showSingleFileDeleteSheet(
AppLocalizations.of(context).singleFileDeleteHighlight;
String body = "";
if (isBothLocalAndRemote) {
body =
AppLocalizations.of(context).singleFileInBothLocalAndRemote(fileType);
body = AppLocalizations.of(context)
.singleFileInBothLocalAndRemote(fileType: fileType);
} else if (isRemoteOnly) {
body = AppLocalizations.of(context).singleFileInRemoteOnly(fileType);
body =
AppLocalizations.of(context).singleFileInRemoteOnly(fileType: fileType);
} else if (isLocalOnly) {
body = AppLocalizations.of(context).singleFileDeleteFromDevice(fileType);
body = AppLocalizations.of(context)
.singleFileDeleteFromDevice(fileType: fileType);
} else {
throw AssertionError("Unexpected state");
}

View File

@@ -89,8 +89,9 @@ class AlbumColumnItemWidget extends StatelessWidget {
if (snapshot.hasData) {
return Text(
AppLocalizations.of(context).memoryCount(
snapshot.data!,
NumberFormat().format(snapshot.data!),
count: snapshot.data!,
formattedCount:
NumberFormat().format(snapshot.data!),
),
style: textTheme.miniMuted,
);

View File

@@ -75,8 +75,8 @@ class AlbumListItemWidget extends StatelessWidget {
if (snapshot.hasData) {
return Text(
AppLocalizations.of(context).memoryCount(
snapshot.data!,
NumberFormat().format(snapshot.data!),
count: snapshot.data!,
formattedCount: NumberFormat().format(snapshot.data!),
),
style: textTheme.small.copyWith(
color: colorScheme.textMuted,

View File

@@ -243,24 +243,24 @@ class _AlbumVerticalListWidgetState extends State<AlbumVerticalListWidget> {
bool hasVerifiedLock = false;
if (widget.actionType == CollectionActionType.addFiles) {
toastMessage =
AppLocalizations.of(context).addedSuccessfullyTo(item.displayName);
toastMessage = AppLocalizations.of(context)
.addedSuccessfullyTo(albumName: item.displayName);
shouldNavigateToCollection = true;
} else if (widget.actionType == CollectionActionType.moveFiles ||
widget.actionType == CollectionActionType.restoreFiles ||
widget.actionType == CollectionActionType.unHide) {
toastMessage =
AppLocalizations.of(context).movedSuccessfullyTo(item.displayName);
toastMessage = AppLocalizations.of(context)
.movedSuccessfullyTo(albumName: item.displayName);
shouldNavigateToCollection = true;
} else if (widget.actionType ==
CollectionActionType.moveToHiddenCollection) {
toastMessage =
AppLocalizations.of(context).movedSuccessfullyTo(item.displayName);
toastMessage = AppLocalizations.of(context)
.movedSuccessfullyTo(albumName: item.displayName);
shouldNavigateToCollection = true;
hasVerifiedLock = true;
} else if (widget.actionType == CollectionActionType.addToHiddenAlbum) {
toastMessage =
AppLocalizations.of(context).addedSuccessfullyTo(item.displayName);
toastMessage = AppLocalizations.of(context)
.addedSuccessfullyTo(albumName: item.displayName);
shouldNavigateToCollection = true;
hasVerifiedLock = true;
} else {

View File

@@ -55,10 +55,10 @@ String _actionName(
String text = "";
switch (type) {
case CollectionActionType.addFiles:
text = AppLocalizations.of(context).addItem(fileCount);
text = AppLocalizations.of(context).addItem(count: fileCount);
break;
case CollectionActionType.moveFiles:
text = AppLocalizations.of(context).moveItem(fileCount);
text = AppLocalizations.of(context).moveItem(count: fileCount);
break;
case CollectionActionType.restoreFiles:
text = AppLocalizations.of(context).restoreToAlbum;
@@ -312,7 +312,7 @@ class _CollectionActionSheetState extends State<CollectionActionSheet> {
showShortToast(
context,
AppLocalizations.of(context)
.addedToAlbums(_selectedCollections.length),
.addedToAlbums(count: _selectedCollections.length),
);
widget.selectedFiles?.clearAll();
}

View File

@@ -12,7 +12,7 @@ Future<void> showInviteDialog(BuildContext context, String email) async {
context: context,
title: AppLocalizations.of(context).inviteToEnte,
icon: Icons.info_outline,
body: AppLocalizations.of(context).emailNoEnteAccount(email),
body: AppLocalizations.of(context).emailNoEnteAccount(email: email),
isDismissible: true,
buttons: [
ButtonWidget(

View File

@@ -57,11 +57,11 @@ class _ActionBarWidgetState extends State<ActionBarWidget> {
_selectedOwnedFilesNotifier.value !=
_selectedFilesNotifier.value
? AppLocalizations.of(context).selectedPhotosWithYours(
_selectedFilesNotifier.value,
_selectedOwnedFilesNotifier.value,
count: _selectedFilesNotifier.value,
yourCount: _selectedOwnedFilesNotifier.value,
)
: AppLocalizations.of(context).selectedPhotos(
_selectedFilesNotifier.value,
count: _selectedFilesNotifier.value,
),
style: textTheme.miniMuted,
);

View File

@@ -48,7 +48,7 @@ class _AlbumActionBarWidgetState extends State<AlbumActionBarWidget> {
builder: (context, value, child) {
return Text(
AppLocalizations.of(context).selectedAlbums(
widget.selectedAlbums?.albums.length ?? 0,
count: widget.selectedAlbums?.albums.length ?? 0,
),
style: textTheme.miniMuted,
);

View File

@@ -48,7 +48,7 @@ class _PeopleActionBarWidgetState extends State<PeopleActionBarWidget> {
builder: (context, value, child) {
final count = widget.selectedPeople?.personIds.length ?? 0;
return Text(
AppLocalizations.of(context).selectedPhotos(count),
AppLocalizations.of(context).selectedPhotos(count: count),
style: textTheme.miniMuted,
);
},

View File

@@ -412,6 +412,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
if (widget.onTap != null) {
_debouncer.run(
() => Future(() {
if (!mounted) return;
setState(() {
executionState = ExecutionState.inProgress;
});
@@ -432,6 +433,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
: null;
_debouncer.cancelDebounceTimer();
if (executionState == ExecutionState.successful) {
if (!mounted) return;
setState(() {});
}
@@ -470,6 +472,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
}
}
if (executionState == ExecutionState.error) {
if (!mounted) return;
setState(() {
executionState = ExecutionState.idle;
widget.isInAlert
@@ -512,6 +515,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
}
void _onTapDown(details) {
if (!mounted) return;
setState(() {
buttonColor = widget.buttonStyle.pressedButtonColor ??
widget.buttonStyle.defaultButtonColor;
@@ -527,13 +531,17 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
void _onTapUp(details) {
Future.delayed(
const Duration(milliseconds: 84),
() => setState(() {
setAllStylesToDefault();
}),
() {
if (!mounted) return;
setState(() {
setAllStylesToDefault();
});
},
);
}
void _onTapCancel() {
if (!mounted) return;
setState(() {
setAllStylesToDefault();
});

View File

@@ -35,6 +35,8 @@ class MenuItemWidget extends StatefulWidget {
final Color? menuItemColor;
final bool alignCaptionedTextToLeft;
final EdgeInsets? padding;
// singleBorderRadius is applied to the border when it's a standalone menu item.
// Widget will apply singleBorderRadius if value of both isTopBorderRadiusRemoved
// and isBottomBorderRadiusRemoved is false. Otherwise, multipleBorderRadius will
@@ -88,6 +90,7 @@ class MenuItemWidget extends StatefulWidget {
this.showOnlyLoadingState = false,
this.surfaceExecutionStates = true,
this.alwaysShowSuccessState = false,
this.padding,
super.key,
});
@@ -97,8 +100,9 @@ class MenuItemWidget extends StatefulWidget {
class _MenuItemWidgetState extends State<MenuItemWidget> {
final _debouncer = Debouncer(const Duration(milliseconds: 300));
ValueNotifier<ExecutionState> executionStateNotifier =
ValueNotifier(ExecutionState.idle);
ValueNotifier<ExecutionState> executionStateNotifier = ValueNotifier(
ExecutionState.idle,
);
Color? menuItemColor;
late double borderRadius;
@@ -167,7 +171,7 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
return AnimatedContainer(
duration: const Duration(milliseconds: 20),
width: double.infinity,
padding: const EdgeInsets.only(left: 16, right: 12),
padding: widget.padding ?? const EdgeInsets.only(left: 16, right: 12),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: topBorderRadius,
@@ -180,14 +184,13 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
widget.alignCaptionedTextToLeft && widget.leadingIcon == null
? const SizedBox.shrink()
: LeadingWidget(
leadingIconSize: widget.leadingIconSize,
leadingIcon: widget.leadingIcon,
leadingIconColor: widget.leadingIconColor,
leadingIconWidget: widget.leadingIconWidget,
),
if (!widget.alignCaptionedTextToLeft || widget.leadingIcon != null)
LeadingWidget(
leadingIconSize: widget.leadingIconSize,
leadingIcon: widget.leadingIcon,
leadingIconColor: widget.leadingIconColor,
leadingIconWidget: widget.leadingIconWidget,
),
widget.captionedTextWidget,
if (widget.expandableController != null)
ExpansionTrailingIcon(
@@ -217,11 +220,9 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
return;
}
_debouncer.run(
() => Future(
() {
executionStateNotifier.value = ExecutionState.inProgress;
},
),
() => Future(() {
executionStateNotifier.value = ExecutionState.inProgress;
}),
);
await widget.onTap?.call().then(
(value) {

View File

@@ -15,6 +15,7 @@ class TitleBarWidget extends StatelessWidget {
final Color? backgroundColor;
final bool isSliver;
final double? expandedHeight;
final double reducedExpandedHeight;
const TitleBarWidget({
this.leading,
@@ -29,6 +30,7 @@ class TitleBarWidget extends StatelessWidget {
this.backgroundColor,
this.isSliver = true,
this.expandedHeight,
this.reducedExpandedHeight = 0,
super.key,
});
@@ -43,8 +45,9 @@ class TitleBarWidget extends StatelessWidget {
leadingWidth: 48,
automaticallyImplyLeading: false,
pinned: true,
expandedHeight:
expandedHeight ?? (isFlexibleSpaceDisabled ? toolbarHeight : 102),
expandedHeight: expandedHeight ??
(isFlexibleSpaceDisabled ? toolbarHeight : 102) -
reducedExpandedHeight,
centerTitle: false,
titleSpacing: 4,
title: TitleWidget(

View File

@@ -106,12 +106,14 @@ class _ToggleSwitchWidgetState extends State<ToggleSwitchWidget> {
}
Future<void> _onChanged(bool negationOfToggleValue) async {
if (!mounted) return;
setState(() {
toggleValue = negationOfToggleValue;
//start showing inProgress statu icons if toggle takes more than debounce time
_debouncer.run(
() => Future(
() {
if (!mounted) return;
setState(() {
executionState = ExecutionState.inProgress;
});
@@ -129,16 +131,16 @@ class _ToggleSwitchWidgetState extends State<ToggleSwitchWidget> {
_debouncer.cancelDebounceTimer();
final newValue = widget.value.call();
if (!mounted) return;
setState(() {
if (toggleValue == newValue) {
if (executionState == ExecutionState.inProgress) {
executionState = ExecutionState.successful;
Future.delayed(const Duration(seconds: 2), () {
if (mounted) {
setState(() {
executionState = ExecutionState.idle;
});
}
if (!mounted) return;
setState(() {
executionState = ExecutionState.idle;
});
});
}
} else {

View File

@@ -74,7 +74,8 @@ class CodeSuccessScreen extends StatelessWidget {
),
Text(
AppLocalizations.of(context).storageInGB(
referralView.planInfo.storageInGB,
storageAmountInGB:
referralView.planInfo.storageInGB,
),
style: textStyle.h2Bold,
),
@@ -108,8 +109,9 @@ class CodeSuccessScreen extends StatelessWidget {
shareText(
AppLocalizations.of(context)
.shareTextReferralCode(
referralView.code,
referralView.planInfo.storageInGB,
referralCode: referralView.code,
referralStorageInGB:
referralView.planInfo.storageInGB,
),
);
},
@@ -138,7 +140,8 @@ class CodeSuccessScreen extends StatelessWidget {
Text(
AppLocalizations.of(context)
.freeStorageOnReferralSuccess(
referralView.planInfo.storageInGB,
storageAmountInGB:
referralView.planInfo.storageInGB,
),
style: textStyle.smallMuted,
textAlign: TextAlign.center,
@@ -148,7 +151,8 @@ class CodeSuccessScreen extends StatelessWidget {
const SizedBox(height: 16),
Text(
AppLocalizations.of(context).theyAlsoGetXGb(
referralView.planInfo.storageInGB,
storageAmountInGB:
referralView.planInfo.storageInGB,
),
style: textStyle.smallMuted,
textAlign: TextAlign.center,

View File

@@ -65,7 +65,9 @@ class ReferralCodeWidget extends StatelessWidget {
context,
title: AppLocalizations.of(context).error,
body: AppLocalizations.of(context)
.onlyFamilyAdminCanChangeCode(familyAdmin),
.onlyFamilyAdminCanChangeCode(
familyAdminEmail: familyAdmin,
),
icon: Icons.error,
);
} else {

View File

@@ -141,8 +141,8 @@ class ReferralWidget extends StatelessWidget {
onTap: () {
shareText(
AppLocalizations.of(context).shareTextReferralCode(
referralView.code,
referralView.planInfo.storageInGB,
referralCode: referralView.code,
referralStorageInGB: referralView.planInfo.storageInGB,
),
);
},
@@ -182,7 +182,7 @@ class ReferralWidget extends StatelessWidget {
const SizedBox(height: 12),
Text(
AppLocalizations.of(context).referralStep3(
referralView.planInfo.storageInGB,
storageInGB: referralView.planInfo.storageInGB,
),
),
],
@@ -291,8 +291,10 @@ class ReferralWidget extends StatelessWidget {
),
child: Text(
AppLocalizations.of(context).claimedStorageSoFar(
referralView.isFamilyMember.toString().toLowerCase(),
convertBytesToAbsoluteGBs(referralView.claimedStorage),
isFamilyMember:
referralView.isFamilyMember.toString().toLowerCase(),
storageAmountInGb:
convertBytesToAbsoluteGBs(referralView.claimedStorage),
),
style: textStyle.small.copyWith(
color: colorScheme.textMuted,

View File

@@ -88,8 +88,8 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
} else {
_importProgressEvent =
Bus.instance.on<LocalImportProgressEvent>().listen((event) {
_loadingMessage =
AppLocalizations.of(context).processingImport(event.folderName);
_loadingMessage = AppLocalizations.of(context)
.processingImport(folderName: event.folderName);
if (mounted) {
setState(() {});
}

View File

@@ -244,15 +244,16 @@ class _SyncStatusWidgetState extends State<SyncStatusWidget> {
} else if (_event!.total == 1) {
return AppLocalizations.of(context).uploadingSingleMemory;
} else {
return AppLocalizations.of(context)
.uploadingMultipleMemories(NumberFormat().format(_event!.total!));
return AppLocalizations.of(context).uploadingMultipleMemories(
count: NumberFormat().format(_event!.total!),
);
}
}
if (_event!.status == SyncStatus.inProgress) {
final format = NumberFormat();
return AppLocalizations.of(context).syncProgress(
format.format(_event!.completed!),
format.format(_event!.total!),
completed: format.format(_event!.completed!),
total: format.format(_event!.total!),
);
}
if (_event!.status == SyncStatus.paused) {

View File

@@ -90,7 +90,7 @@ class AddOnViewSection extends StatelessWidget {
if (bonus.validTill != 0)
Text(
AppLocalizations.of(context).validTill(
DateFormat.yMMMd(
endDate: DateFormat.yMMMd(
Localizations.localeOf(context).languageCode,
)
.format(

View File

@@ -38,8 +38,8 @@ class ChildSubscriptionWidget extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: StyledText(
text:
AppLocalizations.of(context).contactFamilyAdmin(familyAdmin),
text: AppLocalizations.of(context)
.contactFamilyAdmin(familyAdminEmail: familyAdmin),
style: Theme.of(context).textTheme.bodyLarge,
tags: {
'green': StyledTextTag(

View File

@@ -122,7 +122,7 @@ class _StoreSubscriptionPageState extends State<StoreSubscriptionPage> {
? AppLocalizations.of(context).googlePlayId
: AppLocalizations.of(context).appleId;
final String message =
AppLocalizations.of(context).subAlreadyLinkedErrMessage(id);
AppLocalizations.of(context).subAlreadyLinkedErrMessage(id: id);
// ignore: unawaited_futures
showErrorDialog(context, title, message);
return;
@@ -134,7 +134,7 @@ class _StoreSubscriptionPageState extends State<StoreSubscriptionPage> {
context,
AppLocalizations.of(context).paymentFailed,
AppLocalizations.of(context).paymentFailedTalkToProvider(
Platform.isAndroid ? "PlayStore" : "AppStore",
providerName: Platform.isAndroid ? "PlayStore" : "AppStore",
),
);
return;
@@ -409,7 +409,7 @@ class _StoreSubscriptionPageState extends State<StoreSubscriptionPage> {
context,
AppLocalizations.of(context).sorry,
AppLocalizations.of(context)
.contactToManageSubscription(capitalizedWord),
.contactToManageSubscription(provider: capitalizedWord),
);
}
}

View File

@@ -350,7 +350,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
context,
AppLocalizations.of(context).sorry,
AppLocalizations.of(context)
.contactToManageSubscription(capitalizedWord),
.contactToManageSubscription(provider: capitalizedWord),
);
}
}
@@ -511,7 +511,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
context,
AppLocalizations.of(context).sorry,
AppLocalizations.of(context).cancelOtherSubscription(
_currentSubscription!.paymentProvider,
paymentProvider: _currentSubscription!.paymentProvider,
),
);
return;

View File

@@ -92,9 +92,10 @@ class ValidityWidget extends StatelessWidget {
DateTime.fromMicrosecondsSinceEpoch(currentSubscription!.expiryTime),
);
var message = AppLocalizations.of(context).renewsOn(endDate);
var message = AppLocalizations.of(context).renewsOn(endDate: endDate);
if (currentSubscription!.attributes?.isCancelled ?? false) {
message = AppLocalizations.of(context).subWillBeCancelledOn(endDate);
message =
AppLocalizations.of(context).subWillBeCancelledOn(endDate: endDate);
if (addOnBonus.isNotEmpty) {
hideSubValidityView = true;
}
@@ -139,7 +140,8 @@ class AddOnBonusValidity extends StatelessWidget {
return Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Text(
AppLocalizations.of(context).addOnValidTill(storage, endDate),
AppLocalizations.of(context)
.addOnValidTill(storageAmount: storage, endDate: endDate),
style: getEnteTextTheme(context).smallFaint,
textAlign: TextAlign.center,
),

View File

@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import "package:photos/core/error-reporting/super_logging.dart";
import "package:photos/generated/l10n.dart";
import "package:photos/service_locator.dart";
import "package:photos/services/video_preview_service.dart";
import 'package:photos/theme/ente_theme.dart';
import 'package:photos/ui/components/buttons/icon_button_widget.dart';
import 'package:photos/ui/components/captioned_text_widget.dart';
@@ -12,6 +11,7 @@ import 'package:photos/ui/components/title_bar_widget.dart';
import "package:photos/ui/components/toggle_switch_widget.dart";
import "package:photos/ui/settings/app_icon_selection_screen.dart";
import "package:photos/ui/settings/ml/machine_learning_settings_page.dart";
import "package:photos/ui/settings/streaming/video_streaming_settings_page.dart";
import 'package:photos/utils/navigation_util.dart';
class AdvancedSettingsScreen extends StatelessWidget {
@@ -113,23 +113,21 @@ class AdvancedSettingsScreen extends StatelessWidget {
title: AppLocalizations.of(context).videoStreaming,
),
menuItemColor: colorScheme.fillFaint,
trailingWidget: Icon(
Icons.chevron_right_outlined,
color: colorScheme.strokeBase,
),
singleBorderRadius: 8,
alignCaptionedTextToLeft: true,
trailingWidget: ToggleSwitchWidget(
value: () => VideoPreviewService
.instance.isVideoStreamingEnabled,
onChanged: () async {
final isEnabled = VideoPreviewService
.instance.isVideoStreamingEnabled;
await VideoPreviewService.instance
.setIsVideoStreamingEnabled(!isEnabled);
},
),
),
const SizedBox(
height: 24,
onTap: () async {
// ignore: unawaited_futures
routeToPage(
context,
const VideoStreamingSettingsPage(),
);
},
),
const SizedBox(height: 24),
MenuItemWidget(
captionedTextWidget: CaptionedTextWidget(
title: AppLocalizations.of(context).crashReporting,

View File

@@ -41,7 +41,8 @@ class _AppVersionWidgetState extends State<AppVersionWidget> {
return Padding(
padding: const EdgeInsets.all(20),
child: Text(
AppLocalizations.of(context).appVersion(snapshot.data!),
AppLocalizations.of(context)
.appVersion(versionValue: snapshot.data!),
style: Theme.of(context).textTheme.bodySmall,
),
);

View File

@@ -373,7 +373,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
Text(
(kDebugMode ? 'inApp: $importedCount : device ' : '') +
AppLocalizations.of(context)
.itemCount(deviceCollection.count),
.itemCount(count: deviceCollection.count),
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 12,

View File

@@ -196,10 +196,9 @@ class _FreeUpSpaceOptionsScreenState extends State<FreeUpSpaceOptionsScreen> {
),
if (flagService.enableVectorDb)
MenuItemWidget(
captionedTextWidget:
const CaptionedTextWidget(
title:
"Similar images", // TODO: lau: extract string
captionedTextWidget: CaptionedTextWidget(
title: AppLocalizations.of(context)
.similarImages,
),
menuItemColor: colorScheme.fillFaint,
trailingWidget: Icon(
@@ -213,16 +212,18 @@ class _FreeUpSpaceOptionsScreenState extends State<FreeUpSpaceOptionsScreen> {
onTap: () async {
await routeToPage(
context,
const SimilarImagesPage(debugScreen: kDebugMode,),
const SimilarImagesPage(
debugScreen: kDebugMode,
),
);
},
),
if (flagService.enableVectorDb)
const Align(
Align(
alignment: Alignment.centerLeft,
child: MenuSectionDescriptionWidget(
content:
"Use AI to find images that look similar to each other.", // TODO: lau: extract string
content: AppLocalizations.of(context)
.useMLToFindSimilarImages,
),
),
if (flagService.enableVectorDb)
@@ -310,7 +311,7 @@ class _FreeUpSpaceOptionsScreenState extends State<FreeUpSpaceOptionsScreen> {
context,
title: AppLocalizations.of(context).success,
body: AppLocalizations.of(context)
.youHaveSuccessfullyFreedUp(formatBytes(status.size)),
.youHaveSuccessfullyFreedUp(storageSaved: formatBytes(status.size)),
firstButtonLabel: AppLocalizations.of(context).rateUs,
firstButtonOnTap: () async {
await updateService.launchReviewUrl();
@@ -331,7 +332,7 @@ class _FreeUpSpaceOptionsScreenState extends State<FreeUpSpaceOptionsScreen> {
context: context,
title: AppLocalizations.of(context).success,
body: AppLocalizations.of(context)
.youHaveSuccessfullyFreedUp(formatBytes(status.size)),
.youHaveSuccessfullyFreedUp(storageSaved: formatBytes(status.size)),
icon: Icons.download_done_rounded,
isDismissible: true,
buttons: [
@@ -358,8 +359,8 @@ class _FreeUpSpaceOptionsScreenState extends State<FreeUpSpaceOptionsScreen> {
context,
title: AppLocalizations.of(context).sparkleSuccess,
body: AppLocalizations.of(context).duplicateFileCountWithStorageSaved(
result.count,
formatBytes(result.size),
count: result.count,
storageSaved: formatBytes(result.size),
),
firstButtonLabel: AppLocalizations.of(context).rateUs,
firstButtonOnTap: () async {

View File

@@ -13,8 +13,8 @@ class DeveloperSettingsWidget extends StatelessWidget {
return Padding(
padding: const EdgeInsets.only(bottom: 20),
child: Text(
AppLocalizations.of(context)
.customEndpoint("${endpointURI.host}:${endpointURI.port}"),
AppLocalizations.of(context).customEndpoint(
endpoint: "${endpointURI.host}:${endpointURI.port}",),
style: Theme.of(context).textTheme.bodySmall,
),
);

View File

@@ -34,8 +34,9 @@ class SettingsTitleBarWidget extends StatelessWidget {
userDetails is UserDetails && !isCached
? Text(
AppLocalizations.of(context).memoryCount(
userDetails.fileCount,
NumberFormat().format(userDetails.fileCount),
count: userDetails.fileCount,
formattedCount:
NumberFormat().format(userDetails.fileCount),
),
// "${NumberFormat().format(userDetails.fileCount)} memories",
style: getEnteTextTheme(context).largeBold,

View File

@@ -31,7 +31,7 @@ class SocialSectionWidget extends StatelessWidget {
[
sectionOptionSpacing,
SocialsMenuItemWidget(
AppLocalizations.of(context).rateUsOnStore(ratePlace),
AppLocalizations.of(context).rateUsOnStore(storeName: ratePlace),
rateUrl,
),
sectionOptionSpacing,

View File

@@ -282,8 +282,8 @@ class _StorageCardWidgetState extends State<StorageCardWidget> {
)
: const SizedBox.shrink(),
Text(
AppLocalizations.of(context)
.availableStorageSpace(freeSpace, freeSpaceUnit),
AppLocalizations.of(context).availableStorageSpace(
freeAmount: freeSpace, storageUnit: freeSpaceUnit,),
style: getEnteTextTheme(context)
.mini
.copyWith(color: textFaintDark),
@@ -361,10 +361,10 @@ class _StorageCardWidgetState extends State<StorageCardWidget> {
return [
TextSpan(
text: AppLocalizations.of(context).storageUsageInfo(
currentUsage,
currentUsageUnit,
totalStorage,
totalStorageUnit,
usedAmount: currentUsage,
usedStorageUnit: currentUsageUnit,
totalAmount: totalStorage,
totalStorageUnit: totalStorageUnit,
),
),
];

View File

@@ -0,0 +1,318 @@
import "dart:async";
import "package:flutter/gestures.dart";
import "package:flutter/material.dart";
import "package:photos/core/event_bus.dart";
import "package:photos/events/video_preview_state_changed_event.dart";
import "package:photos/generated/l10n.dart";
import "package:photos/l10n/l10n.dart";
import "package:photos/models/preview/preview_item_status.dart";
import "package:photos/services/video_preview_service.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/common/loading_widget.dart";
import "package:photos/ui/common/web_page.dart";
import "package:photos/ui/components/buttons/button_widget.dart";
import "package:photos/ui/components/buttons/icon_button_widget.dart";
import "package:photos/ui/components/captioned_text_widget.dart";
import "package:photos/ui/components/menu_item_widget/menu_item_widget.dart";
import "package:photos/ui/components/models/button_type.dart";
import "package:photos/ui/components/title_bar_title_widget.dart";
import "package:photos/ui/components/title_bar_widget.dart";
import "package:photos/ui/components/toggle_switch_widget.dart";
const helpUrl = "https://help.ente.io/photos/faq/video-streaming";
class VideoStreamingSettingsPage extends StatefulWidget {
const VideoStreamingSettingsPage({super.key});
@override
State<VideoStreamingSettingsPage> createState() =>
_VideoStreamingSettingsPageState();
}
class _VideoStreamingSettingsPageState
extends State<VideoStreamingSettingsPage> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
final hasEnabled = VideoPreviewService.instance.isVideoStreamingEnabled;
return Scaffold(
bottomNavigationBar: !hasEnabled
? SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 12),
ButtonWidget(
buttonType: ButtonType.primary,
labelText: context.l10n.enable,
onTap: () async {
await toggleVideoStreaming();
},
),
],
),
),
)
: null,
appBar: hasEnabled
? null
: PreferredSize(
preferredSize: const Size.fromHeight(154),
child: TitleBarWidget(
reducedExpandedHeight: 16,
flexibleSpaceTitle: TitleBarTitleWidget(
title: AppLocalizations.of(context).videoStreaming,
),
actionIcons: [
IconButtonWidget(
icon: Icons.close_outlined,
iconButtonType: IconButtonType.secondary,
onTap: () {
Navigator.popUntil(context, (route) => route.isFirst);
},
),
],
isSliver: false,
),
),
body: hasEnabled
? CustomScrollView(
primary: false,
slivers: <Widget>[
TitleBarWidget(
reducedExpandedHeight: 16,
flexibleSpaceTitle: TitleBarTitleWidget(
title: AppLocalizations.of(context).videoStreaming,
),
actionIcons: [
IconButtonWidget(
icon: Icons.close_outlined,
iconButtonType: IconButtonType.secondary,
onTap: () {
Navigator.pop(context);
if (Navigator.canPop(context)) Navigator.pop(context);
if (Navigator.canPop(context)) Navigator.pop(context);
},
),
],
),
SliverToBoxAdapter(
child: Container(
padding: const EdgeInsets.only(left: 16, right: 16),
child: Column(
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: AppLocalizations.of(context)
.videoStreamingDescription,
),
const TextSpan(text: " "),
TextSpan(
text: AppLocalizations.of(context).moreDetails,
style: TextStyle(
color: getEnteColorScheme(context).primary500,
),
recognizer: TapGestureRecognizer()
..onTap = openHelp,
),
],
),
textAlign: TextAlign.justify,
style: getEnteTextTheme(context).mini.copyWith(
color: getEnteColorScheme(context).textMuted,
),
),
],
),
),
),
SliverToBoxAdapter(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
).copyWith(top: 30),
child: _getStreamingSettings(context),
),
),
],
)
: Center(
child: SingleChildScrollView(
child: Column(
children: [
Image.asset(
"assets/enable-streaming-static.png",
height: 160,
),
const SizedBox(height: 16),
Text.rich(
TextSpan(
text: AppLocalizations.of(context)
.videoStreamingDescription +
" ",
children: [
TextSpan(
text: AppLocalizations.of(context).moreDetails,
style: TextStyle(
color: getEnteColorScheme(context).primary500,
),
recognizer: TapGestureRecognizer()
..onTap = openHelp,
),
],
),
style: getEnteTextTheme(context).smallMuted,
textAlign: TextAlign.center,
),
const SizedBox(height: 140),
],
),
),
),
);
}
Future<void> openHelp() async {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return WebPage(AppLocalizations.of(context).help, helpUrl);
},
),
).ignore();
}
Future<void> toggleVideoStreaming() async {
final isEnabled = VideoPreviewService.instance.isVideoStreamingEnabled;
await VideoPreviewService.instance.setIsVideoStreamingEnabled(!isEnabled);
if (!mounted) return;
setState(() {});
}
Widget _getStreamingSettings(BuildContext context) {
final hasEnabled = VideoPreviewService.instance.isVideoStreamingEnabled;
final colorScheme = getEnteColorScheme(context);
return Column(
children: [
MenuItemWidget(
captionedTextWidget: CaptionedTextWidget(
title: AppLocalizations.of(context).enabled,
),
trailingWidget: ToggleSwitchWidget(
value: () => hasEnabled,
onChanged: () async {
await toggleVideoStreaming();
},
),
singleBorderRadius: 8,
alignCaptionedTextToLeft: true,
menuItemColor: colorScheme.fillFaint,
),
const SizedBox(height: 8),
const VideoStreamingStatusWidget(),
],
);
}
}
class VideoStreamingStatusWidget extends StatefulWidget {
const VideoStreamingStatusWidget({super.key});
@override
State<VideoStreamingStatusWidget> createState() =>
VideoStreamingStatusWidgetState();
}
class VideoStreamingStatusWidgetState
extends State<VideoStreamingStatusWidget> {
double? _netProcessed;
StreamSubscription? _subscription;
@override
void initState() {
super.initState();
init();
_subscription =
Bus.instance.on<VideoPreviewStateChangedEvent>().listen((event) {
final status = event.status;
// Handle different states
switch (status) {
case PreviewItemStatus.uploaded:
init();
break;
default:
}
});
}
Future<void> init() async {
_netProcessed = await VideoPreviewService.instance.getStatus();
setState(() {});
}
@override
void dispose() {
_subscription?.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
return Column(
children: [
if (_netProcessed != null)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MenuItemWidget(
captionedTextWidget: CaptionedTextWidget(
title: AppLocalizations.of(context).processed,
),
trailingWidget: Text(
_netProcessed == 0
? '0%'
: '${(_netProcessed! * 100.0).toStringAsFixed(2)}%',
style: Theme.of(context).textTheme.bodySmall,
),
singleBorderRadius: 8,
alignCaptionedTextToLeft: true,
isGestureDetectorDisabled: true,
key: ValueKey("processed_items_" + _netProcessed.toString()),
menuItemColor: colorScheme.fillFaint,
),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Text(
AppLocalizations.of(context).videoStreamingNote,
style: getEnteTextTheme(context).mini.copyWith(
color: getEnteColorScheme(context).textMuted,
),
),
),
],
)
else
const EnteLoadingWidget(),
],
);
}
}

View File

@@ -247,8 +247,8 @@ class _AddParticipantPage extends State<AddParticipantPage> {
ButtonWidget(
buttonType: ButtonType.primary,
buttonSize: ButtonSize.large,
labelText:
AppLocalizations.of(context).addViewers(_selectedEmails.length),
labelText: AppLocalizations.of(context)
.addViewers(count: _selectedEmails.length),
isDisabled: _selectedEmails.isEmpty,
onTap: () async {
final results = <bool>[];
@@ -271,7 +271,7 @@ class _AddParticipantPage extends State<AddParticipantPage> {
showToast(
context,
AppLocalizations.of(context)
.viewersSuccessfullyAdded(noOfSuccessfullAdds),
.viewersSuccessfullyAdded(count: noOfSuccessfullAdds),
);
if (!results.any((e) => e == false) && mounted) {
@@ -292,7 +292,7 @@ class _AddParticipantPage extends State<AddParticipantPage> {
: ButtonType.primary,
buttonSize: ButtonSize.large,
labelText: AppLocalizations.of(context)
.addCollaborators(_selectedEmails.length),
.addCollaborators(count: _selectedEmails.length),
isDisabled: _selectedEmails.isEmpty,
onTap: () async {
// TODO: This is not currently designed for best UX for action on
@@ -319,7 +319,7 @@ class _AddParticipantPage extends State<AddParticipantPage> {
showToast(
context,
AppLocalizations.of(context)
.collaboratorsSuccessfullyAdded(noOfSuccessfullAdds),
.collaboratorsSuccessfullyAdded(count: noOfSuccessfullAdds),
);
if (!results.any((e) => e == false) && mounted) {

View File

@@ -93,7 +93,7 @@ class _AlbumParticipantsPageState extends State<AlbumParticipantsPage> {
title: widget.collection.displayName,
),
flexibleSpaceCaption: AppLocalizations.of(context)
.albumParticipantsCount(participants),
.albumParticipantsCount(count: participants),
),
SliverList(
delegate: SliverChildBuilderDelegate(

View File

@@ -118,7 +118,7 @@ class _ManageIndividualParticipantState
AppLocalizations.of(context).yesConvertToViewer,
body: AppLocalizations.of(context)
.cannotAddMorePhotosAfterBecomingViewer(
widget.user.displayName ?? widget.user.email,
user: widget.user.displayName ?? widget.user.email,
),
isCritical: true,
);

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