💚 End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Merge main into cli-places
laurenspriemff1c6f77cabc
diff --cc docs/docs/cli/photos.mdindex 4932687fd7,ba05bf955a..dd15499b81--- a/docs/docs/cli/photos.md+++ b/docs/docs/cli/photos.md@@@ -107,21 -107,26 +107,41 @@@ ente photos file list --type video --miA file must match every filter you pass. `--sort created` lists the newest files first and `--sort size` the largest first; add `--reverse` for the opposite order. Files with an unknown size sort as the smallest, and ties keep ID order. Without `--sort`, files are listed by ID.+## Find files by place++```sh+ente photos place list+ente photos place list --countries --album Holidays+ente photos file list --place lisbon+ente photos file list --country JP --type video+```++`place list` shows the cities where your files were taken, with the number of files in each, most first. `--countries` lists countries instead. Places come from each file's location; files without one are not counted. Locations that match no city or country in the dataset are omitted from that list, so city and country totals can differ. Country filters use the groups shown by `place list --countries`, which can differ from a city's country. For example, photos in French Guiana count under France.++`--place` keeps files taken in a city whose name contains the given text. When one of the cities `place list` shows for the same `--album` has exactly that name, only cities with that name match, so `--place nice` leaves out Venice. `--country` takes a two-letter code such as `PT`, or a full English country name, which matches only that country, so `--country niger` leaves out Nigeria; other text matches every country whose name contains it. `UK` also works for the United Kingdom, whose code is `GB`, and an unknown two-letter code is an error. Both ignore case and accent marks, and combine with the other filters. Type letters such as ł or ø as `place list` shows them: `--place wrocław` finds Wrocław, but `--place wroclaw` does not.++The first time you use places, the CLI downloads about 7 MB of location data from Ente (`assets.ente.com`) and keeps it with the account's local data. After that, places work with `--offline`. The location data is adapted from [GeoNames](https://www.geonames.org/) and the European Commission Joint Research Centre's [GHS-UCDB R2024A](https://doi.org/10.2905/1a338be6-7eaf-480c-9664-3a8ade88cbcd), both under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), and from [Natural Earth](https://www.naturalearthdata.com/), which is in the public domain.++ ## Check storage and file count++ ```sh+ ente photos usage+ ```++ ```+ Email [email protected]+ Total 20 GB+ Used 3.61 GB+ Free 16.39 GB+ Plan 10 GB+ Status active+ Bonus 10 GB+ Files 339+ Family none+ ```++ `Total` is the plan plus bonuses such as referrals, `Used` and `Files` are what Photos holds, and `Status` says whether the plan is active or expired. In a family the plan and total are the family admin's, and `Family` lists its members, followed by the shared totals and your own limit when the admin has set one.+## Read as JSONLists return arrays and `view` returns one object. IDs are strings; timestamps are RFC 3339 strings in UTC.@@@ -131,13 -136,12 +151,14 @@@| `album list`, `album view` | `id`, `name`, `type` (`album`, `folder`, `favorites`, `uncategorized`, `defaultHidden`, `quicklink`), `visibility` (`visible`, `archived`, `hidden`), `ownerId`, `updatedAt` || `file list`, `file view` | `id`, `name`, `type` (`image`, `video`, `livephoto`), `ownerId`, `albumIds`, `createdAt`, `updatedAt`; nullable `modifiedAt`, `location` (`latitude`, `longitude`), `caption`, `hash`, `dateTime`, `offsetTime`, `visibility`, `durationSeconds`, `width`, `height`, `sizeBytes` || `file download` | `id`, `output`, `bytes` |-| `usage` | `email`, `planExpiresAt`, `planActive`, `totalBytes`, `usedBytes`, `freeBytes`, `planBytes`, `bonusBytes`; nullable `files`, `family` (`usedBytes`, `storageBytes`, `members`: `email`, `status`, `admin`, `usedBytes`, `storageLimitBytes`) |+| `place list` | `name`, `country`, `countryCode`, `latitude` and `longitude` (the city's position), `fileCount` |+| `place list --countries` | `name`, `code`, `fileCount` |++| `usage` | `email`, `planExpiresAt`, `planActive`, `totalBytes`, `usedBytes`, `freeBytes`, `planBytes`, `bonusBytes`; nullable `files`, `family` (`usedBytes`, `storageBytes`, `members`: `email`, `status`, `admin`, `usedBytes`, `storageLimitBytes`) || `export` | See [Automation](./automation.md#export-summary) |## Read offline- `album list`, `album view`, `file list`, `file view` and `place list` work with `--offline` using the metadata an earlier online run synced. An online `album list` syncs albums only; run `file list` online for each album whose files you want to read offline. Places also need the location data that an earlier online `place list`, `--place` or `--country` downloaded. Export and download need the network.-`album list`, `album view`, `file list` and `file view` work with `--offline` using the metadata an earlier online run synced. An online `album list` syncs albums only; run `file list` online for each album whose files you want to read offline. Export, download and usage need the network.++`album list`, `album view`, `file list`, `file view` and `place list` work with `--offline` using the metadata an earlier online run synced. An online `album list` syncs albums only; run `file list` online for each album whose files you want to read offline. Places also need the location data that an earlier online `place list`, `--place` or `--country` downloaded. Export, download and usage need the network.## Limitsdiff --cc rust/apps/cli/src/output.rsindex 30bef2d946,fa2ba55d3b..e3400f7bb6--- a/rust/apps/cli/src/output.rs+++ b/rust/apps/cli/src/output.rs@@@ -3,8 -3,10 +3,11 @@@ use std::{fmt::Display, io::Write}use anyhow::{Context, Result, bail};use chrono::{DateTime, SecondsFormat};use dialoguer::console::{Alignment, measure_text_width, pad_str};- use ente_accounts::admin::{Subscription, User, UserDetails};+ use ente_accounts::{+ admin::{Subscription, User, UserDetails},+ details::AccountDetails,+ };+use ente_location::{CityMatch, CountryGroup};use ente_photos::{collections::{Collection, Visibility},files::File,diff --cc rust/apps/cli/src/photos/mod.rsindex ffb4801bf9,05a9280332..c94b4ec96a--- a/rust/apps/cli/src/photos/mod.rs+++ b/rust/apps/cli/src/photos/mod.rs@@@ -53,29 -50,10 +55,29 @@@ pub async fn run(command: PhotosCommand);}match command {- PhotosCommand::Api(_) | PhotosCommand::Export(_) => unreachable!(),+ PhotosCommand::Api(_) | PhotosCommand::Export(_) | PhotosCommand::Usage => unreachable!(),PhotosCommand::Album { command } => album(command, &replica, options),PhotosCommand::File { album, command } => {- file(command, album.as_deref(), &session, &mut replica, options).await+ file(+ command,+ album.as_deref(),+ &session,+ &mut replica,+ &home.path,+ options,+ )+ .await+ }+ PhotosCommand::Place { album, command } => {+ place(+ command,+ album.as_deref(),+ &session,+ &mut replica,+ &home.path,+ options,+ )+ .await}}}