Compare commits
163 Commits
optimize-w
...
testing-fe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cdd14d8e6c | ||
|
|
67d7f586b2 | ||
|
|
7c22a8bb25 | ||
|
|
ff3864a09a | ||
|
|
4484b9e4ad | ||
|
|
e9554ffbcb | ||
|
|
ad3901d484 | ||
|
|
ecca4c3dc8 | ||
|
|
d05521f884 | ||
|
|
ff37c4bf81 | ||
|
|
84a5ad0b86 | ||
|
|
44ad11343a | ||
|
|
07e50e3cfe | ||
|
|
df8bbdb788 | ||
|
|
1ed381fe52 | ||
|
|
ddd1d5ac86 | ||
|
|
26845a502e | ||
|
|
21aac29020 | ||
|
|
c1ff02df14 | ||
|
|
e4927c4022 | ||
|
|
4fd797338b | ||
|
|
eca0e5943d | ||
|
|
56cc7309a5 | ||
|
|
b740d1af05 | ||
|
|
6d21b73367 | ||
|
|
a5704eef25 | ||
|
|
7e83682686 | ||
|
|
18d5aa61b0 | ||
|
|
7c2a719ba8 | ||
|
|
47313a74ff | ||
|
|
65a7a16298 | ||
|
|
9251e4f5b6 | ||
|
|
c4bc6abf83 | ||
|
|
3165289483 | ||
|
|
01aab41c25 | ||
|
|
1826258161 | ||
|
|
df5917060b | ||
|
|
b5aa05cc1b | ||
|
|
cd865992f2 | ||
|
|
370c0ab54a | ||
|
|
923f2484fb | ||
|
|
37928cd2c6 | ||
|
|
fc32ba97c1 | ||
|
|
e49084867e | ||
|
|
a046748ded | ||
|
|
047d708ef1 | ||
|
|
5b5f563d47 | ||
|
|
2b60ad3748 | ||
|
|
1f70043c83 | ||
|
|
7ce6f6a346 | ||
|
|
03814bff0c | ||
|
|
4c63a0ff13 | ||
|
|
93552fb872 | ||
|
|
1b61becdcf | ||
|
|
0499cad3c9 | ||
|
|
79752ef4b8 | ||
|
|
c1bd6d3fdb | ||
|
|
621423d9a4 | ||
|
|
edb11c89ba | ||
|
|
adb71fe09c | ||
|
|
c20cee2406 | ||
|
|
dcfad86c47 | ||
|
|
0a2bff67bf | ||
|
|
7aaa689cfb | ||
|
|
ad2a0ce897 | ||
|
|
d99615b24f | ||
|
|
09cc48ae55 | ||
|
|
6ab2223a80 | ||
|
|
6fd86162e0 | ||
|
|
707e8dbfcf | ||
|
|
5869bec781 | ||
|
|
e311a8bb32 | ||
|
|
547ccfceca | ||
|
|
3a1917949b | ||
|
|
3a1ce3258e | ||
|
|
13b2542bea | ||
|
|
6db3741a3b | ||
|
|
ce17eccd68 | ||
|
|
95dc683088 | ||
|
|
cf9d5f72f7 | ||
|
|
3096e1550a | ||
|
|
1b39435735 | ||
|
|
8f3d8505bb | ||
|
|
47e8aafe25 | ||
|
|
edf32d065e | ||
|
|
1fa6a0c3b9 | ||
|
|
2388989dd0 | ||
|
|
9e392277b1 | ||
|
|
4609c375db | ||
|
|
839c62ea72 | ||
|
|
dceef49f33 | ||
|
|
acbdc3111a | ||
|
|
98b91a6935 | ||
|
|
e1640e67d4 | ||
|
|
e875758419 | ||
|
|
214b120472 | ||
|
|
f139e0a098 | ||
|
|
e3c9a61887 | ||
|
|
0da3dc5084 | ||
|
|
a856a82249 | ||
|
|
fbdec00a62 | ||
|
|
6a7f980a0d | ||
|
|
10a855fe27 | ||
|
|
b4f8a2b27c | ||
|
|
89489b4d7c | ||
|
|
50296f8dfa | ||
|
|
f69cec864b | ||
|
|
73d5d33fc5 | ||
|
|
4d8ea12ddd | ||
|
|
7beb267ba7 | ||
|
|
7e13ef3537 | ||
|
|
47edca5bf5 | ||
|
|
925ba10b15 | ||
|
|
db2d0bb7e9 | ||
|
|
f3a2b2af0c | ||
|
|
967e88f88d | ||
|
|
b44734a493 | ||
|
|
6478b08a19 | ||
|
|
314e81565b | ||
|
|
f95e20d00f | ||
|
|
35a04d6e7e | ||
|
|
403264d2c9 | ||
|
|
6b06a4c388 | ||
|
|
678bce89b2 | ||
|
|
2f1d4b9f1a | ||
|
|
af20eadff0 | ||
|
|
3264ea046c | ||
|
|
d81a73c833 | ||
|
|
ac9c63fe29 | ||
|
|
53cb217dbc | ||
|
|
fca9a42e0a | ||
|
|
8b708228be | ||
|
|
d379262f56 | ||
|
|
9282632af1 | ||
|
|
6a43d6a567 | ||
|
|
1cdbef1a01 | ||
|
|
fa84bb0845 | ||
|
|
cbb6f07d0d | ||
|
|
fad9cf8559 | ||
|
|
371ba9c552 | ||
|
|
19086e43cc | ||
|
|
964c837c40 | ||
|
|
d85121862d | ||
|
|
42d31a73a3 | ||
|
|
946d2ae522 | ||
|
|
8e9eb50783 | ||
|
|
af3bc7757f | ||
|
|
eda1d05216 | ||
|
|
b58e0f8331 | ||
|
|
6dcf53650d | ||
|
|
bff53d9081 | ||
|
|
f3306e14c7 | ||
|
|
b5c075bac4 | ||
|
|
241d21c2aa | ||
|
|
789d77747c | ||
|
|
35050aa32f | ||
|
|
40e6bd9fae | ||
|
|
b317df2000 | ||
|
|
2e706228ee | ||
|
|
fe40185889 | ||
|
|
6bb4428a8a | ||
|
|
0881685915 | ||
|
|
3e13932d03 |
5
.github/workflows/mobile-daily-internal.yml
vendored
5
.github/workflows/mobile-daily-internal.yml
vendored
@@ -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: //')
|
||||
|
||||
14
.github/workflows/mobile-lint.yml
vendored
14
.github/workflows/mobile-lint.yml
vendored
@@ -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
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
## v1.7.15 (Unreleased)
|
||||
|
||||
- Custom domains.
|
||||
- Support Czech translations.
|
||||
- .
|
||||
|
||||
## v1.7.14
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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ě."
|
||||
}
|
||||
@@ -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."
|
||||
}
|
||||
@@ -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."
|
||||
}
|
||||
@@ -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."
|
||||
}
|
||||
@@ -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."
|
||||
}
|
||||
@@ -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."
|
||||
}
|
||||
@@ -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": "导入时发生意外错误。"
|
||||
}
|
||||
7
mobile/apps/photos/.gitignore
vendored
7
mobile/apps/photos/.gitignore
vendored
@@ -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
|
||||
|
||||
@@ -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`
|
||||
|
||||
|
||||
@@ -73,3 +73,6 @@ analyzer:
|
||||
- thirdparty/**
|
||||
- lib/generated/**
|
||||
- rust_builder/**
|
||||
- lib/src/rust/**
|
||||
- rust/src/**
|
||||
- test/**
|
||||
|
||||
BIN
mobile/apps/photos/assets/2.0x/enable-streaming-static.png
Normal file
BIN
mobile/apps/photos/assets/2.0x/enable-streaming-static.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 175 KiB |
BIN
mobile/apps/photos/assets/3.0x/enable-streaming-static.png
Normal file
BIN
mobile/apps/photos/assets/3.0x/enable-streaming-static.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 396 KiB |
BIN
mobile/apps/photos/assets/enable-streaming-static.png
Normal file
BIN
mobile/apps/photos/assets/enable-streaming-static.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
@@ -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ěď.
|
||||
|
||||
@@ -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
|
||||
@@ -1 +1 @@
|
||||
ente - encrypted photo storage
|
||||
ente – šifrované úložiště fotografií
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1 +1 @@
|
||||
Ente Photos
|
||||
Ente Fotky
|
||||
|
||||
@@ -1 +1 @@
|
||||
Encrypted photo storage
|
||||
Šifrované úložiště fotografií
|
||||
|
||||
@@ -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ěď.
|
||||
@@ -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
|
||||
@@ -1 +1 @@
|
||||
Ente Photos
|
||||
Ente Fotky
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,13 @@ 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(),
|
||||
];
|
||||
@@ -134,18 +141,26 @@ class UploadLocksDB {
|
||||
${_streamUploadErrorTable.columnCreatedAt} INTEGER DEFAULT CURRENT_TIMESTAMP NOT NULL
|
||||
)
|
||||
''',
|
||||
'''
|
||||
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;
|
||||
final db = await 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 {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
final row = <String, dynamic>{};
|
||||
row[_uploadLocksTable.columnID] = id;
|
||||
row[_uploadLocksTable.columnOwner] = owner;
|
||||
@@ -158,7 +173,7 @@ class UploadLocksDB {
|
||||
}
|
||||
|
||||
Future<String> getLockData(String id) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
final rows = await db.query(
|
||||
_uploadLocksTable.table,
|
||||
where: '${_uploadLocksTable.columnID} = ?',
|
||||
@@ -175,7 +190,7 @@ class UploadLocksDB {
|
||||
}
|
||||
|
||||
Future<bool> isLocked(String id, String owner) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
final rows = await db.query(
|
||||
_uploadLocksTable.table,
|
||||
where:
|
||||
@@ -186,7 +201,7 @@ class UploadLocksDB {
|
||||
}
|
||||
|
||||
Future<int> releaseLock(String id, String owner) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
return db.delete(
|
||||
_uploadLocksTable.table,
|
||||
where:
|
||||
@@ -196,7 +211,7 @@ class UploadLocksDB {
|
||||
}
|
||||
|
||||
Future<int> releaseLocksAcquiredByOwnerBefore(String owner, int time) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
return db.delete(
|
||||
_uploadLocksTable.table,
|
||||
where:
|
||||
@@ -206,7 +221,7 @@ class UploadLocksDB {
|
||||
}
|
||||
|
||||
Future<int> releaseAllLocksAcquiredBefore(int time) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
return db.delete(
|
||||
_uploadLocksTable.table,
|
||||
where: '${_uploadLocksTable.columnTime} < ?',
|
||||
@@ -220,7 +235,7 @@ class UploadLocksDB {
|
||||
String fileHash,
|
||||
int collectionID,
|
||||
) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
|
||||
final rows = await db.query(
|
||||
_trackUploadTable.table,
|
||||
@@ -247,7 +262,7 @@ class UploadLocksDB {
|
||||
String fileHash,
|
||||
int collectionID,
|
||||
) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
await db.update(
|
||||
_trackUploadTable.table,
|
||||
{
|
||||
@@ -270,7 +285,7 @@ class UploadLocksDB {
|
||||
String fileHash,
|
||||
int collectionID,
|
||||
) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
final rows = await db.query(
|
||||
_trackUploadTable.table,
|
||||
where: '${_trackUploadTable.columnLocalID} = ?'
|
||||
@@ -328,7 +343,7 @@ class UploadLocksDB {
|
||||
int uploadedFileID,
|
||||
String errorMessage,
|
||||
) async {
|
||||
final db = await UploadLocksDB.instance.database;
|
||||
final db = await database;
|
||||
|
||||
await db.insert(
|
||||
_streamUploadErrorTable.table,
|
||||
@@ -346,7 +361,7 @@ class UploadLocksDB {
|
||||
int uploadedFileID,
|
||||
String errorMessage,
|
||||
) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
await db.update(
|
||||
_streamUploadErrorTable.table,
|
||||
{
|
||||
@@ -360,7 +375,7 @@ class UploadLocksDB {
|
||||
}
|
||||
|
||||
Future<int> deleteStreamUploadErrorEntry(int uploadedFileID) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
return await db.delete(
|
||||
_streamUploadErrorTable.table,
|
||||
where: '${_streamUploadErrorTable.columnUploadedFileID} = ?',
|
||||
@@ -369,7 +384,7 @@ class UploadLocksDB {
|
||||
}
|
||||
|
||||
Future<Map<int, String>> getStreamUploadError() {
|
||||
return instance.database.then((db) async {
|
||||
return database.then((db) async {
|
||||
final rows = await db.query(
|
||||
_streamUploadErrorTable.table,
|
||||
columns: [
|
||||
@@ -398,7 +413,7 @@ class UploadLocksDB {
|
||||
String keyNonce, {
|
||||
required int partSize,
|
||||
}) async {
|
||||
final db = await UploadLocksDB.instance.database;
|
||||
final db = await database;
|
||||
final objectKey = urls.objectKey;
|
||||
|
||||
await db.insert(
|
||||
@@ -441,7 +456,7 @@ class UploadLocksDB {
|
||||
int partNumber,
|
||||
String etag,
|
||||
) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
await db.update(
|
||||
_partsTable.table,
|
||||
{
|
||||
@@ -458,7 +473,7 @@ class UploadLocksDB {
|
||||
String objectKey,
|
||||
MultipartStatus status,
|
||||
) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
await db.update(
|
||||
_trackUploadTable.table,
|
||||
{
|
||||
@@ -472,7 +487,7 @@ class UploadLocksDB {
|
||||
Future<int> deleteMultipartTrack(
|
||||
String localId,
|
||||
) async {
|
||||
final db = await instance.database;
|
||||
final db = await database;
|
||||
return await db.delete(
|
||||
_trackUploadTable.table,
|
||||
where: '${_trackUploadTable.columnLocalID} = ?',
|
||||
@@ -482,7 +497,7 @@ class UploadLocksDB {
|
||||
|
||||
// getFileNameToLastAttemptedAtMap returns a map of encrypted file name to last attempted at time
|
||||
Future<Map<String, int>> getFileNameToLastAttemptedAtMap() {
|
||||
return instance.database.then((db) async {
|
||||
return database.then((db) async {
|
||||
final rows = await db.query(
|
||||
_trackUploadTable.table,
|
||||
columns: [
|
||||
@@ -504,7 +519,7 @@ class UploadLocksDB {
|
||||
String fileHash,
|
||||
int collectionID,
|
||||
) {
|
||||
return instance.database.then((db) async {
|
||||
return database.then((db) async {
|
||||
final rows = await db.query(
|
||||
_trackUploadTable.table,
|
||||
where: '${_trackUploadTable.columnLocalID} = ?'
|
||||
@@ -519,4 +534,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 database;
|
||||
await db.insert(
|
||||
_streamQueueTable.table,
|
||||
{
|
||||
_streamQueueTable.columnUploadedFileID: uploadedFileID,
|
||||
_streamQueueTable.columnQueueType: queueType,
|
||||
},
|
||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> removeFromStreamQueue(int uploadedFileID) async {
|
||||
final db = await database;
|
||||
await db.delete(
|
||||
_streamQueueTable.table,
|
||||
where: '${_streamQueueTable.columnUploadedFileID} = ?',
|
||||
whereArgs: [uploadedFileID],
|
||||
);
|
||||
}
|
||||
|
||||
Future<Map<int, String>> getStreamQueue() async {
|
||||
final db = await 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 database;
|
||||
final rows = await db.query(
|
||||
_streamQueueTable.table,
|
||||
where: '${_streamQueueTable.columnUploadedFileID} = ?',
|
||||
whereArgs: [uploadedFileID],
|
||||
);
|
||||
return rows.isNotEmpty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()!,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
@@ -1827,5 +1827,124 @@
|
||||
"type": "int"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"videosProcessed": "Videos processed",
|
||||
"totalVideos": "Total videos",
|
||||
"skippedVideos": "Skipped videos",
|
||||
"videoStreamingDescriptionLine1": "Play videos instantly on any device.",
|
||||
"videoStreamingDescriptionLine2": "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": "String"
|
||||
},
|
||||
"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": "Review and remove images that look similar to each other.",
|
||||
"all": "All",
|
||||
"similar": "Similar",
|
||||
"identical": "Identical",
|
||||
"nothingHereTryAnotherFilter": "Nothing here, try another filter! 👀"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
|
||||
@@ -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(
|
||||
|
||||
103
mobile/apps/photos/lib/models/feed/feed_models.dart
Normal file
103
mobile/apps/photos/lib/models/feed/feed_models.dart
Normal file
@@ -0,0 +1,103 @@
|
||||
class FeedUser {
|
||||
final String id;
|
||||
final String name;
|
||||
final String avatarUrl;
|
||||
|
||||
const FeedUser({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.avatarUrl,
|
||||
});
|
||||
}
|
||||
|
||||
class FeedPhoto {
|
||||
final String id;
|
||||
final String url;
|
||||
final String? description;
|
||||
|
||||
const FeedPhoto({
|
||||
required this.id,
|
||||
required this.url,
|
||||
this.description,
|
||||
});
|
||||
}
|
||||
|
||||
enum FeedItemType {
|
||||
memory,
|
||||
album,
|
||||
photos,
|
||||
video,
|
||||
}
|
||||
|
||||
class FeedItem {
|
||||
final String id;
|
||||
final FeedUser user;
|
||||
final FeedItemType type;
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final List<FeedPhoto> photos;
|
||||
final bool isLiked;
|
||||
final int likeCount;
|
||||
final String timeAgo;
|
||||
final bool isVideo;
|
||||
|
||||
const FeedItem({
|
||||
required this.id,
|
||||
required this.user,
|
||||
required this.type,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.photos,
|
||||
this.isLiked = false,
|
||||
this.likeCount = 0,
|
||||
required this.timeAgo,
|
||||
this.isVideo = false,
|
||||
});
|
||||
|
||||
FeedItem copyWith({
|
||||
bool? isLiked,
|
||||
int? likeCount,
|
||||
}) {
|
||||
return FeedItem(
|
||||
id: id,
|
||||
user: user,
|
||||
type: type,
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
photos: photos,
|
||||
isLiked: isLiked ?? this.isLiked,
|
||||
likeCount: likeCount ?? this.likeCount,
|
||||
timeAgo: timeAgo,
|
||||
isVideo: isVideo,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class NotificationItem {
|
||||
final String id;
|
||||
final FeedUser user;
|
||||
final String action;
|
||||
final String timeAgo;
|
||||
final FeedPhoto? photo;
|
||||
final bool isRead;
|
||||
|
||||
const NotificationItem({
|
||||
required this.id,
|
||||
required this.user,
|
||||
required this.action,
|
||||
required this.timeAgo,
|
||||
this.photo,
|
||||
this.isRead = false,
|
||||
});
|
||||
|
||||
NotificationItem copyWith({bool? isRead}) {
|
||||
return NotificationItem(
|
||||
id: id,
|
||||
user: user,
|
||||
action: action,
|
||||
timeAgo: timeAgo,
|
||||
photo: photo,
|
||||
isRead: isRead ?? this.isRead,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,6 @@ class FillerMemory extends SmartMemory {
|
||||
|
||||
@override
|
||||
String createTitle(AppLocalizations locals, String languageCode) {
|
||||
return locals.yearsAgo(yearsAgo);
|
||||
return locals.yearsAgo(count: yearsAgo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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!);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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!;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
289
mobile/apps/photos/lib/services/feed/feed_data_service.dart
Normal file
289
mobile/apps/photos/lib/services/feed/feed_data_service.dart
Normal file
@@ -0,0 +1,289 @@
|
||||
import 'package:photos/models/feed/feed_models.dart';
|
||||
|
||||
class FeedDataService {
|
||||
static const List<FeedUser> _mockUsers = [
|
||||
FeedUser(
|
||||
id: "1",
|
||||
name: "Bob",
|
||||
avatarUrl: "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=150&h=150&fit=crop&crop=face",
|
||||
),
|
||||
FeedUser(
|
||||
id: "2",
|
||||
name: "Alice",
|
||||
avatarUrl: "https://images.unsplash.com/photo-1494790108755-2616b09c7bec?w=150&h=150&fit=crop&crop=face",
|
||||
),
|
||||
FeedUser(
|
||||
id: "3",
|
||||
name: "Charlie",
|
||||
avatarUrl: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=150&h=150&fit=crop&crop=face",
|
||||
),
|
||||
FeedUser(
|
||||
id: "4",
|
||||
name: "Diana",
|
||||
avatarUrl: "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=150&h=150&fit=crop&crop=face",
|
||||
),
|
||||
];
|
||||
|
||||
static List<FeedItem> getMockFeedItems() {
|
||||
return [
|
||||
FeedItem(
|
||||
id: "1",
|
||||
user: _mockUsers[0],
|
||||
type: FeedItemType.memory,
|
||||
title: "Trip to paris",
|
||||
subtitle: "shared a memory",
|
||||
timeAgo: "2h ago",
|
||||
photos: [
|
||||
const FeedPhoto(
|
||||
id: "1",
|
||||
url: "https://images.unsplash.com/photo-1499856871958-5b9627545d1a?w=400&h=600&fit=crop&crop=center",
|
||||
description: "Beautiful archway in Paris with a silhouette of a person",
|
||||
),
|
||||
const FeedPhoto(
|
||||
id: "1a",
|
||||
url: "https://images.unsplash.com/photo-1502602898536-47ad22581b52?w=400&h=600&fit=crop",
|
||||
description: "Eiffel Tower at sunset",
|
||||
),
|
||||
const FeedPhoto(
|
||||
id: "1b",
|
||||
url: "https://images.unsplash.com/photo-1471623643120-e6ccc3452a4e?w=400&h=600&fit=crop",
|
||||
description: "Paris street with classic architecture",
|
||||
),
|
||||
const FeedPhoto(
|
||||
id: "1c",
|
||||
url: "https://images.unsplash.com/photo-1549144511-f099e773c147?w=400&h=600&fit=crop",
|
||||
description: "Seine river with Notre Dame",
|
||||
),
|
||||
],
|
||||
),
|
||||
FeedItem(
|
||||
id: "2",
|
||||
user: _mockUsers[0],
|
||||
type: FeedItemType.photos,
|
||||
title: "Maldives",
|
||||
subtitle: "shared 3 photos",
|
||||
timeAgo: "4h ago",
|
||||
likeCount: 12,
|
||||
photos: [
|
||||
const FeedPhoto(
|
||||
id: "2",
|
||||
url: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400&h=600&fit=crop",
|
||||
description: "Woman sitting on wooden walkway overlooking tropical landscape",
|
||||
),
|
||||
const FeedPhoto(
|
||||
id: "3",
|
||||
url: "https://images.unsplash.com/photo-1544551763-46a013bb70d5?w=400&h=600&fit=crop",
|
||||
description: "Tropical beach with crystal clear water",
|
||||
),
|
||||
const FeedPhoto(
|
||||
id: "4",
|
||||
url: "https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=400&h=600&fit=crop",
|
||||
description: "Overwater bungalows in Maldives",
|
||||
),
|
||||
],
|
||||
),
|
||||
FeedItem(
|
||||
id: "3",
|
||||
user: _mockUsers[0],
|
||||
type: FeedItemType.photos,
|
||||
title: "Maldives",
|
||||
subtitle: "shared 3 photos",
|
||||
timeAgo: "6h ago",
|
||||
isLiked: true,
|
||||
likeCount: 8,
|
||||
photos: [
|
||||
const FeedPhoto(
|
||||
id: "5",
|
||||
url: "https://images.unsplash.com/photo-1544198365-f5d60b6d8190?w=400&h=300&fit=crop",
|
||||
description: "Woman with drink on beach",
|
||||
),
|
||||
const FeedPhoto(
|
||||
id: "6",
|
||||
url: "https://images.unsplash.com/photo-1544551763-77ef2d0cfc6c?w=400&h=300&fit=crop",
|
||||
description: "Couple enjoying tropical vacation",
|
||||
),
|
||||
const FeedPhoto(
|
||||
id: "7",
|
||||
url: "https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=400&h=300&fit=crop",
|
||||
description: "Beautiful lagoon view",
|
||||
),
|
||||
],
|
||||
),
|
||||
FeedItem(
|
||||
id: "4",
|
||||
user: _mockUsers[0],
|
||||
type: FeedItemType.video,
|
||||
title: "Maldives",
|
||||
subtitle: "shared a video",
|
||||
timeAgo: "1d ago",
|
||||
likeCount: 25,
|
||||
isVideo: true,
|
||||
photos: [
|
||||
const FeedPhoto(
|
||||
id: "8",
|
||||
url: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400&h=600&fit=crop",
|
||||
description: "Video thumbnail of tropical scenery",
|
||||
),
|
||||
],
|
||||
),
|
||||
FeedItem(
|
||||
id: "5",
|
||||
user: _mockUsers[0],
|
||||
type: FeedItemType.album,
|
||||
title: "Pets",
|
||||
subtitle: "liked an Album",
|
||||
timeAgo: "2d ago",
|
||||
likeCount: 15,
|
||||
photos: [
|
||||
const FeedPhoto(
|
||||
id: "9",
|
||||
url: "https://images.unsplash.com/photo-1552053831-71594a27632d?w=400&h=600&fit=crop",
|
||||
description: "Happy dog in a grassy field",
|
||||
),
|
||||
],
|
||||
),
|
||||
FeedItem(
|
||||
id: "6",
|
||||
user: _mockUsers[1],
|
||||
type: FeedItemType.memory,
|
||||
title: "Mountain Adventure",
|
||||
subtitle: "shared a memory",
|
||||
timeAgo: "3d ago",
|
||||
likeCount: 32,
|
||||
photos: [
|
||||
const FeedPhoto(
|
||||
id: "10",
|
||||
url: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400&h=600&fit=crop",
|
||||
description: "Breathtaking mountain landscape view",
|
||||
),
|
||||
],
|
||||
),
|
||||
FeedItem(
|
||||
id: "7",
|
||||
user: _mockUsers[2],
|
||||
type: FeedItemType.photos,
|
||||
title: "City Lights",
|
||||
subtitle: "shared 5 photos",
|
||||
timeAgo: "1w ago",
|
||||
isLiked: true,
|
||||
likeCount: 45,
|
||||
photos: [
|
||||
const FeedPhoto(
|
||||
id: "11",
|
||||
url: "https://images.unsplash.com/photo-1519501025264-65ba15a82390?w=400&h=600&fit=crop",
|
||||
description: "Urban cityscape at night",
|
||||
),
|
||||
const FeedPhoto(
|
||||
id: "12",
|
||||
url: "https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?w=400&h=600&fit=crop",
|
||||
description: "City lights reflecting on water",
|
||||
),
|
||||
const FeedPhoto(
|
||||
id: "13",
|
||||
url: "https://images.unsplash.com/photo-1514565131-fce0801e5785?w=400&h=600&fit=crop",
|
||||
description: "Busy street with neon lights",
|
||||
),
|
||||
const FeedPhoto(
|
||||
id: "14",
|
||||
url: "https://images.unsplash.com/photo-1519501025264-65ba15a82390?w=400&h=600&fit=crop",
|
||||
description: "Skyscraper view from below",
|
||||
),
|
||||
const FeedPhoto(
|
||||
id: "15",
|
||||
url: "https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?w=400&h=600&fit=crop",
|
||||
description: "City panorama at sunset",
|
||||
),
|
||||
],
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
static List<NotificationItem> getMockNotifications() {
|
||||
return [
|
||||
NotificationItem(
|
||||
id: "1",
|
||||
user: _mockUsers[0],
|
||||
action: "Liked your photo",
|
||||
timeAgo: "40m ago",
|
||||
photo: const FeedPhoto(
|
||||
id: "n1",
|
||||
url: "https://images.unsplash.com/photo-1552053831-71594a27632d?w=100&h=100&fit=crop",
|
||||
),
|
||||
),
|
||||
NotificationItem(
|
||||
id: "2",
|
||||
user: _mockUsers[1],
|
||||
action: "Liked your photo",
|
||||
timeAgo: "2hrs ago",
|
||||
photo: const FeedPhoto(
|
||||
id: "n2",
|
||||
url: "https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=100&h=100&fit=crop",
|
||||
),
|
||||
),
|
||||
NotificationItem(
|
||||
id: "3",
|
||||
user: _mockUsers[2],
|
||||
action: "Liked your photo",
|
||||
timeAgo: "1 day ago",
|
||||
photo: const FeedPhoto(
|
||||
id: "n3",
|
||||
url: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=100&h=100&fit=crop",
|
||||
),
|
||||
),
|
||||
NotificationItem(
|
||||
id: "4",
|
||||
user: _mockUsers[0],
|
||||
action: "Liked your album",
|
||||
timeAgo: "14 days ago",
|
||||
photo: const FeedPhoto(
|
||||
id: "n4",
|
||||
url: "https://images.unsplash.com/photo-1519501025264-65ba15a82390?w=100&h=100&fit=crop",
|
||||
),
|
||||
),
|
||||
NotificationItem(
|
||||
id: "5",
|
||||
user: _mockUsers[3],
|
||||
action: "Liked your photo",
|
||||
timeAgo: "2 mnths ago",
|
||||
photo: const FeedPhoto(
|
||||
id: "n5",
|
||||
url: "https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?w=100&h=100&fit=crop",
|
||||
),
|
||||
),
|
||||
// Read notifications
|
||||
NotificationItem(
|
||||
id: "6",
|
||||
user: _mockUsers[0],
|
||||
action: "Liked your photo",
|
||||
timeAgo: "40m ago",
|
||||
isRead: true,
|
||||
photo: const FeedPhoto(
|
||||
id: "n6",
|
||||
url: "https://images.unsplash.com/photo-1552053831-71594a27632d?w=100&h=100&fit=crop",
|
||||
),
|
||||
),
|
||||
NotificationItem(
|
||||
id: "7",
|
||||
user: _mockUsers[1],
|
||||
action: "Liked your photo",
|
||||
timeAgo: "2hrs ago",
|
||||
isRead: true,
|
||||
photo: const FeedPhoto(
|
||||
id: "n7",
|
||||
url: "https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=100&h=100&fit=crop",
|
||||
),
|
||||
),
|
||||
NotificationItem(
|
||||
id: "8",
|
||||
user: _mockUsers[2],
|
||||
action: "Liked your photo",
|
||||
timeAgo: "1 day ago",
|
||||
isRead: true,
|
||||
photo: const FeedPhoto(
|
||||
id: "n8",
|
||||
url: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=100&h=100&fit=crop",
|
||||
),
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import "package:photos/core/event_bus.dart";
|
||||
import "package:photos/events/compute_control_event.dart";
|
||||
import "package:thermal/thermal.dart";
|
||||
|
||||
enum _ComputeRunState {
|
||||
enum ComputeRunState {
|
||||
idle,
|
||||
runningML,
|
||||
generatingStream,
|
||||
@@ -35,7 +35,7 @@ class ComputeController {
|
||||
bool interactionOverride = false;
|
||||
late Timer _userInteractionTimer;
|
||||
|
||||
_ComputeRunState _currentRunState = _ComputeRunState.idle;
|
||||
ComputeRunState _currentRunState = ComputeRunState.idle;
|
||||
bool _waitingToRunML = false;
|
||||
|
||||
bool get isDeviceHealthy => _isDeviceHealthy;
|
||||
@@ -70,28 +70,44 @@ class ComputeController {
|
||||
_logger.info('init done ');
|
||||
}
|
||||
|
||||
bool requestCompute({bool ml = false, bool stream = false}) {
|
||||
_logger.info("Requesting compute: ml: $ml, stream: $stream");
|
||||
if (!_isDeviceHealthy || !_canRunGivenUserInteraction()) {
|
||||
_logger.info("Device not healthy or user interacting, denying request.");
|
||||
bool requestCompute({
|
||||
bool ml = false,
|
||||
bool stream = false,
|
||||
bool bypassInteractionCheck = false,
|
||||
}) {
|
||||
_logger.info(
|
||||
"Requesting compute: ml: $ml, stream: $stream, bypassInteraction: $bypassInteractionCheck",
|
||||
);
|
||||
if (!_isDeviceHealthy) {
|
||||
_logger.info("Device not healthy, denying request.");
|
||||
return false;
|
||||
}
|
||||
if (ml) {
|
||||
return _requestML();
|
||||
} else if (stream) {
|
||||
return _requestStream();
|
||||
if (!bypassInteractionCheck && !_canRunGivenUserInteraction()) {
|
||||
_logger.info("User interacting, denying request.");
|
||||
return false;
|
||||
}
|
||||
_logger.severe("No compute request specified, denying request.");
|
||||
return false;
|
||||
bool result = false;
|
||||
if (ml) {
|
||||
result = _requestML();
|
||||
} else if (stream) {
|
||||
result = _requestStream();
|
||||
} else {
|
||||
_logger.severe("No compute request specified, denying request.");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
ComputeRunState get computeState {
|
||||
return _currentRunState;
|
||||
}
|
||||
|
||||
bool _requestML() {
|
||||
if (_currentRunState == _ComputeRunState.idle) {
|
||||
_currentRunState = _ComputeRunState.runningML;
|
||||
if (_currentRunState == ComputeRunState.idle) {
|
||||
_currentRunState = ComputeRunState.runningML;
|
||||
_waitingToRunML = false;
|
||||
_logger.info("ML request granted");
|
||||
return true;
|
||||
} else if (_currentRunState == _ComputeRunState.runningML) {
|
||||
} else if (_currentRunState == ComputeRunState.runningML) {
|
||||
return true;
|
||||
}
|
||||
_logger.info(
|
||||
@@ -102,12 +118,9 @@ class ComputeController {
|
||||
}
|
||||
|
||||
bool _requestStream() {
|
||||
if (_currentRunState == _ComputeRunState.idle && !_waitingToRunML) {
|
||||
if (_currentRunState == ComputeRunState.idle && !_waitingToRunML) {
|
||||
_logger.info("Stream request granted");
|
||||
_currentRunState = _ComputeRunState.generatingStream;
|
||||
return true;
|
||||
} else if (_currentRunState == _ComputeRunState.generatingStream &&
|
||||
!_waitingToRunML) {
|
||||
_currentRunState = ComputeRunState.generatingStream;
|
||||
return true;
|
||||
}
|
||||
_logger.info(
|
||||
@@ -122,13 +135,13 @@ class ComputeController {
|
||||
);
|
||||
|
||||
if (ml) {
|
||||
if (_currentRunState == _ComputeRunState.runningML) {
|
||||
_currentRunState = _ComputeRunState.idle;
|
||||
if (_currentRunState == ComputeRunState.runningML) {
|
||||
_currentRunState = ComputeRunState.idle;
|
||||
}
|
||||
_waitingToRunML = false;
|
||||
} else if (stream) {
|
||||
if (_currentRunState == _ComputeRunState.generatingStream) {
|
||||
_currentRunState = _ComputeRunState.idle;
|
||||
if (_currentRunState == ComputeRunState.generatingStream) {
|
||||
_currentRunState = ComputeRunState.idle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -15,28 +15,30 @@ 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/services/machine_learning/compute_controller.dart";
|
||||
import "package:photos/ui/notification/toast.dart";
|
||||
import "package:photos/utils/exif_util.dart";
|
||||
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 +49,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 +104,82 @@ 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, isManual: true);
|
||||
} 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,14 +190,76 @@ 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, [
|
||||
bool forceUpload = false,
|
||||
bool isManual = false,
|
||||
]) async {
|
||||
if (!_allowStream()) {
|
||||
final canStream = _isPermissionGranted();
|
||||
if (!canStream) {
|
||||
_logger.info(
|
||||
"Pause preview due to disabledSteaming($isVideoStreamingEnabled) or computeController permission)",
|
||||
"Pause preview due to disabledSteaming($isVideoStreamingEnabled) or computeController permission) - isManual: $isManual",
|
||||
);
|
||||
if (isVideoStreamingEnabled) _logger.info("No permission to run compute");
|
||||
clearQueue();
|
||||
@@ -126,10 +274,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 +295,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 +317,10 @@ class VideoPreviewService {
|
||||
: _items[enteFile.uploadedFileID!]?.retryCount ?? 0,
|
||||
collectionID: enteFile.collectionID ?? 0,
|
||||
);
|
||||
_fireVideoPreviewStateChange(
|
||||
enteFile.uploadedFileID!,
|
||||
PreviewItemStatus.inQueue,
|
||||
);
|
||||
fileQueue[enteFile.uploadedFileID!] = enteFile;
|
||||
return;
|
||||
}
|
||||
@@ -175,6 +334,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 +350,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 +367,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 +378,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 +433,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 +460,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 +475,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 +543,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 +570,8 @@ class VideoPreviewService {
|
||||
final file = entry.value;
|
||||
fileQueue.remove(entry.key);
|
||||
await chunkAndUploadVideo(ctx, file);
|
||||
} else {
|
||||
computeController.releaseCompute(stream: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -404,16 +579,28 @@ 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 +611,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 +624,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 +669,7 @@ class VideoPreviewService {
|
||||
},
|
||||
encryptionKey,
|
||||
);
|
||||
final _ = await _enteDio.put(
|
||||
final _ = await serviceLocator.enteDio.put(
|
||||
"/files/video-data",
|
||||
data: {
|
||||
"fileID": file.uploadedFileID!,
|
||||
@@ -493,7 +688,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 +698,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 +729,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 +745,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 +769,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 +785,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 +799,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 +828,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 +839,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 +871,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 +885,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 +925,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 +937,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 +949,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 +959,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 +974,97 @@ 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 +1080,10 @@ class VideoPreviewService {
|
||||
retryCount: _maxRetryCount,
|
||||
error: failureFiles[enteFile.uploadedFileID!],
|
||||
);
|
||||
_fireVideoPreviewStateChange(
|
||||
enteFile.uploadedFileID!,
|
||||
PreviewItemStatus.failed,
|
||||
);
|
||||
}
|
||||
if (isFailure) {
|
||||
_logger.info(
|
||||
@@ -846,25 +1099,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();
|
||||
}
|
||||
|
||||
@@ -873,13 +1130,31 @@ class VideoPreviewService {
|
||||
computeController.requestCompute(stream: true);
|
||||
}
|
||||
|
||||
void queueFiles({Duration duration = const Duration(seconds: 5)}) {
|
||||
Future.delayed(duration, () {
|
||||
if (!_hasQueuedFile && _allowStream()) {
|
||||
_putFilesForPreviewCreation(true).catchError((_) {
|
||||
_hasQueuedFile = false;
|
||||
});
|
||||
}
|
||||
bool _allowManualStream() {
|
||||
return isVideoStreamingEnabled &&
|
||||
computeController.requestCompute(
|
||||
stream: true,
|
||||
bypassInteractionCheck: true,
|
||||
);
|
||||
}
|
||||
|
||||
bool _isPermissionGranted() {
|
||||
return isVideoStreamingEnabled &&
|
||||
computeController.computeState == ComputeRunState.generatingStream;
|
||||
}
|
||||
|
||||
void queueFiles({
|
||||
Duration duration = const Duration(seconds: 5),
|
||||
bool isManual = false,
|
||||
}) {
|
||||
Future.delayed(duration, () async {
|
||||
if (_hasQueuedFile) return;
|
||||
|
||||
final isStreamAllowed = isManual ? _allowManualStream() : _allowStream();
|
||||
if (!isStreamAllowed) return;
|
||||
|
||||
await _ensurePreviewIdsInitialized();
|
||||
await _putFilesForPreviewCreation();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -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
@@ -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>)>();
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -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!
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
@@ -276,12 +276,12 @@ class _CollectionActionSheetState extends State<CollectionActionSheet> {
|
||||
isDisabled: _selectedCollections.isEmpty,
|
||||
onTap: () async {
|
||||
if (widget.selectedPeople != null) {
|
||||
final ProgressDialog? dialog = createProgressDialog(
|
||||
final ProgressDialog dialog = createProgressDialog(
|
||||
context,
|
||||
AppLocalizations.of(context).uploadingFilesToAlbum,
|
||||
isDismissible: true,
|
||||
);
|
||||
await dialog?.show();
|
||||
await dialog.show();
|
||||
for (final collection in _selectedCollections) {
|
||||
try {
|
||||
await smartAlbumsService.addPeopleToSmartAlbum(
|
||||
@@ -297,7 +297,7 @@ class _CollectionActionSheetState extends State<CollectionActionSheet> {
|
||||
}
|
||||
}
|
||||
unawaited(smartAlbumsService.syncSmartAlbums());
|
||||
await dialog?.hide();
|
||||
await dialog.hide();
|
||||
return;
|
||||
}
|
||||
final CollectionActions collectionActions =
|
||||
@@ -312,7 +312,7 @@ class _CollectionActionSheetState extends State<CollectionActionSheet> {
|
||||
showShortToast(
|
||||
context,
|
||||
AppLocalizations.of(context)
|
||||
.addedToAlbums(_selectedCollections.length),
|
||||
.addedToAlbums(count: _selectedCollections.length),
|
||||
);
|
||||
widget.selectedFiles?.clearAll();
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
},
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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 {
|
||||
|
||||
126
mobile/apps/photos/lib/ui/feed/feed_tab.dart
Normal file
126
mobile/apps/photos/lib/ui/feed/feed_tab.dart
Normal file
@@ -0,0 +1,126 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:photos/models/feed/feed_models.dart';
|
||||
import 'package:photos/services/feed/feed_data_service.dart';
|
||||
import 'package:photos/theme/ente_theme.dart';
|
||||
import 'package:photos/ui/feed/feed_viewer_page.dart';
|
||||
import 'package:photos/ui/feed/notifications_page.dart';
|
||||
import 'package:photos/ui/feed/widgets/feed_item_widget.dart';
|
||||
import 'package:photos/utils/navigation_util.dart';
|
||||
|
||||
class FeedTab extends StatefulWidget {
|
||||
const FeedTab({super.key});
|
||||
|
||||
@override
|
||||
State<FeedTab> createState() => _FeedTabState();
|
||||
}
|
||||
|
||||
class _FeedTabState extends State<FeedTab> {
|
||||
List<FeedItem> _feedItems = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadFeedItems();
|
||||
}
|
||||
|
||||
void _loadFeedItems() {
|
||||
setState(() {
|
||||
_feedItems = FeedDataService.getMockFeedItems();
|
||||
});
|
||||
}
|
||||
|
||||
void _onLike(int index) {
|
||||
setState(() {
|
||||
final item = _feedItems[index];
|
||||
_feedItems[index] = item.copyWith(
|
||||
isLiked: !item.isLiked,
|
||||
likeCount: item.isLiked ? item.likeCount - 1 : item.likeCount + 1,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
void _onFeedItemTap(FeedItem item) {
|
||||
routeToPage(
|
||||
context,
|
||||
FeedViewerPage(
|
||||
feedItem: item,
|
||||
onLike: () {
|
||||
final index = _feedItems.indexWhere((f) => f.id == item.id);
|
||||
if (index != -1) {
|
||||
_onLike(index);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _onNotificationsTap() {
|
||||
routeToPage(context, const NotificationsPage());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: colorScheme.backgroundBase,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
// Header
|
||||
Container(
|
||||
padding: const EdgeInsets.fromLTRB(16, 20, 16, 32),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
'Feed',
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.w800,
|
||||
letterSpacing: -0.5,
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: _onNotificationsTap,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Icon(
|
||||
Icons.notifications_outlined,
|
||||
size: 28,
|
||||
color: colorScheme.textBase,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Feed content
|
||||
Expanded(
|
||||
child: _feedItems.isEmpty
|
||||
? const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView.builder(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 100),
|
||||
itemCount: _feedItems.length,
|
||||
itemBuilder: (context, index) {
|
||||
final item = _feedItems[index];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
child: FeedItemWidget(
|
||||
item: item,
|
||||
onTap: () => _onFeedItemTap(item),
|
||||
onLike: () => _onLike(index),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
322
mobile/apps/photos/lib/ui/feed/feed_viewer_page.dart
Normal file
322
mobile/apps/photos/lib/ui/feed/feed_viewer_page.dart
Normal file
@@ -0,0 +1,322 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:photos/models/feed/feed_models.dart';
|
||||
import 'package:photos/ui/feed/notifications_page.dart';
|
||||
import 'package:photos/ui/feed/widgets/feed_user_avatar.dart';
|
||||
import 'package:photos/utils/navigation_util.dart';
|
||||
|
||||
class FeedViewerPage extends StatefulWidget {
|
||||
final FeedItem feedItem;
|
||||
final VoidCallback? onLike;
|
||||
|
||||
const FeedViewerPage({
|
||||
required this.feedItem,
|
||||
this.onLike,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
State<FeedViewerPage> createState() => _FeedViewerPageState();
|
||||
}
|
||||
|
||||
class _FeedViewerPageState extends State<FeedViewerPage> {
|
||||
late PageController _pageController;
|
||||
int _currentPhotoIndex = 0;
|
||||
late bool _isLiked;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_pageController = PageController();
|
||||
_isLiked = widget.feedItem.isLiked;
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_pageController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _onLike() {
|
||||
setState(() {
|
||||
_isLiked = !_isLiked;
|
||||
});
|
||||
widget.onLike?.call();
|
||||
}
|
||||
|
||||
void _onNotificationsTap() {
|
||||
routeToPage(context, const NotificationsPage());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
body: Stack(
|
||||
children: [
|
||||
// Main content
|
||||
_buildMainContent(),
|
||||
// Top bar
|
||||
_buildTopBar(),
|
||||
// Bottom overlay
|
||||
_buildBottomOverlay(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMainContent() {
|
||||
if (widget.feedItem.photos.length == 1) {
|
||||
return _buildSinglePhoto();
|
||||
} else {
|
||||
return _buildMultiplePhotos();
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildSinglePhoto() {
|
||||
final photo = widget.feedItem.photos.first;
|
||||
return Center(
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: photo.url,
|
||||
fit: BoxFit.contain,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
placeholder: (context, url) => const Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
errorWidget: (context, url, error) => const Center(
|
||||
child: Icon(
|
||||
Icons.error,
|
||||
color: Colors.white,
|
||||
size: 50,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMultiplePhotos() {
|
||||
return PageView.builder(
|
||||
controller: _pageController,
|
||||
onPageChanged: (index) {
|
||||
setState(() {
|
||||
_currentPhotoIndex = index;
|
||||
});
|
||||
},
|
||||
itemCount: widget.feedItem.photos.length,
|
||||
itemBuilder: (context, index) {
|
||||
final photo = widget.feedItem.photos[index];
|
||||
return Center(
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: photo.url,
|
||||
fit: BoxFit.contain,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
placeholder: (context, url) => const Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
errorWidget: (context, url, error) => const Center(
|
||||
child: Icon(
|
||||
Icons.error,
|
||||
color: Colors.white,
|
||||
size: 50,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTopBar() {
|
||||
return SafeArea(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () => Navigator.of(context).pop(),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: const Icon(
|
||||
Icons.arrow_back,
|
||||
color: Colors.white,
|
||||
size: 28,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
const Text(
|
||||
'Feed',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: _onNotificationsTap,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: const Icon(
|
||||
Icons.notifications_outlined,
|
||||
color: Colors.white,
|
||||
size: 28,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottomOverlay() {
|
||||
return Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Colors.transparent,
|
||||
Colors.black54,
|
||||
Colors.black87,
|
||||
],
|
||||
),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// Photo indicators for multiple photos
|
||||
if (widget.feedItem.photos.length > 1) ...[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: List.generate(
|
||||
widget.feedItem.photos.length,
|
||||
(index) => Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 3),
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: index == _currentPhotoIndex
|
||||
? Colors.white
|
||||
: Colors.white.withOpacity(0.4),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
// Action buttons
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
// User info and description
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
FeedUserAvatar(
|
||||
avatarUrl: widget.feedItem.user.avatarUrl,
|
||||
name: widget.feedItem.user.name,
|
||||
size: 40,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Text(
|
||||
widget.feedItem.user.name,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
if (widget.feedItem.photos.first.description != null)
|
||||
Text(
|
||||
widget.feedItem.photos.first.description!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
// Action buttons
|
||||
Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: _onLike,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Icon(
|
||||
_isLiked ? Icons.favorite : Icons.favorite_border,
|
||||
color: _isLiked ? Colors.red : Colors.white,
|
||||
size: 32,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: const Icon(
|
||||
Icons.chat_bubble_outline,
|
||||
color: Colors.white,
|
||||
size: 32,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: const Icon(
|
||||
Icons.share_outlined,
|
||||
color: Colors.white,
|
||||
size: 32,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
// Progress bar (placeholder)
|
||||
Container(
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
199
mobile/apps/photos/lib/ui/feed/notifications_page.dart
Normal file
199
mobile/apps/photos/lib/ui/feed/notifications_page.dart
Normal file
@@ -0,0 +1,199 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:photos/models/feed/feed_models.dart';
|
||||
import 'package:photos/services/feed/feed_data_service.dart';
|
||||
import 'package:photos/theme/ente_theme.dart';
|
||||
import 'package:photos/ui/feed/widgets/feed_user_avatar.dart';
|
||||
|
||||
class NotificationsPage extends StatefulWidget {
|
||||
const NotificationsPage({super.key});
|
||||
|
||||
@override
|
||||
State<NotificationsPage> createState() => _NotificationsPageState();
|
||||
}
|
||||
|
||||
class _NotificationsPageState extends State<NotificationsPage> {
|
||||
List<NotificationItem> _unreadNotifications = [];
|
||||
List<NotificationItem> _readNotifications = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadNotifications();
|
||||
}
|
||||
|
||||
void _loadNotifications() {
|
||||
final notifications = FeedDataService.getMockNotifications();
|
||||
setState(() {
|
||||
_unreadNotifications = notifications.where((n) => !n.isRead).toList();
|
||||
_readNotifications = notifications.where((n) => n.isRead).toList();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: colorScheme.backgroundBase,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
// Header
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () => Navigator.of(context).pop(),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Icon(
|
||||
Icons.arrow_back,
|
||||
color: colorScheme.textBase,
|
||||
size: 24,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Content
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Unread section
|
||||
if (_unreadNotifications.isNotEmpty) ...[
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 8),
|
||||
child: Text(
|
||||
'Unread',
|
||||
style: TextStyle(
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: -0.3,
|
||||
),
|
||||
),
|
||||
),
|
||||
..._unreadNotifications.map((notification) =>
|
||||
_buildNotificationItem(notification, colorScheme),),
|
||||
const SizedBox(height: 24),
|
||||
],
|
||||
// Read section
|
||||
if (_readNotifications.isNotEmpty) ...[
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 8),
|
||||
child: Text(
|
||||
'Read',
|
||||
style: TextStyle(
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: -0.3,
|
||||
),
|
||||
),
|
||||
),
|
||||
..._readNotifications.map((notification) =>
|
||||
_buildNotificationItem(notification, colorScheme),),
|
||||
const SizedBox(height: 24),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNotificationItem(NotificationItem notification, colorScheme) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
// User avatar
|
||||
FeedUserAvatar(
|
||||
avatarUrl: notification.user.avatarUrl,
|
||||
name: notification.user.name,
|
||||
size: 50,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
// Notification details
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: colorScheme.textBase,
|
||||
),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: notification.user.name,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: ' ${notification.action}',
|
||||
style: TextStyle(
|
||||
color: colorScheme.textMuted,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
notification.timeAgo,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: colorScheme.textMuted,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Photo thumbnail if available
|
||||
if (notification.photo != null) ...[
|
||||
const SizedBox(width: 12),
|
||||
Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
color: Colors.grey[300],
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: notification.photo!.url,
|
||||
width: 60,
|
||||
height: 60,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (context, url) => Container(
|
||||
color: Colors.grey[300],
|
||||
child: const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
),
|
||||
errorWidget: (context, url, error) => Container(
|
||||
color: Colors.grey[300],
|
||||
child: const Center(
|
||||
child: Icon(Icons.error),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
455
mobile/apps/photos/lib/ui/feed/widgets/feed_item_widget.dart
Normal file
455
mobile/apps/photos/lib/ui/feed/widgets/feed_item_widget.dart
Normal file
@@ -0,0 +1,455 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:photos/models/feed/feed_models.dart';
|
||||
import 'package:photos/theme/ente_theme.dart';
|
||||
import 'package:photos/ui/feed/widgets/feed_user_avatar.dart';
|
||||
|
||||
class FeedItemWidget extends StatelessWidget {
|
||||
final FeedItem item;
|
||||
final VoidCallback? onTap;
|
||||
final VoidCallback? onLike;
|
||||
|
||||
const FeedItemWidget({
|
||||
required this.item,
|
||||
this.onTap,
|
||||
this.onLike,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.06),
|
||||
blurRadius: 12,
|
||||
offset: const Offset(0, 3),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// User header
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 16, 16, 12),
|
||||
child: Row(
|
||||
children: [
|
||||
FeedUserAvatar(
|
||||
avatarUrl: item.user.avatarUrl,
|
||||
name: item.user.name,
|
||||
size: 40,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.user.name,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 16,
|
||||
height: 1.2,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
item.subtitle,
|
||||
style: TextStyle(
|
||||
color: Colors.grey[600],
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
height: 1.1,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Flexible(
|
||||
child: Text(
|
||||
item.title,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 14,
|
||||
color: Colors.black87,
|
||||
height: 1.1,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: onLike,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Icon(
|
||||
item.isLiked ? Icons.favorite : Icons.favorite_border,
|
||||
color: item.isLiked ? Colors.red : colorScheme.textMuted,
|
||||
size: 24,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Content
|
||||
_buildContent(context),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildContent(BuildContext context) {
|
||||
if (item.photos.length == 1) {
|
||||
return _buildSinglePhoto(context);
|
||||
} else if (item.type == FeedItemType.memory) {
|
||||
return _buildMemoryCarousel(context);
|
||||
} else {
|
||||
return _buildMultiplePhotos(context);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildSinglePhoto(BuildContext context) {
|
||||
final photo = item.photos.first;
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: 400,
|
||||
margin: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.grey[300],
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: photo.url,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (context, url) => Container(
|
||||
color: Colors.grey[100],
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
),
|
||||
),
|
||||
errorWidget: (context, url, error) => Container(
|
||||
color: Colors.grey[100],
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.image_outlined,
|
||||
size: 48,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'Image unavailable',
|
||||
style: TextStyle(
|
||||
color: Colors.grey[600],
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Title overlay for memories and albums
|
||||
if (item.type == FeedItemType.memory || item.type == FeedItemType.album)
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(16),
|
||||
bottomRight: Radius.circular(16),
|
||||
),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Colors.transparent,
|
||||
Colors.black38,
|
||||
Colors.black54,
|
||||
],
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Text(
|
||||
item.title,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
shadows: [
|
||||
Shadow(
|
||||
offset: Offset(0, 1),
|
||||
blurRadius: 3,
|
||||
color: Colors.black26,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Video play button
|
||||
if (item.isVideo)
|
||||
Positioned.fill(
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.black54,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.play_arrow,
|
||||
color: Colors.white,
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMultiplePhotos(BuildContext context) {
|
||||
final photosToShow = item.photos.take(3).toList();
|
||||
final remainingCount = item.photos.length > 3 ? item.photos.length - 3 : 0;
|
||||
|
||||
return Container(
|
||||
height: 300,
|
||||
margin: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
child: Column(
|
||||
children: [
|
||||
// Top row - 2 images side by side
|
||||
if (photosToShow.length >= 2)
|
||||
Expanded(
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildPhotoItem(photosToShow[0], false, 0),
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
Expanded(
|
||||
child: _buildPhotoItem(photosToShow[1], false, 0),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Bottom row - 1 image full width (if 3+ photos)
|
||||
if (photosToShow.length >= 3) ...[
|
||||
const SizedBox(height: 2),
|
||||
Expanded(
|
||||
child: _buildPhotoItem(
|
||||
photosToShow[2],
|
||||
remainingCount > 0,
|
||||
remainingCount,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMemoryCarousel(BuildContext context) {
|
||||
final photo = item.photos.first;
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: 400,
|
||||
margin: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
color: Colors.grey[300],
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: photo.url,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (context, url) => Container(
|
||||
color: Colors.grey[100],
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
),
|
||||
),
|
||||
errorWidget: (context, url, error) => Container(
|
||||
color: Colors.grey[100],
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.image_outlined,
|
||||
size: 48,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'Image unavailable',
|
||||
style: TextStyle(
|
||||
color: Colors.grey[600],
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Title overlay for memories
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(16),
|
||||
bottomRight: Radius.circular(16),
|
||||
),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Colors.transparent,
|
||||
Colors.black38,
|
||||
Colors.black54,
|
||||
],
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Text(
|
||||
item.title,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
shadows: [
|
||||
Shadow(
|
||||
offset: Offset(0, 1),
|
||||
blurRadius: 3,
|
||||
color: Colors.black26,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Carousel indicator
|
||||
Positioned(
|
||||
top: 16,
|
||||
right: 16,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black.withOpacity(0.6),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Text(
|
||||
'1/${item.photos.length}',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildPhotoItem(FeedPhoto photo, bool showOverlay, int remainingCount) {
|
||||
return Stack(
|
||||
children: [
|
||||
CachedNetworkImage(
|
||||
imageUrl: photo.url,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (context, url) => Container(
|
||||
color: Colors.grey[100],
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
),
|
||||
),
|
||||
errorWidget: (context, url, error) => Container(
|
||||
color: Colors.grey[100],
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.image_outlined,
|
||||
size: 24,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
'Image unavailable',
|
||||
style: TextStyle(
|
||||
color: Colors.grey[600],
|
||||
fontSize: 8,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// Overlay for remaining photos count
|
||||
if (showOverlay)
|
||||
Container(
|
||||
color: Colors.black.withOpacity(0.6),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'+$remainingCount',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
56
mobile/apps/photos/lib/ui/feed/widgets/feed_user_avatar.dart
Normal file
56
mobile/apps/photos/lib/ui/feed/widgets/feed_user_avatar.dart
Normal file
@@ -0,0 +1,56 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class FeedUserAvatar extends StatelessWidget {
|
||||
final String avatarUrl;
|
||||
final double size;
|
||||
final String name;
|
||||
|
||||
const FeedUserAvatar({
|
||||
required this.avatarUrl,
|
||||
this.size = 40.0,
|
||||
required this.name,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: size,
|
||||
height: size,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.grey[300],
|
||||
),
|
||||
child: ClipOval(
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: avatarUrl,
|
||||
width: size,
|
||||
height: size,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (context, url) => Container(
|
||||
color: Colors.grey[300],
|
||||
child: Icon(
|
||||
Icons.person,
|
||||
color: Colors.grey[600],
|
||||
size: size * 0.6,
|
||||
),
|
||||
),
|
||||
errorWidget: (context, url, error) => Container(
|
||||
color: Colors.grey[300],
|
||||
child: Center(
|
||||
child: Text(
|
||||
name.isNotEmpty ? name[0].toUpperCase() : '?',
|
||||
style: TextStyle(
|
||||
fontSize: size * 0.4,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -151,7 +151,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
|
||||
),
|
||||
GButton(
|
||||
margin: const EdgeInsets.fromLTRB(10, 6, 8, 6),
|
||||
icon: Icons.people_outlined,
|
||||
icon: Icons.dynamic_feed_outlined,
|
||||
iconColor: enteColorScheme.tabIcon,
|
||||
iconActiveColor: strokeBaseLight,
|
||||
text: '',
|
||||
|
||||
@@ -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(() {});
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user