Commit Graph

41836 Commits

Author SHA1 Message Date
Manav Rathi
65a8923799 Conv 2025-06-04 18:53:14 +05:30
Manav Rathi
e6707d9fcb Move 2025-06-04 18:43:05 +05:30
Manav Rathi
3dbc336687 Doc 2025-06-04 18:36:49 +05:30
Manav Rathi
8441aafe81 Inline 2025-06-04 18:26:53 +05:30
Manav Rathi
5d3f431ee0 Doc 2025-06-04 18:25:28 +05:30
Manav Rathi
ce591e6267 Conv 2025-06-04 18:11:28 +05:30
Manav Rathi
86f282bb06 Scope 2025-06-04 17:36:50 +05:30
Manav Rathi
334a996357 Scope 2025-06-04 17:27:46 +05:30
Manav Rathi
9a5bac774e Unused 2025-06-04 17:24:08 +05:30
Manav Rathi
04ae02c130 [meta] Issue template (#6166) 2025-06-04 17:13:41 +05:30
Manav Rathi
31232390e8 [meta] Issue template 2025-06-04 17:07:03 +05:30
Manav Rathi
e80f91ca92 [web] General refactoring (#6164) 2025-06-04 16:42:28 +05:30
Manav Rathi
523d1961b7 other dep 2025-06-04 16:32:08 +05:30
Manav Rathi
6091a0d446 Lockfile updates 2025-06-04 16:28:33 +05:30
Manav Rathi
12d84d0dbe Avoid exceptions for flow control 2025-06-04 16:27:24 +05:30
Manav Rathi
a244140348 tweak 2025-06-04 16:27:24 +05:30
Manav Rathi
2715bd81b0 vis 2025-06-04 16:27:24 +05:30
Manav Rathi
d65424cef2 Document and move 2025-06-04 16:27:24 +05:30
Manav Rathi
a07d39512b Prune ids 2025-06-04 16:27:24 +05:30
Manav Rathi
223ed36d61 Conv 2025-06-04 16:27:24 +05:30
Neeraj
3e893a7b39 [mob] Use file stream to improve hashing speed (#6163)
## Description

## Tests
For 3.38 GB file on iPhone 11
Old Hashing took 24792 ms
Hashing v2 took 10365 ms

Also tested it on a smaller file

```dart
// Returns the hash for a given file, chunking it in batches of hashChunkSize
Future<Uint8List> cryptoGenericHash(Map<String, dynamic> args) async {
  final int startTime = DateTime.now().millisecondsSinceEpoch;
  final sourceFile = File(args["sourceFilePath"]);
  final sourceFileLength = await sourceFile.length();
  final inputFile = sourceFile.openSync(mode: FileMode.read);
  final state =
      Sodium.cryptoGenerichashInit(null, Sodium.cryptoGenerichashBytesMax);
  var bytesRead = 0;
  bool isDone = false;
  while (!isDone) {
    var chunkSize = hashChunkSize;
    if (bytesRead + chunkSize >= sourceFileLength) {
      chunkSize = sourceFileLength - bytesRead;
      isDone = true;
    }
    final buffer = await inputFile.read(chunkSize);
    bytesRead += chunkSize;
    Sodium.cryptoGenerichashUpdate(state, buffer);
  }
  await inputFile.close();
  final hash =
      Sodium.cryptoGenerichashFinal(state, Sodium.cryptoGenerichashBytesMax);

  final int endTime = DateTime.now().millisecondsSinceEpoch;
  final hash2 = await cryptoGenericHashV2(args);
  final endTime2 = DateTime.now().millisecondsSinceEpoch;
  if (hash.length != hash2.length) {
    throw Exception(
      "Hash length mismatch: ${hash.length} != ${hash2.length}",
    );
  }
  if (!const ListEquality().equals(hash, hash2)) {
    throw Exception("not equal: hash");
  }
  print("Hashing took ${endTime2 - startTime} ms");
  print("Hashing v2 took ${endTime2 - endTime} ms");
  return hash;
}

Future<Uint8List> cryptoGenericHashV2(Map<String, dynamic> args) async {
  final file = File(args["sourceFilePath"]);
  final state =
      Sodium.cryptoGenerichashInit(null, Sodium.cryptoGenerichashBytesMax);
  await for (final chunk in file.openRead()) {
    Sodium.cryptoGenerichashUpdate(state, Uint8List.fromList(chunk));
  }
  return Sodium.cryptoGenerichashFinal(state, Sodium.cryptoGenerichashBytesMax);
}
```
2025-06-04 14:33:47 +05:30
Neeraj
eea70db1fd Avoid redundant copy
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-04 14:31:51 +05:30
Neeraj Gupta
85c14b884b [mob] Use file stream to improve hashing speed 2025-06-04 13:43:01 +05:30
Neeraj
15954ce396 [mob] Remember last scroll offset while adding assets from device (#6159)
## Description
Also increased the items in grid, as there's no scrollbar (pkg does not
support it yet afaik)

## Tests
2025-06-04 12:24:32 +05:30
Laurens Priem
86a9e5ec86 [mob][photos] Compute controller (#6158)
## Description

Refactored MLController (now ComputeController) so that ML and Streaming
both first have to ask for its permission to run.

## Tests
2025-06-04 12:02:57 +05:30
Manav Rathi
52c9a15c2c [web] Migrate to zod v4 (#6162) 2025-06-04 11:58:00 +05:30
Manav Rathi
3c514476c2 Reintroduce with new zod 2025-06-04 11:53:49 +05:30
laurenspriem
31b26a1b26 Reduce logs 2025-06-04 11:52:33 +05:30
Manav Rathi
5e26a895d3 passthrough => looseObject
https://zod.dev/v4/changelog?id=deprecates-strict-and-passthrough
2025-06-04 11:45:12 +05:30
Manav Rathi
4b4d9d0fd8 Migrate
https://zod.dev/v4/changelog
2025-06-04 11:45:12 +05:30
laurenspriem
a4f49b8e84 Try trigger streaming when ML is done 2025-06-04 11:11:21 +05:30
Neeraj
1722277141 [mobile] New translations (#6125)
New translations from
[Crowdin](https://crowdin.com/project/ente-photos-app)
2025-06-04 11:02:00 +05:30
Manav Rathi
6a6547a984 Up 2025-06-04 11:01:41 +05:30
Manav Rathi
4c78d1ab78 [web] Convert more cases of deprecated single input form (#6160) 2025-06-04 10:58:03 +05:30
Neeraj
8cd87b964a [photos][mob] Trim whitespace from search query (#6153)
## Description

Previously, when searching for e.g. `test ` would not find an album
called `test`. That's because the trailing whitespace is not ignored. On
mobile this can be especially annoying because sometimes auto-completion
automatically inserts whitespace after a word.

This patch trims whitespace of the search query in two places:
* When searching for an album name when moving photos to an album.
* When using the global search.

## Tests
2025-06-04 10:52:40 +05:30
Manav Rathi
68844eb790 Try to retain similar DOM structure as before 2025-06-04 10:52:18 +05:30
Neeraj Gupta
b24b0d340b Remember last scrollOffset while picking asset from device 2025-06-04 10:50:06 +05:30
Neeraj Gupta
47e8ccd5d8 Update asset_picker pkg 2025-06-04 10:49:41 +05:30
Manav Rathi
e0ae9eb911 vis 2025-06-04 10:48:12 +05:30
laurenspriem
c8d53faa5d Don't queue streaming if controller doesn't allow 2025-06-04 10:44:44 +05:30
laurenspriem
b494dc8cad Allow multiple request calls 2025-06-04 10:44:19 +05:30
Manav Rathi
5d3acca7ed Conv 2025-06-04 10:39:40 +05:30
laurenspriem
d6ea8d4ec3 less loging 2025-06-04 10:30:22 +05:30
Manav Rathi
1850aa1aec ref uploader name 2025-06-04 10:15:11 +05:30
laurenspriem
42239fe30d don't stop on force 2025-06-04 10:14:14 +05:30
Neeraj
35f6dc2361 [mob] Switch to exif_reader (#6154) 2025-06-04 10:01:35 +05:30
Manav Rathi
bbfae3731a Swap 2025-06-04 09:21:35 +05:30
Manav Rathi
d99b3e422b Change default to the more frequently needed value 2025-06-04 09:14:52 +05:30
Manav Rathi
5fe497df3b Swap 2025-06-04 09:06:28 +05:30
Manav Rathi
2e5deda9ae [web] Reset cast dialog view on reopen (#6157) 2025-06-04 08:54:05 +05:30