Merge branch 'main' into touch-id

This commit is contained in:
eYdr1en
2025-09-01 12:35:27 +02:00
46 changed files with 926 additions and 764 deletions

View File

@@ -27,6 +27,38 @@ jobs:
with:
submodules: recursive
- name: Free up disk space
run: |
echo "Initial disk usage:"
df -h /
# Get available space in KB
INITIAL=$(df / | awk 'NR==2 {print $4}')
echo -e "\n=== Removing .NET SDK (~20-25GB) ==="
BEFORE=$(df / | awk 'NR==2 {print $4}')
START=$(date +%s)
sudo rm -rf /usr/share/dotnet
END=$(date +%s)
AFTER=$(df / | awk 'NR==2 {print $4}')
FREED=$(( (AFTER - BEFORE) / 1048576 )) # Convert KB to GB
echo "Time: $((END-START))s | Freed: ${FREED}GB"
echo -e "\n=== Removing cached tools (~5-10GB) ==="
BEFORE=$(df / | awk 'NR==2 {print $4}')
START=$(date +%s)
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
END=$(date +%s)
AFTER=$(df / | awk 'NR==2 {print $4}')
FREED=$(( (AFTER - BEFORE) / 1048576 ))
echo "Time: $((END-START))s | Freed: ${FREED}GB"
echo -e "\n=== Final Summary ==="
FINAL=$(df / | awk 'NR==2 {print $4}')
TOTAL_FREED=$(( (FINAL - INITIAL) / 1048576 ))
echo "Total space freed: ${TOTAL_FREED}GB"
echo "Final disk usage:"
df -h /
- name: Setup JDK 17
uses: actions/setup-java@v1
with:
@@ -39,11 +71,6 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- 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

View File

@@ -1,77 +0,0 @@
name: "Old Internal release (photos)"
on:
workflow_dispatch: # Allow manually running the action
env:
FLUTTER_VERSION: "3.32.8"
RUST_VERSION: "1.85.1"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: mobile/apps/photos
steps:
- name: Checkout code and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Install Flutter ${{ env.FLUTTER_VERSION }}
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- 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: Setup keys
uses: timheuer/base64-to-file@v1
with:
fileName: "keystore/ente_photos_key.jks"
encodedString: ${{ secrets.SIGNING_KEY_PHOTOS }}
- name: Build PlayStore AAB
run: |
flutter build appbundle --dart-define=cronetHttpNoPlay=true --release --flavor playstore
env:
SIGNING_KEY_PATH: "/home/runner/work/_temp/keystore/ente_photos_key.jks"
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS_PHOTOS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD_PHOTOS }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD_PHOTOS }}
- name: Upload AAB to PlayStore
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: io.ente.photos
releaseFiles: mobile/apps/photos/build/app/outputs/bundle/playstoreRelease/app-playstore-release.aab
track: internal
- name: Notify Discord
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_INTERNAL_RELEASE_WEBHOOK }}
nodetail: true
title: "🏆 Internal release Photos (Branch: ${{ github.ref_name }})"
description: "[Download](https://play.google.com/store/apps/details?id=io.ente.photos)"
color: 0x00ff00

View File

@@ -28,6 +28,38 @@ jobs:
with:
submodules: recursive
- name: Free up disk space
run: |
echo "Initial disk usage:"
df -h /
# Get available space in KB
INITIAL=$(df / | awk 'NR==2 {print $4}')
echo -e "\n=== Removing .NET SDK (~20-25GB) ==="
BEFORE=$(df / | awk 'NR==2 {print $4}')
START=$(date +%s)
sudo rm -rf /usr/share/dotnet
END=$(date +%s)
AFTER=$(df / | awk 'NR==2 {print $4}')
FREED=$(( (AFTER - BEFORE) / 1048576 )) # Convert KB to GB
echo "Time: $((END-START))s | Freed: ${FREED}GB"
echo -e "\n=== Removing cached tools (~5-10GB) ==="
BEFORE=$(df / | awk 'NR==2 {print $4}')
START=$(date +%s)
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
END=$(date +%s)
AFTER=$(df / | awk 'NR==2 {print $4}')
FREED=$(( (AFTER - BEFORE) / 1048576 ))
echo "Time: $((END-START))s | Freed: ${FREED}GB"
echo -e "\n=== Final Summary ==="
FINAL=$(df / | awk 'NR==2 {print $4}')
TOTAL_FREED=$(( (FINAL - INITIAL) / 1048576 ))
echo "Total space freed: ${TOTAL_FREED}GB"
echo "Final disk usage:"
df -h /
- name: Setup JDK 17
uses: actions/setup-java@v1
with:
@@ -40,6 +72,12 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Install Flutter Rust Bridge
run: cargo install flutter_rust_bridge_codegen
- name: Generate Rust bindings
run: flutter_rust_bridge_codegen generate
- name: Setup keys
uses: timheuer/base64-to-file@v1
with:

View File

