Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Move map clustering into ente-location

Neeraj Gupta982343587fe6
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index d7722db5a5..f4f102e9e0 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -2618,6 +2618,10 @@ dependencies = [
"wasm-bindgen-futures",
]
+[[package]]
+name = "ente-location"
+version = "0.0.0"
+
[[package]]
name = "ente-locker-frb"
version = "0.0.0"
@@ -2721,6 +2725,7 @@ dependencies = [
"ente-core",
"ente-frb-log",
"ente-image",
+ "ente-location",
"ente-ml",
"ente-photos",
"flutter_rust_bridge",
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index ccdf8b886f..93c4953006 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -29,6 +29,7 @@ members = [
"crates/ensu-crypto",
"crates/image",
"crates/legacy",
+ "crates/location",
"crates/ml",
"crates/paste",
"crates/photos",
@@ -47,6 +48,7 @@ ente-ensu-crypto = { path = "crates/ensu-crypto" }
ente-frb-log = { path = "bindings/frb/log" }
ente-image = { path = "crates/image" }
ente-legacy = { path = "crates/legacy" }
+ente-location = { path = "crates/location" }
ente-ml = { path = "crates/ml" }
ente-paste = { path = "crates/paste" }
ente-photos = { path = "crates/photos" }
diff --git a/rust/bindings/frb/photos/Cargo.toml b/rust/bindings/frb/photos/Cargo.toml
index c8fca1e7f5..4fba03dc39 100644
--- a/rust/bindings/frb/photos/Cargo.toml
+++ b/rust/bindings/frb/photos/Cargo.toml
@@ -11,6 +11,7 @@ ente-contacts.workspace = true
ente-core.workspace = true
ente-frb-log.workspace = true
ente-image.workspace = true
+ente-location.workspace = true
ente-ml = { workspace = true, features = ["usearch"] }
ente-photos.workspace = true
flutter_rust_bridge.workspace = true
diff --git a/rust/bindings/frb/photos/src/api/map_cluster_api.rs b/rust/bindings/frb/photos/src/api/map_cluster_api.rs
index e3272cb09d..250193d6e5 100644
--- a/rust/bindings/frb/photos/src/api/map_cluster_api.rs
+++ b/rust/bindings/frb/photos/src/api/map_cluster_api.rs
@@ -1,4 +1,4 @@
-use ente_photos::map_cluster as core;
+use ente_location::cluster as core;
use flutter_rust_bridge::frb;
pub struct MapPoint {
diff --git a/rust/crates/location/Cargo.toml b/rust/crates/location/Cargo.toml
new file mode 100644
index 0000000000..ede06ca01e
--- /dev/null
+++ b/rust/crates/location/Cargo.toml
@@ -0,0 +1,3 @@
+[package]
+name = "ente-location"
+edition = "2024"
diff --git a/rust/crates/photos/src/map_cluster.rs b/rust/crates/location/src/cluster.rs
similarity index 99%
rename from rust/crates/photos/src/map_cluster.rs
rename to rust/crates/location/src/cluster.rs
index 706e33c9f1..ae4c97980f 100644
--- a/rust/crates/photos/src/map_cluster.rs
+++ b/rust/crates/location/src/cluster.rs
@@ -209,3 +209,4 @@ fn add_to_marker_group(
groups.push(ProjectedMarkerGroup::new(point));
groups_by_cell.entry(cell).or_default().push(group_index);
}
+
diff --git a/rust/crates/location/src/lib.rs b/rust/crates/location/src/lib.rs
new file mode 100644
index 0000000000..f7b48702af
--- /dev/null
+++ b/rust/crates/location/src/lib.rs
@@ -0,0 +1 @@
+pub mod cluster;
diff --git a/rust/crates/photos/src/lib.rs b/rust/crates/photos/src/lib.rs
index c36484458a..156da6c8ed 100644
--- a/rust/crates/photos/src/lib.rs
+++ b/rust/crates/photos/src/lib.rs
@@ -1,4 +1,3 @@
-pub mod map_cluster;
pub mod motion_photo;
pub use motion_photo::{