@@ -7,8 +7,7 @@ import 'package:ente_events/event_bus.dart';
import 'package:ente_events/models/signed_in_event.dart';
import 'package:ente_events/models/signed_out_event.dart';
import 'package:ente_strings/l10n/strings_localizations.dart';
import 'package:ente_ui/theme/colors.dart';
import 'package:ente_ui/theme/ente_theme_data.dart';
import "package:ente_ui/theme/ente_theme_data.dart";
import 'package:ente_ui/utils/window_listener_service.dart';
import 'package:flutter/foundation.dart';
import "package:flutter/material.dart";
@@ -87,37 +86,14 @@ class _AppState extends State<App>
@override
Widget build(BuildContext context) {
final schemes = ColorSchemeBuilder.fromCustomColors(
primary700: const Color(0xFF1565C0), // Dark blue
primary500: const Color(0xFF2196F3), // Material blue
primary400: const Color(0xFF42A5F5), // Light blue
primary300: const Color(0xFF90CAF9), // Very light blue
iconButtonColor: const Color(0xFF1976D2), // Custom icon color
gradientButtonBgColors: const [
Color(0xFF1565C0),
Color(0xFF2196F3),
Color(0xFF42A5F5),
],
);
final lightTheme = createAppThemeData(
brightness: Brightness.light,
colorScheme: schemes.light,
);
final darkTheme = createAppThemeData(
brightness: Brightness.dark,
colorScheme: schemes.dark,
);
Widget buildApp() {
if (Platform.isAndroid ||
Platform.isWindows ||
Platform.isLinux ||
kDebugMode) {
return AdaptiveTheme(
light: lightTheme,
dark: darkTheme,
light: lightThemeData,
dark: darkThemeData,
initial: AdaptiveThemeMode.system,
builder: (lightTheme, dartTheme) => MaterialApp(
title: "ente",
@@ -142,8 +118,8 @@ class _AppState extends State<App>
return MaterialApp(
title: "ente",
themeMode: ThemeMode.system,
theme: lightTheme,
darkTheme: darkTheme,
theme: lightThemeData,
darkTheme: darkThemeData,
debugShowCheckedModeBanner: false,
locale: locale,
supportedLocales: appSupportedLocales,

View File

@@ -10,6 +10,7 @@ import 'package:ente_lock_screen/ui/lock_screen.dart';
import 'package:ente_logging/logging.dart';
import 'package:ente_network/network.dart';
import "package:ente_strings/l10n/strings_localizations.dart";
import "package:ente_ui/theme/ente_theme_data.dart";
import "package:ente_ui/theme/theme_config.dart";
import 'package:ente_ui/utils/window_listener_service.dart';
import 'package:ente_utils/platform_util.dart';
@@ -103,6 +104,8 @@ Future<void> _runInForeground() async {
lockScreen: LockScreen(Configuration.instance),
enabled: await LockScreenSettings.instance.shouldShowLockScreen(),
locale: locale,
lightTheme: lightThemeData,
darkTheme: darkThemeData,
savedThemeMode: savedThemeMode,
supportedLocales: appSupportedLocales,
localizationsDelegates: const [

View File

@@ -135,6 +135,17 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity-alias>
<activity-alias
android:name="${applicationId}.IconDuckyHuggingE"
android:icon="@mipmap/icon_ducky_hugging_e"
android:enabled="false"
android:exported="true"
android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity-alias>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_ducky_hugging_e_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

View File

@@ -0,0 +1,52 @@
<svg width="198" height="150" viewBox="0 0 198 150" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.2" d="M103.208 1.51891C70.0589 1.51891 17.0832 -6.28475 9.02179 30.1961C0.957739 66.6797 0.325369 122.498 30.8944 124.356C61.4634 126.213 136.678 126.856 160.318 124.356C183.957 121.855 185.312 83.2462 185.312 57.3881C185.312 31.53 174.179 -0.973365 123.125 0.817466C107.034 1.38341 103.21 1.51891 103.21 1.51891H103.208Z" fill="white"/>
<path d="M141.928 142.014C168.856 142.014 190.684 139.1 190.684 135.504C190.684 131.909 168.856 128.995 141.928 128.995C115.001 128.995 93.1719 131.909 93.1719 135.504C93.1719 139.1 115.001 142.014 141.928 142.014Z" fill="#343434"/>
<path d="M67.2538 149.392C104.397 149.392 134.508 145.779 134.508 141.321C134.508 136.864 104.397 133.251 67.2538 133.251C30.1105 133.251 0 136.864 0 141.321C0 145.779 30.1105 149.392 67.2538 149.392Z" fill="#343434"/>
<path d="M111.039 120.086C101.394 128.801 101.925 135.497 113.988 136.559C126.051 137.622 134.713 135.151 131.923 127.605C129.159 120.086 111.039 120.086 111.039 120.086Z" fill="#FF814A"/>
<path d="M118.989 137.665C117.408 137.665 115.71 137.585 113.909 137.428C108.141 136.921 104.71 135.165 103.722 132.21C102.595 128.852 104.923 124.436 110.452 119.438C110.612 119.294 110.822 119.212 111.037 119.212C111.802 119.212 129.801 119.305 132.739 127.303C133.675 129.829 133.483 131.982 132.173 133.698C130.186 136.299 125.584 137.662 118.989 137.662V137.665ZM111.369 120.963C106.642 125.299 104.514 129.088 105.375 131.657C106.113 133.86 109.118 135.258 114.063 135.691C122.635 136.445 128.733 135.335 130.789 132.643C131.727 131.416 131.828 129.869 131.105 127.908C128.778 121.574 113.803 121.011 111.372 120.963H111.369Z" fill="#1C1C1C"/>
<path d="M157.878 120.086C167.523 128.801 166.992 135.497 154.929 136.559C142.866 137.622 134.204 135.151 136.994 127.605C139.757 120.086 157.878 120.086 157.878 120.086Z" fill="#FF814A"/>
<path d="M149.927 137.665C143.332 137.665 138.73 136.302 136.743 133.701C135.433 131.984 135.241 129.832 136.177 127.303C139.115 119.305 157.114 119.215 157.879 119.215C158.094 119.215 158.304 119.295 158.464 119.441C163.993 124.436 166.321 128.852 165.194 132.213C164.203 135.168 160.775 136.921 155.007 137.431C153.205 137.591 151.508 137.668 149.927 137.668V137.665ZM157.547 120.963C155.116 121.011 140.141 121.574 137.813 127.906C137.088 129.867 137.192 131.416 138.13 132.641C140.186 135.332 146.281 136.446 154.855 135.688C159.8 135.253 162.803 133.858 163.544 131.655C164.405 129.088 162.277 125.297 157.55 120.961L157.547 120.963Z" fill="#1C1C1C"/>
<path d="M100.616 46.8054C80.2899 35.6035 65.3176 38.7095 71.7396 52.8316L100.616 46.8054Z" fill="#F4D93B"/>
<path d="M71.743 53.7029C71.4108 53.7029 71.0946 53.5142 70.9485 53.1927C68.0231 46.7628 69.6599 43.3299 71.5463 41.5842C76.3981 37.0912 87.9747 38.8422 101.039 46.0427C101.462 46.2739 101.616 46.8053 101.382 47.2277C101.148 47.6502 100.619 47.8016 100.197 47.5705C86.1015 39.8014 76.2466 39.6101 72.7314 42.8649C70.077 45.3227 71.1611 49.4463 72.5374 52.4727C72.7367 52.9111 72.5427 53.4292 72.1043 53.6285C71.9874 53.6816 71.8652 53.7082 71.743 53.7082V53.7029Z" fill="#232323"/>
<path d="M174.283 115.362C168.265 123.375 156.484 129.659 133.976 129.659C131.848 129.659 129.815 129.604 127.876 129.495C123.46 129.247 119.517 128.729 116.001 127.985C101.956 125.015 94.7002 118.444 91.084 111.161C86.2907 101.506 87.8929 90.6011 88.5518 85.1861C89.6146 76.4552 90.7253 70.2882 91.7456 64.4747C92.0059 62.9814 92.261 61.5147 92.5081 60.0321C93.1299 56.3043 93.903 52.8635 94.8117 49.6883C101.154 27.4916 114.091 18.3488 127.926 16.3932C129.93 16.1089 131.952 15.9761 133.976 15.9761C138.254 15.9761 142.59 16.5022 146.775 17.7696C160.206 21.8375 172.086 33.5469 175.444 60.0321C176.372 67.3389 178.069 74.2153 179.403 85.1861C180.161 91.4062 182.161 104.867 174.283 115.362Z" fill="#F4D93B"/>
<path d="M129.171 17.7694C129.171 17.7694 107.25 19.5257 97.8895 49.7174L95.2936 51.1947L94.8047 49.6882C101.147 27.4914 114.084 18.3486 127.919 16.3931L129.171 17.7694Z" fill="white"/>
<path d="M174.284 115.362C175.424 110.515 177.432 104.298 176.872 97.9079C174.932 75.8546 175.277 30.1539 144.047 18.8191L146.776 17.7695C160.207 21.8374 172.086 33.5469 175.445 60.0321C176.372 67.3389 178.07 74.2152 179.404 85.1861C180.161 91.4062 182.162 104.867 174.284 115.362Z" fill="white"/>
<path d="M121.074 101.628C120.253 107.898 118.297 117.926 116.001 127.986C101.956 125.015 94.7002 118.444 91.084 111.161C86.2907 101.506 87.8929 90.6013 88.5518 85.1863C89.6146 76.4553 90.7253 70.2884 91.7456 64.4748L94.368 54.9733C137.813 54.333 124.794 73.1978 121.074 101.628Z" fill="#E2B639"/>
<path d="M133.974 130.53C115.279 130.53 101.954 126.178 94.3657 117.596C84.9758 106.973 86.7453 92.6493 87.5956 85.7676L87.6806 85.0795C88.685 76.8215 89.7132 70.9734 90.707 65.3166C91.0338 63.454 91.342 61.6951 91.6449 59.8883C94.2674 44.1561 99.7674 32.343 107.996 24.7784C114.979 18.3564 123.72 15.1016 133.974 15.1016C144.227 15.1016 153.445 18.205 160.382 24.3214C168.906 31.8381 174.265 43.816 176.306 59.9228C176.707 63.0953 177.267 66.2518 177.863 69.5944C178.636 73.9492 179.513 78.8833 180.264 85.0795L180.349 85.7676C181.2 92.652 182.972 106.973 173.579 117.596C165.994 126.178 152.666 130.53 133.971 130.53H133.974ZM133.974 16.8472C124.172 16.8472 115.829 19.948 109.176 26.0644C101.242 33.3606 95.9227 44.8363 93.364 60.1779C93.0611 61.9926 92.7529 63.7542 92.4234 65.6195C91.4323 71.2523 90.4094 77.0792 89.4103 85.292L89.3253 85.9855C88.5069 92.6148 86.8011 106.41 95.6703 116.446C102.911 124.637 115.797 128.79 133.971 128.79C152.145 128.79 165.032 124.637 172.272 116.446C181.141 106.41 179.438 92.6148 178.617 85.9855L178.532 85.2947C177.785 79.1437 176.914 74.2335 176.143 69.9026C175.546 66.5388 174.982 63.361 174.573 60.146C170.035 24.3613 149.988 16.8499 133.971 16.8499L133.974 16.8472Z" fill="#1C1C1C"/>
<path d="M135.676 20.3044L126.961 19.5631C127.338 17.4136 127.864 15.5564 128.483 13.994C131.411 6.59157 136.401 5.82901 137.307 12.1208C137.307 12.1208 140.036 6.16113 147.21 7.88022C149.187 8.35583 150.143 9.60198 150.228 11.1324C150.454 15.1312 144.726 21.0776 135.676 20.3044Z" fill="#F4D93B"/>
<path d="M150.229 11.1324C147.761 9.91816 140.659 9.25922 138.754 11.2706C136.508 13.6406 137.282 12.0863 136.928 11.244C136.575 10.3991 130.108 11.0235 127.969 18.3914L128.484 13.994C131.412 6.59157 136.402 5.82901 137.308 12.1208C137.308 12.1208 140.037 6.16113 147.211 7.88022C149.188 8.35583 150.144 9.60198 150.229 11.1324Z" fill="white"/>
<path d="M126.453 19.475C126.299 15.4656 128.345 9.79818 131.853 7.54768C133.524 6.48222 135.604 6.64961 136.824 8.29697C137.621 9.36243 137.95 10.768 138.043 12.0115L136.619 11.8069C136.725 11.581 136.816 11.4216 136.922 11.2409C138.968 7.76025 142.871 6.13681 146.796 6.95251C152.516 7.97281 151.823 13.4516 148.488 16.7782C146.277 19.0287 143.31 20.4236 140.225 20.8966C138.692 21.1251 137.129 21.1011 135.623 20.8514C135.32 20.8009 135.115 20.5166 135.166 20.2137C135.211 19.9427 135.445 19.7514 135.71 19.7487C137.156 19.7434 138.58 19.6371 139.967 19.3714C142.704 18.8586 145.371 17.6523 147.308 15.641C148.873 14.0547 150.592 10.8185 148.26 9.20301C147.771 8.86557 147.075 8.67958 146.487 8.56533C145.812 8.43779 145.13 8.37136 144.457 8.38996C141.747 8.40591 139.242 10.0665 137.982 12.4286C137.663 13.0769 136.678 12.9255 136.558 12.224C136.21 10.6936 135.341 8.16146 133.375 9.0861C129.985 11.0231 128.956 16.2149 127.45 19.6478C127.253 20.1606 126.461 20.025 126.451 19.4724L126.453 19.475Z" fill="#1C1C1C"/>
<path d="M121.04 44.7142C127.356 40.8907 130.499 40.6516 136.932 44.8629C138.415 45.8407 137.939 47.3233 136.634 47.8574C133.52 49.1036 124.715 49.1912 121.216 48.0062C119.614 47.4429 119.319 45.7823 121.038 44.7142H121.04Z" fill="#FF814A"/>
<path d="M120.694 44.1455C122.944 42.8516 125.41 41.5815 128.054 41.2759C130.761 40.9624 133.434 42.0545 135.708 43.3405C136.096 43.545 136.466 43.7762 136.838 43.9994C137.263 44.2545 137.698 44.4989 138.031 44.9054C139.064 46.048 138.522 47.7644 137.22 48.4313C136.078 48.984 134.784 49.2045 133.546 49.3905C129.626 49.8581 125.622 49.9166 121.764 48.976C121.345 48.8352 120.744 48.6917 120.367 48.4286C118.541 47.2941 118.956 45.11 120.694 44.1455ZM121.39 45.2827C120.51 45.8274 120.205 46.8052 121.334 47.233C123.162 47.7963 125.115 47.8574 127.068 47.9504C129.967 48.0035 132.908 47.9902 135.738 47.3286C135.868 47.2808 136.378 47.1453 136.495 47.0736C137.446 46.5714 137.202 45.7982 136.365 45.3173C135.929 45.033 135.491 44.7248 135.044 44.4644C132.937 43.1731 130.636 42.1288 128.16 42.3706C125.67 42.6576 123.502 43.9675 121.387 45.2827H121.39Z" fill="#232323"/>
<path d="M111.373 54.4653L109.935 65.7577L100.806 137.407C100.806 142.152 83.2321 146 61.5535 146C60.5518 146 59.5607 145.992 58.5776 145.976C44.0969 145.737 31.8108 143.781 25.9601 141.036C23.6112 139.934 22.3013 138.703 22.3013 137.407L11.7344 54.4653H111.373Z" fill="#9F9DA8"/>
<path d="M109.936 65.7583L100.806 137.408C100.806 142.153 83.2326 146 61.554 146C60.5523 146 59.5612 145.992 58.5781 145.976C58.703 88.4253 69.0175 62.1793 109.936 65.7583Z" fill="#8A8899"/>
<path d="M25.9601 141.036C23.6112 139.934 22.3013 138.703 22.3013 137.407L11.7344 54.4653H12.5766L15.5126 57.4545L25.9601 141.036Z" fill="white"/>
<path d="M61.5596 146.871C51.0139 146.871 41.0899 145.97 33.6183 144.334C25.5915 142.577 21.4944 140.266 21.4359 137.468L10.8743 54.5742C10.8424 54.3244 10.9194 54.0747 11.0842 53.8887C11.2489 53.7027 11.488 53.5938 11.7378 53.5938H111.376C111.626 53.5938 111.865 53.7027 112.03 53.8887C112.194 54.0747 112.271 54.3271 112.24 54.5742L101.678 137.468C101.619 140.268 97.5223 142.577 89.4955 144.334C82.0213 145.97 72.1 146.871 61.5542 146.871H61.5596ZM12.7315 55.3368L23.1736 137.298C23.1789 137.335 23.1816 137.372 23.1816 137.407C23.1816 137.885 23.7023 140.377 33.993 142.63C41.3476 144.241 51.1387 145.125 61.5622 145.125C71.9857 145.125 81.7768 144.238 89.1314 142.63C99.4221 140.377 99.9429 137.885 99.9429 137.407C99.9429 137.37 99.9429 137.332 99.9508 137.298L110.393 55.3368H12.7342H12.7315Z" fill="#1C1C1C"/>
<path d="M111.373 54.4654C111.373 57.6273 101.868 60.3986 87.6135 61.9396C80.0331 62.7606 71.1081 63.2336 61.5535 63.2336C47.0169 63.2336 33.9364 62.1389 24.8282 60.3906C16.6977 58.8283 11.7344 56.7505 11.7344 54.4654C11.7344 51.2451 21.5919 48.4313 36.2826 46.9062C43.6903 46.1383 52.3283 45.6973 61.5535 45.6973C69.3014 45.6973 76.6374 46.0081 83.1763 46.5634C99.8597 47.9796 111.373 50.9847 111.373 54.4654Z" fill="#232323"/>
<path d="M61.5578 64.1055C47.5792 64.1055 34.1321 63.064 24.6677 61.2466C15.509 59.4876 10.8672 57.2052 10.8672 54.4658C10.8672 52.4306 13.2824 50.7141 18.2511 49.2156C22.5979 47.9057 28.8021 46.8057 36.1966 46.0404C43.8567 45.246 52.6249 44.8262 61.5578 44.8262C69.1622 44.8262 76.461 45.1184 83.255 45.695C91.6273 46.4071 98.7215 47.5151 103.767 48.8994C109.475 50.467 112.251 52.2871 112.251 54.4658C112.251 56.4692 109.913 58.1618 105.101 59.6444C100.903 60.9383 94.8901 62.0304 87.7135 62.8062C79.8673 63.6565 70.8228 64.1055 61.5605 64.1055H61.5578ZM61.5578 46.5692C52.686 46.5692 43.979 46.9863 36.3772 47.7728C17.5788 49.7257 12.6102 53.0045 12.6102 54.4658C12.6102 55.7067 15.8544 57.7791 24.9972 59.5354C34.3579 61.3316 47.6829 62.3625 61.5578 62.3625C70.7591 62.3625 79.7371 61.9161 87.5249 61.0738C105.704 59.1077 110.505 55.8927 110.505 54.4658C110.505 52.574 103.209 49.1385 83.1062 47.4327C76.3627 46.8588 69.1117 46.5692 61.5578 46.5692Z" fill="#232323"/>
<path d="M65.278 73.9174C50.4545 73.9174 32.1025 71.7679 12.7567 64.3973C12.483 64.2937 12.3449 63.9855 12.4485 63.7118C12.5521 63.4381 12.8603 63.3 13.134 63.4036C39.8503 73.5826 64.6696 73.7288 80.7844 72.0575C98.257 70.2454 109.555 65.9676 109.666 65.9251C109.94 65.8188 110.248 65.957 110.352 66.2306C110.458 66.5043 110.32 66.8125 110.046 66.9162C109.932 66.9587 98.5333 71.279 80.9305 73.1097C76.3578 73.5853 71.0836 73.9147 65.2727 73.9147L65.278 73.9174Z" fill="#1C1C1C"/>
<path d="M59.9036 138.648C48.4173 138.648 34.9515 137.13 21.3981 132.231C21.1217 132.13 20.9782 131.827 21.0792 131.551C21.1802 131.274 21.4831 131.131 21.7594 131.232C42.2317 138.632 62.5234 138.241 75.9413 136.61C90.4965 134.84 100.33 131.269 100.428 131.232C100.705 131.131 101.01 131.272 101.111 131.548C101.212 131.824 101.071 132.13 100.795 132.231C100.697 132.268 90.7702 135.874 76.1008 137.662C71.4351 138.23 65.943 138.65 59.9036 138.65V138.648Z" fill="#1C1C1C"/>
<path d="M28.3625 125.363C27.1482 125.363 26.1093 124.443 25.9844 123.208L21.34 76.6222C21.2098 75.3069 22.1689 74.1352 23.4815 74.005C24.7941 73.8748 25.9658 74.834 26.0987 76.1466L30.7432 122.732C30.8733 124.047 29.9142 125.219 28.6016 125.349C28.5219 125.357 28.4422 125.363 28.3625 125.363Z" fill="#232323"/>
<path d="M43.4128 127.828C42.1215 127.828 41.056 126.797 41.0242 125.498L39.8524 80.3419C39.8179 79.0214 40.8594 77.924 42.1799 77.8895C43.4952 77.855 44.5978 78.8965 44.6324 80.2171L45.8041 125.373C45.8387 126.694 44.7971 127.791 43.4766 127.826C43.4553 127.826 43.4341 127.826 43.4128 127.826V127.828Z" fill="#232323"/>
<path d="M60.6807 128.995C60.6807 128.995 60.6568 128.995 60.6435 128.995C59.323 128.976 58.2681 127.89 58.2894 126.569L58.9643 81.4077C58.9829 80.0872 60.0749 79.0297 61.3901 79.0536C62.7107 79.0722 63.7655 80.1589 63.7442 81.4795L63.0694 126.641C63.0508 127.948 61.9826 128.998 60.678 128.998L60.6807 128.995Z" fill="#232323"/>
<path d="M93.2992 125.362C93.2195 125.362 93.1398 125.36 93.0601 125.349C91.7449 125.219 90.7857 124.047 90.9185 122.732L95.563 76.1465C95.6932 74.8313 96.8676 73.8721 98.1802 74.005C99.4954 74.1352 100.455 75.3069 100.322 76.6221L95.6773 123.208C95.5551 124.441 94.5135 125.362 93.2992 125.362Z" fill="#232323"/>
<path d="M78.2515 127.828C78.2303 127.828 78.209 127.828 78.1877 127.828C76.8672 127.794 75.8257 126.696 75.8602 125.376L77.0319 80.2199C77.0665 78.9206 78.1293 77.8896 79.4206 77.8896C79.4419 77.8896 79.4631 77.8896 79.4844 77.8896C80.8049 77.9242 81.8465 79.0215 81.8119 80.3421L80.6402 125.498C80.6056 126.797 79.5428 127.828 78.2515 127.828Z" fill="#232323"/>
<path d="M92.3543 60.3824L87.6115 61.9394C80.031 62.7605 71.1061 63.2334 61.5514 63.2334C49.0342 63.2334 37.5984 62.423 28.8462 61.0786C27.4353 60.8633 26.0908 60.6322 24.8261 60.3904L24.7969 60.3824C24.7969 60.3824 24.7995 60.3718 24.7995 60.3665C25.7587 55.1507 30.815 50.5116 36.2805 46.906C40.9622 43.8186 45.9414 41.4963 48.8987 40.2316C50.5381 39.5301 51.5584 39.1528 51.5584 39.1528L74.5708 41.313C78.0409 42.7265 80.8733 44.5731 83.1743 46.5633C90.3801 52.7833 92.3543 60.3824 92.3543 60.3824Z" fill="#20D34F"/>
<path d="M50.7588 41.2815C50.7588 41.2815 31.785 53.0202 28.8411 61.0789C28.6816 61.52 28.5674 61.9478 28.5089 62.3623L24.6562 61.2463L24.821 60.3907L24.7944 60.3668C25.7536 55.1511 30.8099 50.5119 36.2754 46.9064C40.9571 43.8189 45.9363 41.4967 48.8936 40.2319L50.7588 41.2815Z" fill="white"/>
<path d="M61.5571 64.1048C47.5785 64.1048 34.1313 63.0633 24.667 61.2459C24.6457 61.2406 24.6245 61.2379 24.6032 61.2326L24.574 61.2246C24.1356 61.1077 23.8619 60.672 23.9443 60.2256C24.7999 55.5306 28.7907 50.8038 35.8052 46.1779C43.0828 41.3794 51.1814 38.3636 51.2611 38.3344C51.3833 38.2892 51.5135 38.2733 51.6437 38.2839L74.6562 40.4441C74.7412 40.4521 74.8236 40.4733 74.9033 40.5052C78.1687 41.8364 81.1446 43.6511 83.7485 45.9043C91.0765 52.228 93.1198 59.843 93.2022 60.1645C93.3191 60.6109 93.0667 61.0679 92.6309 61.2113L87.8881 62.7684C87.8297 62.787 87.7712 62.8002 87.7101 62.8056C79.8639 63.6558 70.8194 64.1048 61.5571 64.1048ZM25.8547 59.6942C35.1622 61.392 48.1019 62.3618 61.5597 62.3618C70.7264 62.3618 79.67 61.9208 87.4338 61.0838L91.2705 59.8244C90.5584 57.7705 88.191 52.0393 82.6113 47.2248C80.1828 45.1231 77.4088 43.4253 74.3665 42.1711L51.6836 40.0429C50.456 40.5132 43.2715 43.3482 36.7671 47.6366C30.6054 51.7019 26.9388 55.7538 25.8547 59.6968V59.6942Z" fill="#232323"/>
<path d="M73.0661 37.8245L52.6549 36.9291C52.2006 36.201 51.8684 35.5527 51.6399 34.9762C49.8704 30.4938 54.2491 30.2865 54.2491 30.2865C55.676 24.7387 60.1185 25.8094 63.469 27.5764C65.7354 28.772 67.5023 30.2865 67.5023 30.2865C79.2251 24.4411 73.0661 37.8245 73.0661 37.8245Z" fill="#20D34F"/>
<path d="M65.7886 29.5904C65.5229 29.5319 56.7547 27.5631 55.5272 31.9764C55.5272 31.9764 53.0535 32.545 53.9834 36.6209L51.6399 34.9762C49.8704 30.4938 54.2491 30.2865 54.2491 30.2865C55.676 24.7387 60.1185 25.8094 63.469 27.5764L65.7886 29.5904Z" fill="white"/>
<path d="M73.0599 38.696C73.0599 38.696 73.0334 38.696 73.0227 38.696L52.6115 37.8006C52.3245 37.7873 52.0615 37.6358 51.91 37.3914C50.353 34.8991 49.9545 32.8877 50.725 31.4158C51.3972 30.1298 52.755 29.6701 53.5601 29.5054C54.227 27.3904 55.4093 26.0539 57.0833 25.5251C60.9253 24.3135 66.0746 28.0413 67.6183 29.2583C70.9768 27.672 73.2459 27.5152 74.5479 28.7747C75.6479 29.8428 75.8418 31.7957 75.1218 34.5829C74.6302 36.4907 73.8836 38.1194 73.8517 38.1885C73.7082 38.4994 73.4 38.696 73.0599 38.696ZM53.1535 36.0788L72.5019 36.9264C73.5249 34.4899 74.3751 31.0358 73.3336 30.0261C72.6082 29.322 70.6234 29.702 67.8867 31.065C67.5732 31.2218 67.1959 31.174 66.9302 30.9481C65.336 29.5851 60.5533 26.2558 57.604 27.1884C56.3845 27.5737 55.5608 28.6578 55.0852 30.5044C54.9895 30.8737 54.6654 31.1394 54.2828 31.158C54.2721 31.158 52.7683 31.2563 52.2634 32.2315C51.8489 33.0312 52.1651 34.389 53.1509 36.0788H53.1535Z" fill="#232323"/>
<path d="M74.6803 37.9618L51.0823 36.4317C49.9841 36.3605 49.036 37.1931 48.9648 38.2913C48.8936 39.3896 49.7262 40.3376 50.8244 40.4089L74.4224 41.939C75.5206 42.0102 76.4687 41.1776 76.5399 40.0794C76.6111 38.9811 75.7785 38.033 74.6803 37.9618Z" fill="#9F9DA8"/>
<path d="M74.5503 42.8173C74.4866 42.8173 74.4254 42.8173 74.3617 42.812L50.7647 41.2816C50.0021 41.2311 49.3033 40.8883 48.7985 40.3144C48.2937 39.7405 48.0439 39.0019 48.0917 38.2393C48.1422 37.4767 48.485 36.7779 49.0589 36.2731C49.6355 35.7683 50.3715 35.5185 51.134 35.5663L74.731 37.0968C75.4936 37.1473 76.1924 37.49 76.6972 38.0639C77.202 38.6378 77.4518 39.3765 77.404 40.1391C77.3535 40.9016 77.0107 41.6004 76.4368 42.1053C75.9107 42.5676 75.2465 42.8173 74.5503 42.8173ZM74.4733 41.0717C74.7735 41.0903 75.0605 40.992 75.2863 40.7953C75.5122 40.5987 75.645 40.3251 75.6663 40.0248C75.6849 39.7246 75.5866 39.4376 75.3899 39.2118C75.1933 38.9859 74.9197 38.8531 74.6194 38.8318L51.0224 37.3014C50.7222 37.2828 50.4352 37.3811 50.2094 37.5777C49.9835 37.7743 49.8507 38.048 49.8294 38.3482C49.8108 38.6485 49.9091 38.9354 50.1057 39.1613C50.3024 39.3871 50.576 39.52 50.8763 39.5412L74.4733 41.0717Z" fill="#232323"/>
<path d="M111.235 40.3833C111.062 40.3833 110.889 40.3541 110.719 40.2877C109.964 40.0034 109.582 39.1584 109.869 38.4038C111.349 34.4874 114.266 33.3449 116.506 33.5813C119.158 33.863 121.299 35.9673 121.714 38.7014C121.836 39.4985 121.286 40.2452 120.489 40.3647C119.692 40.4843 118.945 39.9369 118.826 39.1398C118.61 37.7183 117.532 36.6289 116.201 36.4881C114.705 36.3287 113.36 37.4314 112.606 39.4374C112.385 40.022 111.83 40.3833 111.237 40.3833H111.235Z" fill="#1C1C1C"/>
<path d="M147.634 40.3833C147.044 40.3833 146.489 40.022 146.266 39.4374C145.509 37.434 144.164 36.3314 142.671 36.4881C141.34 36.6289 140.261 37.7183 140.046 39.1398C139.924 39.9369 139.18 40.4869 138.383 40.3647C137.585 40.2425 137.035 39.4985 137.158 38.7014C137.572 35.9673 139.714 33.863 142.365 33.5813C144.603 33.3449 147.523 34.4874 149.003 38.4038C149.287 39.1584 148.907 40.0034 148.152 40.2877C147.982 40.3514 147.807 40.3833 147.637 40.3833H147.634Z" fill="#1C1C1C"/>
<path d="M193.199 114.384C187.58 108.953 173.386 102.09 156.054 96.898C138.723 91.7061 123.094 89.6337 115.415 91.0791L111.839 90.0083L110.51 93.9938C108.879 99.4381 126.625 109.561 150.148 116.61C173.67 123.657 194.06 124.959 195.692 119.515L197.02 115.529L193.197 114.384H193.199Z" fill="#B7B6BF"/>
<path d="M184.999 123.75C183.675 123.75 182.344 123.699 181.072 123.617C172.404 123.064 161.333 120.872 149.897 117.445C138.458 114.017 128.006 109.761 120.462 105.456C114.891 102.278 108.498 97.6658 109.672 93.7414C109.672 93.7334 109.677 93.7255 109.68 93.7148L111.009 89.7293C111.157 89.2829 111.633 89.0332 112.085 89.1687L115.459 90.181C123.571 88.7462 139.55 91.0419 156.3 96.061C173.047 101.077 187.658 107.948 193.645 113.605L197.266 114.689C197.492 114.756 197.681 114.913 197.79 115.122C197.898 115.332 197.917 115.577 197.843 115.8L196.517 119.775C195.563 122.908 190.326 123.744 184.993 123.744L184.999 123.75ZM111.341 94.2569C110.605 96.7784 116.014 100.913 121.328 103.944C128.76 108.185 139.083 112.386 150.399 115.776C161.715 119.166 172.646 121.332 181.186 121.877C187.3 122.267 194.102 121.786 194.859 119.265C194.859 119.257 194.864 119.249 194.867 119.238L195.911 116.106L192.951 115.218C192.818 115.178 192.696 115.106 192.595 115.011C186.893 109.503 172.455 102.722 155.806 97.7323C139.157 92.745 123.369 90.468 115.579 91.9346C115.443 91.9612 115.302 91.9532 115.167 91.9134L112.401 91.0844L111.343 94.2542L111.341 94.2569Z" fill="#232323"/>
<path d="M197.02 115.529C195.981 119.004 187.295 119.73 175.033 117.968C168.085 116.972 159.984 115.173 151.476 112.625C127.956 105.578 110.207 95.4524 111.838 90.0082C113.47 84.5639 133.86 85.8659 157.382 92.9123C164.179 94.9502 170.492 97.2432 175.997 99.6053C189.543 105.422 198.181 111.66 197.02 115.529Z" fill="#9F9DA8"/>
<path d="M197.017 115.529C195.979 119.004 187.293 119.73 175.031 117.968C175.326 117.979 175.636 117.995 175.961 118.011C200.565 119.249 197.589 109.599 173.492 99.4966L175.995 99.6055C189.541 105.422 198.179 111.66 197.017 115.529Z" fill="white"/>
<path d="M186.335 119.764C185.011 119.764 183.68 119.714 182.408 119.631C173.74 119.078 162.668 116.886 151.233 113.459C139.794 110.031 129.342 105.775 121.798 101.47C116.226 98.2926 109.834 93.68 111.008 89.7556C112.182 85.8338 120.063 85.4964 126.461 85.9029C135.128 86.4556 146.2 88.6476 157.636 92.0752C178.688 98.383 199.939 108.833 197.858 115.776C196.917 118.919 191.67 119.761 186.332 119.761L186.335 119.764ZM122.696 87.5264C117.783 87.5264 113.282 88.2358 112.677 90.2578C111.922 92.7793 117.34 96.9216 122.659 99.9559C130.091 104.197 140.413 108.397 151.73 111.788C163.043 115.178 173.977 117.343 182.516 117.888C188.63 118.279 195.432 117.798 196.189 115.276C196.944 112.755 191.526 108.612 186.207 105.578C178.775 101.338 168.453 97.1368 157.137 93.7465C145.82 90.3561 134.887 88.1906 126.35 87.6459C125.141 87.5689 123.905 87.5264 122.696 87.5264Z" fill="#232323"/>
<path d="M164.6 106.976C164.412 106.976 164.22 106.949 164.029 106.894C162.974 106.58 162.374 105.469 162.69 104.415C163.928 100.264 161.157 98.4788 154.99 95.6544C154.06 95.2293 153.098 94.7882 152.203 94.3339C149.086 92.7503 146.803 92.2773 145.228 92.8964C143.897 93.4172 142.791 94.8467 141.941 97.1423C141.558 98.1732 140.413 98.702 139.38 98.3194C138.349 97.9368 137.82 96.7916 138.203 95.758C139.465 92.3491 141.341 90.1358 143.777 89.1846C147.369 87.779 151.339 89.4237 154.009 90.7814C154.833 91.1986 155.715 91.6051 156.65 92.0329C161.808 94.395 168.87 97.6312 166.508 105.554C166.25 106.418 165.458 106.979 164.6 106.979V106.976Z" fill="#232323"/>
<path d="M153.389 70.5537C139.259 91.3847 144.509 114.857 171.688 90.1492L153.389 70.5537Z" fill="#F4D93B"/>
<path d="M152.855 101.628C150.517 101.628 148.944 100.804 147.929 99.922C145.285 97.629 144.331 93.2529 145.243 87.6014C146.144 82.0243 148.779 75.7962 152.667 70.0624C152.938 69.6638 153.48 69.5602 153.878 69.8312C154.277 70.1022 154.38 70.6443 154.109 71.0428C150.36 76.5694 147.823 82.5477 146.962 87.8804C146.162 92.841 146.93 96.7495 149.069 98.6067C150.918 100.212 156.766 102.534 171.098 89.5065C171.454 89.1823 172.007 89.2089 172.328 89.5649C172.653 89.921 172.626 90.4736 172.27 90.7978C162.957 99.263 156.811 101.63 152.852 101.63L152.855 101.628Z" fill="#232323"/>
</svg>

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -0,0 +1,38 @@
{
"images" : [
{
"filename" : "IconDuckyHuggingEAny.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "IconDuckyHuggingEDark.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"filename" : "IconDuckyHuggingETinted.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

View File

@@ -28,6 +28,7 @@ import 'package:photos/services/favorites_service.dart';
import "package:photos/services/home_widget_service.dart";
import 'package:photos/services/ignored_files_service.dart';
import "package:photos/services/machine_learning/face_ml/person/person_service.dart";
import "package:photos/services/machine_learning/similar_images_service.dart";
import 'package:photos/services/search_service.dart';
import 'package:photos/services/sync/sync_service.dart';
import 'package:photos/utils/file_uploader.dart';
@@ -196,6 +197,7 @@ class Configuration {
await CollectionsDB.instance.clearTable();
await MemoriesDB.instance.clearTable();
await MLDataDB.instance.clearTable();
await SimilarImagesService.instance.clearCache();
await UploadLocksDB.instance.clearTable();
await IgnoredFilesService.instance.reset();

View File

@@ -27,7 +27,7 @@ const subGalleryMultiplier = 10;
// used to identify which ente file are available in app cache
const String sharedMediaIdentifier = 'ente-shared-media://';
const galleryThumbnailDiskLoadDeferDuration = Duration(milliseconds: 80);
const galleryThumbnailDiskLoadDeferDuration = Duration(milliseconds: 500);
const galleryThumbnailServerLoadDeferDuration = Duration(milliseconds: 80);
// 256 bit key maps to 24 words

View File

@@ -0,0 +1,13 @@
/// Common runtime exceptions that can occur during normal app operation.
/// These are recoverable conditions that should be caught and handled.
class WidgetUnmountedException implements Exception {
final String? message;
WidgetUnmountedException([this.message]);
@override
String toString() => message != null
? 'WidgetUnmountedException: $message'
: 'WidgetUnmountedException';
}

View File

@@ -1,3 +1,4 @@
import "dart:io" show File;
import "dart:typed_data" show Float32List;
import "package:flutter_rust_bridge/flutter_rust_bridge.dart" show Uint64List;
@@ -12,8 +13,8 @@ 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 const _databaseName = "ente.ml.vectordb.clip.usearch";
static const _kMigrationKey = "clip_vectordb_migration";
static final BigInt _embeddingDimension = BigInt.from(512);
@@ -36,11 +37,10 @@ class ClipVectorDB {
Future<VectorDb> _initVectorDB() async {
final documentsDirectory = await getApplicationDocumentsDirectory();
final String databaseDirectory =
join(documentsDirectory.path, _databaseName);
_logger.info("Opening vectorDB access: DB path " + databaseDirectory);
final String dbPath = join(documentsDirectory.path, _databaseName);
_logger.info("Opening vectorDB access: DB path " + dbPath);
final vectorDB = VectorDb(
filePath: databaseDirectory,
filePath: dbPath,
dimensions: _embeddingDimension,
);
final stats = await getIndexStats(vectorDB);
@@ -141,17 +141,6 @@ class ClipVectorDB {
}
}
Future<void> deleteIndex() async {
final db = await _vectorDB;
try {
await db.deleteIndex();
_vectorDbFuture = null;
} catch (e, s) {
_logger.severe("Error deleting index", e, s);
rethrow;
}
}
Future<VectorDbStats> getIndexStats([VectorDb? db]) async {
db ??= await _vectorDB;
try {
@@ -278,6 +267,40 @@ class ClipVectorDB {
rethrow;
}
}
Future<void> deleteIndex() async {
final db = await _vectorDB;
try {
await db.deleteIndex();
_vectorDbFuture = null;
} catch (e, s) {
_logger.severe("Error deleting index", e, s);
rethrow;
}
}
Future<void> deleteIndexFile({bool undoMigration = false}) async {
try {
final documentsDirectory = await getApplicationDocumentsDirectory();
final String dbPath = join(documentsDirectory.path, _databaseName);
_logger.info("Delete index file: DB path " + dbPath);
final file = File(dbPath);
if (await file.exists()) {
await file.delete();
}
_logger.info("Deleted index file on disk");
_vectorDbFuture = null;
if (undoMigration) {
final prefs = await SharedPreferences.getInstance();
await prefs.setBool(_kMigrationKey, false);
_migrationDone = false;
_logger.info("Undid migration flag");
}
} catch (e, s) {
_logger.severe("Error deleting index file on disk", e, s);
rethrow;
}
}
}
class VectorDbStats {

View File

@@ -260,6 +260,9 @@ class MLDataDB with SqlDbBase implements IMLDataDB<int> {
await db.execute(deleteNotPersonFeedbackTable);
await db.execute(deleteClipEmbeddingsTable);
await db.execute(deleteFileDataTable);
if (await ClipVectorDB.instance.checkIfMigrationDone()) {
await ClipVectorDB.instance.deleteIndexFile();
}
}
@override
@@ -1289,8 +1292,11 @@ class MLDataDB with SqlDbBase implements IMLDataDB<int> {
int processedCount = 0;
int weirdCount = 0;
int whileCount = 0;
const String migrationKey = "clip_vector_db_migration_in_progress";
final stopwatch = Stopwatch()..start();
try {
// Make sure no other heavy compute is running
computeController.blockCompute(blocker: migrationKey);
while (true) {
whileCount++;
_logger.info("$whileCount st round of while loop");
@@ -1320,6 +1326,9 @@ class MLDataDB with SqlDbBase implements IMLDataDB<int> {
embeddings.add(Float32List.view(result[embeddingColumn].buffer));
} else {
weirdCount++;
_logger.warning(
"Weird clip embedding length ${embedding.length} for fileID ${result[fileIDColumn]}, skipping",
);
}
}
_logger.info(
@@ -1346,7 +1355,7 @@ class MLDataDB with SqlDbBase implements IMLDataDB<int> {
"migrated all $totalCount embeddings to ClipVectorDB in ${stopwatch.elapsed.inMilliseconds} ms, with $weirdCount weird embeddings not migrated",
);
await ClipVectorDB.instance.setMigrationDone();
_logger.info("ClipVectorDB migration done, flag file created");
_logger.info("ClipVectorDB migration done");
} catch (e, s) {
_logger.severe(
"Error migrating ClipVectorDB after ${stopwatch.elapsed.inMilliseconds} ms, clearing out DB again",
@@ -1357,6 +1366,8 @@ class MLDataDB with SqlDbBase implements IMLDataDB<int> {
rethrow;
} finally {
stopwatch.stop();
// Make sure compute can run again
computeController.unblockCompute(blocker: migrationKey);
}
}

View File

@@ -66,7 +66,6 @@ class UploadLocksDB {
static final migrationScripts = [
..._createTrackUploadsTable(),
..._createStreamQueueTable(),
];
final dbConfig = MigrationConfig(
@@ -142,11 +141,6 @@ class UploadLocksDB {
${_streamUploadErrorTable.columnCreatedAt} INTEGER DEFAULT CURRENT_TIMESTAMP NOT NULL
)
''',
];
}
static List<String> _createStreamQueueTable() {
return [
'''
CREATE TABLE IF NOT EXISTS ${_streamQueueTable.table} (
${_streamQueueTable.columnUploadedFileID} INTEGER PRIMARY KEY,
@@ -158,7 +152,7 @@ class UploadLocksDB {
}
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);
@@ -166,7 +160,7 @@ class UploadLocksDB {
}
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;
@@ -179,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} = ?',
@@ -196,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:
@@ -207,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:
@@ -217,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:
@@ -227,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} < ?',
@@ -241,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,
@@ -268,7 +262,7 @@ class UploadLocksDB {
String fileHash,
int collectionID,
) async {
final db = await instance.database;
final db = await database;
await db.update(
_trackUploadTable.table,
{
@@ -291,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} = ?'
@@ -349,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,
@@ -367,7 +361,7 @@ class UploadLocksDB {
int uploadedFileID,
String errorMessage,
) async {
final db = await instance.database;
final db = await database;
await db.update(
_streamUploadErrorTable.table,
{
@@ -381,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} = ?',
@@ -390,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: [
@@ -419,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(
@@ -462,7 +456,7 @@ class UploadLocksDB {
int partNumber,
String etag,
) async {
final db = await instance.database;
final db = await database;
await db.update(
_partsTable.table,
{
@@ -479,7 +473,7 @@ class UploadLocksDB {
String objectKey,
MultipartStatus status,
) async {
final db = await instance.database;
final db = await database;
await db.update(
_trackUploadTable.table,
{
@@ -493,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} = ?',
@@ -503,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: [
@@ -525,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} = ?'
@@ -546,7 +540,7 @@ class UploadLocksDB {
int uploadedFileID,
String queueType, // 'create' or 'recreate'
) async {
final db = await instance.database;
final db = await database;
await db.insert(
_streamQueueTable.table,
{
@@ -558,7 +552,7 @@ class UploadLocksDB {
}
Future<void> removeFromStreamQueue(int uploadedFileID) async {
final db = await instance.database;
final db = await database;
await db.delete(
_streamQueueTable.table,
where: '${_streamQueueTable.columnUploadedFileID} = ?',
@@ -567,7 +561,7 @@ class UploadLocksDB {
}
Future<Map<int, String>> getStreamQueue() async {
final db = await instance.database;
final db = await database;
final rows = await db.query(
_streamQueueTable.table,
columns: [
@@ -584,7 +578,7 @@ class UploadLocksDB {
}
Future<bool> isInStreamQueue(int uploadedFileID) async {
final db = await instance.database;
final db = await database;
final rows = await db.query(
_streamQueueTable.table,
where: '${_streamQueueTable.columnUploadedFileID} = ?',

View File

@@ -1831,7 +1831,8 @@
"videosProcessed": "Videos processed",
"totalVideos": "Total videos",
"skippedVideos": "Skipped videos",
"videoStreamingDescription": "Play videos instantly on any device. Enable to process video streams on this device.",
"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",
@@ -1842,14 +1843,6 @@
"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",
@@ -1866,7 +1859,7 @@
"@deletePhotosWithSize": {
"placeholders": {
"count": {
"type": "int"
"type": "String"
},
"size": {
"type": "String"
@@ -1922,12 +1915,9 @@
"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": "You freed up {size} of space",
"@cleanedUpSimilarImages": {
"placeholders": {
"count": {
"type": "int"
},
"size": {
"type": "String"
}
@@ -1935,11 +1925,19 @@
},
"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",
"analyzingPhotosLocally": "Analyzing your photos locally...",
"lookingForVisualSimilarities": "Looking for visual similarities...",
"comparingImageDetails": "Comparing image details...",
"findingSimilarImages": "Finding similar images...",
"almostDone": "Almost done...",
"processingLocally": "Processing locally",
"useMLToFindSimilarImages": "Use ML to find images that look similar to each other."
"useMLToFindSimilarImages": "Review and remove images that look similar to each other.",
"all": "All",
"similar": "Similar",
"identical": "Identical",
"nothingHereTryAnotherFilter": "Nothing here, try another filter! 👀",
"related": "Related",
"hoorayyyy": "Hoorayyyy!",
"nothingToTidyUpHere": "Nothing to tidy up here",
"deletingDash": "Deleting - "
}

View File

@@ -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,
@@ -32,10 +32,17 @@ class ComputeController {
bool _isDeviceHealthy = true;
bool _isUserInteracting = true;
bool _canRunCompute = false;
/// If true, user interaction is ignored and compute tasks can run regardless of user activity.
bool interactionOverride = false;
/// If true, compute tasks are paused regardless of device health or user activity.
bool get computeBlocked => _computeBlocks.isNotEmpty;
final Set<String> _computeBlocks = {};
late Timer _userInteractionTimer;
_ComputeRunState _currentRunState = _ComputeRunState.idle;
ComputeRunState _currentRunState = ComputeRunState.idle;
bool _waitingToRunML = false;
bool get isDeviceHealthy => _isDeviceHealthy;
@@ -70,30 +77,49 @@ 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,
bool bypassMLWaiting = false,
}) {
_logger.info(
"Requesting compute: ml: $ml, stream: $stream, bypassInteraction: $bypassInteractionCheck, bypassMLWaiting: $bypassMLWaiting",
);
if (!_isDeviceHealthy) {
_logger.info("Device not healthy, denying request.");
return false;
}
if (!bypassInteractionCheck && !_canRunGivenUserInteraction()) {
_logger.info("User interacting, denying request.");
return false;
}
if (computeBlocked) {
_logger.info("Compute is blocked by: $_computeBlocks, denying request.");
return false;
}
bool result = false;
if (ml) {
result = _requestML();
} else if (stream) {
result = _requestStream();
result = _requestStream(bypassMLWaiting);
} 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(
@@ -103,17 +129,15 @@ class ComputeController {
return false;
}
bool _requestStream() {
if (_currentRunState == _ComputeRunState.idle && !_waitingToRunML) {
bool _requestStream([bool bypassMLWaiting = false]) {
if (_currentRunState == ComputeRunState.idle &&
(bypassMLWaiting || !_waitingToRunML)) {
_logger.info("Stream request granted");
_currentRunState = _ComputeRunState.generatingStream;
return true;
} else if (_currentRunState == _ComputeRunState.generatingStream &&
!_waitingToRunML) {
_currentRunState = ComputeRunState.generatingStream;
return true;
}
_logger.info(
"Stream request denied, current state: $_currentRunState, wants to run ML: $_waitingToRunML",
"Stream request denied, current state: $_currentRunState, wants to run ML: $_waitingToRunML, bypassMLWaiting: $bypassMLWaiting",
);
return false;
}
@@ -124,13 +148,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;
}
}
}
@@ -154,12 +178,25 @@ class ComputeController {
_fireControlEvent();
}
void blockCompute({required String blocker}) {
_computeBlocks.add(blocker);
_logger.info("Forcing to pauze compute due to: $blocker");
_fireControlEvent();
}
void unblockCompute({required String blocker}) {
_computeBlocks.remove(blocker);
_logger.info("removed blocker: $blocker, now blocked: $computeBlocked");
_fireControlEvent();
}
void _fireControlEvent() {
final shouldRunCompute = _isDeviceHealthy && _canRunGivenUserInteraction();
final shouldRunCompute =
_isDeviceHealthy && _canRunGivenUserInteraction() && !computeBlocked;
if (shouldRunCompute != _canRunCompute) {
_canRunCompute = shouldRunCompute;
_logger.info(
"Firing event: $shouldRunCompute (device health: $_isDeviceHealthy, user interaction: $_isUserInteracting, mlInteractionOverride: $interactionOverride)",
"Firing event: $shouldRunCompute (device health: $_isDeviceHealthy, user interaction: $_isUserInteracting, mlInteractionOverride: $interactionOverride, blockers: $_computeBlocks)",
);
Bus.instance.fire(ComputeControlEvent(shouldRunCompute));
}

View File

@@ -1,3 +1,4 @@
import "dart:io" show File;
import "dart:math" show max;
import "package:flutter/foundation.dart" show kDebugMode;
@@ -10,6 +11,7 @@ import "package:photos/extensions/stop_watch.dart";
import "package:photos/models/file/extensions/file_props.dart";
import 'package:photos/models/file/file.dart';
import "package:photos/models/similar_files.dart";
import "package:photos/services/favorites_service.dart";
import "package:photos/services/machine_learning/ml_computer.dart";
import "package:photos/services/machine_learning/ml_result.dart";
import "package:photos/services/search_service.dart";
@@ -257,6 +259,11 @@ class SimilarImagesService {
group.addFile(newFile);
group.furthestDistance = max(group.furthestDistance, distance);
group.files.sort((a, b) {
if (FavoritesService.instance.isFavoriteCache(a)) {
return -1;
} else if (FavoritesService.instance.isFavoriteCache(b)) {
return 1;
}
final sizeComparison =
(b.fileSize ?? 0).compareTo(a.fileSize ?? 0);
if (sizeComparison != 0) return sizeComparison;
@@ -307,6 +314,11 @@ class SimilarImagesService {
similarNewFiles.add(newFile);
alreadyUsedNewFiles.add(newFileID);
similarNewFiles.sort((a, b) {
if (FavoritesService.instance.isFavoriteCache(a)) {
return -1;
} else if (FavoritesService.instance.isFavoriteCache(b)) {
return 1;
}
final sizeComparison = (b.fileSize ?? 0).compareTo(a.fileSize ?? 0);
if (sizeComparison != 0) return sizeComparison;
return a.displayName.compareTo(b.displayName);
@@ -381,6 +393,11 @@ class SimilarImagesService {
}
// show highest quality files first
similarFilesList.sort((a, b) {
if (FavoritesService.instance.isFavoriteCache(a)) {
return -1;
} else if (FavoritesService.instance.isFavoriteCache(b)) {
return 1;
}
final sizeComparison = (b.fileSize ?? 0).compareTo(a.fileSize ?? 0);
if (sizeComparison != 0) return sizeComparison;
return a.displayName.compareTo(b.displayName);
@@ -434,6 +451,20 @@ class SimilarImagesService {
);
return cache;
}
Future<void> clearCache() async {
try {
final cachePath = await _getCachePath();
final file = File(cachePath);
if (await file.exists()) {
await file.delete();
_logger.info("Cleared similar files cache at $cachePath");
}
} catch (e, s) {
_logger.severe("Error clearing similar files cache", e, s);
rethrow;
}
}
}
bool setsAreEqual(Set<String> set1, Set<String> set2) {

View File

@@ -32,6 +32,7 @@ import "package:photos/service_locator.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";
@@ -120,9 +121,14 @@ class VideoPreviewService {
if (file.uploadedFileID == null) return false;
// Check if already in queue
final bool alreadyInQueue =
await uploadLocksDB.isInStreamQueue(file.uploadedFileID!);
final bool alreadyInQueue = await uploadLocksDB.isInStreamQueue(
file.uploadedFileID!,
);
if (alreadyInQueue) {
// File is already queued, but trigger processing in case it was stalled
if (uploadingFileId < 0) {
queueFiles(duration: Duration.zero, isManual: true, forceProcess: true);
}
return false; // Indicates file was already in queue
}
@@ -131,7 +137,7 @@ class VideoPreviewService {
// Start processing if not already processing
if (uploadingFileId < 0) {
queueFiles(duration: Duration.zero);
queueFiles(duration: Duration.zero, isManual: true);
} else {
_items[file.uploadedFileID!] = PreviewItem(
status: PreviewItemStatus.inQueue,
@@ -252,10 +258,12 @@ class VideoPreviewService {
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();
@@ -295,7 +303,8 @@ class VideoPreviewService {
"Starting video preview generation for ${enteFile.displayName}",
);
// elimination case for <=10 MB with H.264
var (props, result, file) = await _checkFileForPreviewCreation(enteFile);
var (props, result, file) =
await _checkFileForPreviewCreation(enteFile, isManual);
if (result) {
removeFile = true;
return;
@@ -575,8 +584,9 @@ class VideoPreviewService {
Future<void> _removeFromLocks(EnteFile enteFile) async {
final bool isFailurePresent =
_failureFiles?.contains(enteFile.uploadedFileID!) ?? false;
final bool isInManualQueue =
await uploadLocksDB.isInStreamQueue(enteFile.uploadedFileID!);
final bool isInManualQueue = await uploadLocksDB.isInStreamQueue(
enteFile.uploadedFileID!,
);
if (isFailurePresent) {
await uploadLocksDB.deleteStreamUploadErrorEntry(
@@ -917,27 +927,35 @@ class VideoPreviewService {
}
Future<(FFProbeProps?, bool, File?)> _checkFileForPreviewCreation(
EnteFile enteFile,
) async {
EnteFile enteFile, [
bool isManual = false,
]) async {
if ((enteFile.pubMagicMetadata?.sv ?? 0) == 1) {
_logger.info("Skip Preview due to sv=1 for ${enteFile.displayName}");
return (null, true, null);
}
if (enteFile.fileSize == null || enteFile.duration == null) {
_logger.warning(
"Skip Preview due to misisng size/duration for ${enteFile.displayName}",
);
return (null, true, null);
}
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");
return (null, true, null);
if (!isManual) {
if (enteFile.fileSize == null || enteFile.duration == null) {
_logger.warning(
"Skip Preview due to misisng size/duration for ${enteFile.displayName}",
);
return (null, true, null);
}
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");
return (null, true, null);
}
}
FFProbeProps? props;
File? file;
bool skipFile = false;
if (enteFile.fileSize == null && isManual) {
return (props, skipFile, file);
}
final size = enteFile.fileSize ?? 0;
try {
final isFileUnder10MB = size <= 10 * 1024 * 1024;
if (isFileUnder10MB) {
@@ -1025,8 +1043,9 @@ class VideoPreviewService {
}
// First try to find the file in the 60-day list
var queueFile =
files.firstWhereOrNull((f) => f.uploadedFileID == queueFileId);
var queueFile = files.firstWhereOrNull(
(f) => f.uploadedFileID == queueFileId,
);
// If not found in 60-day list, fetch it individually
queueFile ??=
@@ -1124,11 +1143,29 @@ class VideoPreviewService {
computeController.requestCompute(stream: true);
}
void queueFiles({Duration duration = const Duration(seconds: 5)}) {
Future.delayed(duration, () async {
if (_hasQueuedFile) return;
bool _allowManualStream() {
return isVideoStreamingEnabled &&
computeController.requestCompute(
stream: true,
bypassInteractionCheck: true,
bypassMLWaiting: true,
);
}
final isStreamAllowed = _allowStream();
bool _isPermissionGranted() {
return isVideoStreamingEnabled &&
computeController.computeState == ComputeRunState.generatingStream;
}
void queueFiles({
Duration duration = const Duration(seconds: 5),
bool isManual = false,
bool forceProcess = false,
}) {
Future.delayed(duration, () async {
if (_hasQueuedFile && !forceProcess) return;
final isStreamAllowed = isManual ? _allowManualStream() : _allowStream();
if (!isStreamAllowed) return;
await _ensurePreviewIdsInitialized();

View File

@@ -13,7 +13,12 @@ enum AppIcon {
iconGreen("Default", "IconGreen", "assets/launcher_icon/icon-green.png"),
iconLight("Light", "IconLight", "assets/launcher_icon/icon-light.png"),
iconDark("Dark", "IconDark", "assets/launcher_icon/icon-dark.png"),
iconOG("OG", "IconOG", "assets/launcher_icon/icon-og.png");
iconOG("OG", "IconOG", "assets/launcher_icon/icon-og.png"),
iconDuckyHuggingE(
"Ducky",
"IconDuckyHuggingE",
"assets/launcher_icon/icon-ducky-hugging-e.png",
);
final String name;
final String id;

View File

@@ -251,9 +251,12 @@ class _FreeUpSpaceOptionsScreenState extends State<FreeUpSpaceOptionsScreen> {
);
},
),
MenuSectionDescriptionWidget(
content: AppLocalizations.of(context)
.viewLargeFilesDesc,
Align(
alignment: Alignment.centerLeft,
child: MenuSectionDescriptionWidget(
content: AppLocalizations.of(context)
.viewLargeFilesDesc,
),
),
const SizedBox(
height: 24,

View File

@@ -22,6 +22,7 @@ import "package:photos/services/machine_learning/face_ml/person/person_service.d
import "package:photos/services/machine_learning/ml_indexing_isolate.dart";
import 'package:photos/services/machine_learning/ml_service.dart';
import "package:photos/services/machine_learning/semantic_search/semantic_search_service.dart";
import "package:photos/services/machine_learning/similar_images_service.dart";
import "package:photos/services/notification_service.dart";
import "package:photos/services/search_service.dart";
import "package:photos/src/rust/api/simple.dart";
@@ -83,6 +84,25 @@ class _MLDebugSectionWidgetState extends State<MLDebugSectionWidget> {
logger.info("Building ML Debug section options");
return Column(
children: [
sectionOptionSpacing,
MenuItemWidget(
captionedTextWidget: const CaptionedTextWidget(
title: "Clear vectorDB index",
),
pressedColor: getEnteColorScheme(context).fillFaint,
trailingIcon: Icons.chevron_right_outlined,
trailingIconIsMuted: true,
onTap: () async {
try {
await ClipVectorDB.instance.deleteIndexFile(undoMigration: true);
await SimilarImagesService.instance.clearCache();
showShortToast(context, 'Deleted vectorDB index');
} catch (e, s) {
logger.severe('vectorDB index delete failed ', e, s);
await showGenericErrorDialog(context: context, error: e);
}
},
),
sectionOptionSpacing,
MenuItemWidget(
captionedTextWidget: const CaptionedTextWidget(

View File

@@ -12,7 +12,6 @@ import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/common/loading_widget.dart";
import "package:photos/ui/common/web_page.dart";
import "package:photos/ui/components/buttons/button_widget.dart";
import "package:photos/ui/components/buttons/icon_button_widget.dart";
import "package:photos/ui/components/captioned_text_widget.dart";
import "package:photos/ui/components/menu_item_widget/menu_item_widget.dart";
import "package:photos/ui/components/models/button_type.dart";
@@ -49,7 +48,8 @@ class _VideoStreamingSettingsPageState
bottomNavigationBar: !hasEnabled
? SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.symmetric(horizontal: 16)
.copyWith(bottom: 20),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
@@ -75,15 +75,7 @@ class _VideoStreamingSettingsPageState
flexibleSpaceTitle: TitleBarTitleWidget(
title: AppLocalizations.of(context).videoStreaming,
),
actionIcons: [
IconButtonWidget(
icon: Icons.close_outlined,
iconButtonType: IconButtonType.secondary,
onTap: () {
Navigator.popUntil(context, (route) => route.isFirst);
},
),
],
actionIcons: const [],
isSliver: false,
),
),
@@ -96,17 +88,7 @@ class _VideoStreamingSettingsPageState
flexibleSpaceTitle: TitleBarTitleWidget(
title: AppLocalizations.of(context).videoStreaming,
),
actionIcons: [
IconButtonWidget(
icon: Icons.close_outlined,
iconButtonType: IconButtonType.secondary,
onTap: () {
Navigator.pop(context);
if (Navigator.canPop(context)) Navigator.pop(context);
if (Navigator.canPop(context)) Navigator.pop(context);
},
),
],
actionIcons: const [],
),
SliverToBoxAdapter(
child: Container(
@@ -118,7 +100,12 @@ class _VideoStreamingSettingsPageState
children: [
TextSpan(
text: AppLocalizations.of(context)
.videoStreamingDescription,
.videoStreamingDescriptionLine1,
),
const TextSpan(text: " "),
TextSpan(
text: AppLocalizations.of(context)
.videoStreamingDescriptionLine2,
),
const TextSpan(text: " "),
TextSpan(
@@ -131,7 +118,6 @@ class _VideoStreamingSettingsPageState
),
],
),
textAlign: TextAlign.justify,
style: getEnteTextTheme(context).mini.copyWith(
color: getEnteColorScheme(context).textMuted,
),
@@ -159,24 +145,34 @@ class _VideoStreamingSettingsPageState
height: 160,
),
const SizedBox(height: 16),
Text.rich(
TextSpan(
text: AppLocalizations.of(context)
.videoStreamingDescription +
" ",
children: [
TextSpan(
text: AppLocalizations.of(context).moreDetails,
style: TextStyle(
color: getEnteColorScheme(context).primary500,
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Text.rich(
TextSpan(
children: [
TextSpan(
text: AppLocalizations.of(context)
.videoStreamingDescriptionLine1,
),
recognizer: TapGestureRecognizer()
..onTap = openHelp,
),
],
const TextSpan(text: "\n"),
TextSpan(
text: AppLocalizations.of(context)
.videoStreamingDescriptionLine2,
),
const TextSpan(text: "\n"),
TextSpan(
text: AppLocalizations.of(context).moreDetails,
style: TextStyle(
color: getEnteColorScheme(context).primary500,
),
recognizer: TapGestureRecognizer()
..onTap = openHelp,
),
],
),
style: getEnteTextTheme(context).smallMuted,
textAlign: TextAlign.center,
),
style: getEnteTextTheme(context).smallMuted,
textAlign: TextAlign.center,
),
const SizedBox(height: 140),
],

File diff suppressed because it is too large Load Diff

View File

@@ -497,6 +497,7 @@ class FileAppBarState extends State<FileAppBar> {
final userId = Configuration.instance.getUserID();
return widget.file.fileType == FileType.video &&
widget.file.isUploaded &&
widget.file.fileSize != null &&
(widget.file.pubMagicMetadata?.sv ?? 0) != 1 &&
widget.file.ownerID == userId;
}

View File

@@ -7,23 +7,24 @@ import 'package:logging/logging.dart';
import 'package:photos/core/cache/thumbnail_in_memory_cache.dart';
import 'package:photos/core/constants.dart';
import 'package:photos/core/errors.dart';
import 'package:photos/core/exceptions.dart';
import 'package:photos/core/event_bus.dart';
import 'package:photos/db/files_db.dart';
import 'package:photos/db/trash_db.dart';
import 'package:photos/events/files_updated_event.dart';
import "package:photos/events/local_photos_updated_event.dart";
import "package:photos/models/api/collection/user.dart";
import "package:photos/models/file/extensions/file_props.dart";
import 'package:photos/events/local_photos_updated_event.dart';
import 'package:photos/models/api/collection/user.dart';
import 'package:photos/models/file/extensions/file_props.dart';
import 'package:photos/models/file/file.dart';
import 'package:photos/models/file/file_type.dart';
import 'package:photos/models/file/trash_file.dart';
import 'package:photos/services/collections_service.dart';
import 'package:photos/services/favorites_service.dart';
import 'package:photos/ui/viewer/file/file_icons_widget.dart';
import "package:photos/ui/viewer/gallery/component/group/type.dart";
import "package:photos/ui/viewer/gallery/state/gallery_context_state.dart";
import 'package:photos/ui/viewer/gallery/component/group/type.dart';
import 'package:photos/ui/viewer/gallery/state/gallery_context_state.dart';
import 'package:photos/utils/file_util.dart';
import "package:photos/utils/standalone/task_queue.dart";
import 'package:photos/utils/standalone/task_queue.dart';
import 'package:photos/utils/thumbnail_util.dart';
class ThumbnailWidget extends StatefulWidget {
@@ -307,8 +308,13 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
thumbnailSmallSize,
);
}).catchError((e) {
_logger.warning("Could not load thumbnail from disk: ", e);
_errorLoadingLocalThumbnail = true;
if (e is WidgetUnmountedException) {
// Widget was unmounted - this is expected behavior
_logger.fine("Thumbnail loading cancelled: widget unmounted");
} else {
_logger.warning("Could not load thumbnail from disk: ", e);
}
});
}
@@ -326,7 +332,7 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
}
//Do not retry if the widget is not mounted
if (!mounted) {
return null;
throw WidgetUnmountedException("Thumbnail loading cancelled: widget unmounted");
}
retryAttempts++;

View File

@@ -604,7 +604,6 @@ class GalleryState extends State<Gallery> {
? const NeverScrollableScrollPhysics()
: const ExponentialBouncingScrollPhysics(),
controller: _scrollController,
cacheExtent: galleryCacheExtent,
slivers: [
SliverToBoxAdapter(
child: SizeChangedLayoutNotifier(
@@ -642,25 +641,6 @@ class GalleryState extends State<Gallery> {
),
);
}
double get galleryCacheExtent {
final int photoGridSize = localSettings.getPhotoGridSize();
switch (photoGridSize) {
case 2:
case 3:
return 1000;
case 4:
return 850;
case 5:
return 600;
case 6:
return 300;
default:
throw StateError(
'Invalid photo grid size configuration: $photoGridSize',
);
}
}
}
class PinnedGroupHeader extends StatefulWidget {

View File

@@ -6,7 +6,6 @@ import "package:permission_handler/permission_handler.dart";
import "package:photos/db/upload_locks_db.dart";
import "package:photos/extensions/stop_watch.dart";
import "package:photos/main.dart";
import "package:photos/service_locator.dart";
import "package:photos/utils/file_uploader.dart";
import "package:shared_preferences/shared_preferences.dart";
import "package:workmanager/workmanager.dart" as workmanager;
@@ -81,7 +80,7 @@ class BgTaskUtils {
try {
await workmanager.Workmanager().initialize(
callbackDispatcher,
isInDebugMode: Platform.isIOS && flagService.internalUser,
isInDebugMode: false,
);
await workmanager.Workmanager().registerPeriodicTask(
backgroundTaskIdentifier,

View File

@@ -2165,6 +2165,22 @@ packages:
url: "https://github.com/KasemJaffer/receive_sharing_intent.git"
source: git
version: "1.8.1"
rive:
dependency: "direct main"
description:
name: rive
sha256: "2551a44fa766a7ed3f52aa2b94feda6d18d00edc25dee5f66e72e9b365bb6d6c"
url: "https://pub.dev"
source: hosted
version: "0.13.20"
rive_common:
dependency: transitive
description:
name: rive_common
sha256: "2ba42f80d37a4efd0696fb715787c4785f8a13361e8aea9227c50f1e78cf763a"
url: "https://pub.dev"
source: hosted
version: "0.4.15"
rust_lib_photos:
dependency: "direct main"
description:

View File

@@ -179,6 +179,7 @@ dependencies:
git:
url: https://github.com/KasemJaffer/receive_sharing_intent.git
ref: 2cea396
rive: ^0.13.20
rust_lib_photos:
path: rust_builder
screenshot: ^3.0.0

View File

@@ -32,7 +32,7 @@ impl VectorDB {
if file_exists {
println!("Loading index from disk.");
// Creates a view of the index from a file without loading it into memory. https://docs.rs/usearch/latest/usearch/struct.Index.html#method.view
// Use view to not load the index into memory. https://docs.rs/usearch/latest/usearch/struct.Index.html#method.view
db.index.view(file_path).expect("Failed to load index");
} else {
println!("Creating new index.");

View File

@@ -1,3 +1,10 @@
- Ashil: Revert diskLoadDeferDuration to 500ms
- Ashil: Revert increase in cache extent for gallery - to check if thumbnail not loading regression resolves
- Similar images design changes. Also changed the vectorDB index file name, so internal users will have another migration (long loading time).
- Ashil: New ducky icon in icon switcher
- Prateek: Enable immediate manual video stream processing by bypassing user interaction timer
- Prateek: Fix multiple concurrent streaming processes bug in ComputeController
- Prateek: Fix video streaming description text display spacing in advanced settings
- Ashil: Render cached thumbnails faster (noticeable in gallery scrolling)
- Similar images UI changes
- Neeraj: Fix for double enteries for local file

View File

@@ -1,3 +1,4 @@
- Video streaming improvements
- Added support for custom domain links
- Image editor fixes:
- Fixed bottom navigation bar color in light theme

View File

@@ -17,18 +17,22 @@ class Network {
late Dio _enteDio;
Future<void> init(BaseConfiguration configuration) async {
final String ua = await userAgent();
final bool isMobile = Platform.isAndroid || Platform.isIOS;
String? ua;
if (isMobile) {
ua = await userAgent();
}
final packageInfo = await PackageInfo.fromPlatform();
final version = packageInfo.version;
final packageName = packageInfo.packageName;
final endpoint = configuration.getHttpEndpoint();
final isMobile = Platform.isAndroid || Platform.isIOS;
_dio = Dio(
BaseOptions(
connectTimeout: Duration(milliseconds: kConnectTimeout),
headers: {
HttpHeaders.userAgentHeader: isMobile ? ua : Platform.operatingSystem,
HttpHeaders.userAgentHeader:
isMobile ? ua! : Platform.operatingSystem,
'X-Client-Version': version,
'X-Client-Package': packageName,
},
@@ -41,7 +45,7 @@ class Network {
connectTimeout: Duration(milliseconds: kConnectTimeout),
headers: {
if (isMobile)
HttpHeaders.userAgentHeader: ua
HttpHeaders.userAgentHeader: ua!
else
HttpHeaders.userAgentHeader: Platform.operatingSystem,
'X-Client-Version': version,

View File

@@ -685,7 +685,7 @@
"person_favorites": "{{name}} mėgstami",
"shared_favorites": "Bendrinami mėgstami",
"added_by_name": "Įtraukė {{name}}",
"unowned_files_not_processed": "Kiti naudotojai pridėti failai nebuvo apdoroti",
"unowned_files_not_processed": "Kitų naudotojų įtraukti failai nebuvo apdoroti",
"custom_domains": "Pasirinktiniai domenai",
"custom_domains_desc": "Naudokite savo domeną, kai bendrinate.",
"link_your_domain": "Susieti savo domeną",