mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-20 10:13:48 +01:00
refactor(photos): take the Gallery engine from crates.io
Replace the git revision pin on Proton Gallery with proton-gallery-rs and proton-gallery-app-rs 0.1.0 from the proton-rs workspace. This also moves the engine from 858d244 to b171232. The Nix package no longer needs to fetch from Git.
This commit is contained in:
1 parent
04f0713012
commit
24594b24ae
9 files changed
+96
-85
No files matched your search
Generated
+68
-63
@@ -3655,9 +3655,9 @@ dependencies = [
|
||||
"notify",
|
||||
"parking_lot 0.13.0",
|
||||
"pdfs-core",
|
||||
"pg-app",
|
||||
"pg-core",
|
||||
"proton-drive-rs",
|
||||
"proton-gallery-app-rs",
|
||||
"proton-gallery-rs",
|
||||
"rustix",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -3683,7 +3683,7 @@ dependencies = [
|
||||
"libadwaita",
|
||||
"pangocairo",
|
||||
"pdfs-core",
|
||||
"pg-core",
|
||||
"proton-gallery-rs",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -3708,65 +3708,6 @@ version = "2.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
|
||||
|
||||
[[package]]
|
||||
name = "pg-app"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/narrrl/proton-gallery.git?rev=858d2446f71214ec5357eb8b543d6b82abf47386#858d2446f71214ec5357eb8b543d6b82abf47386"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"hex",
|
||||
"pg-core",
|
||||
"pg-drive",
|
||||
"proton-drive-rs",
|
||||
"proton-sdk",
|
||||
"serde_json",
|
||||
"sha2 0.11.1",
|
||||
"tempfile",
|
||||
"thiserror 2.0.21",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pg-core"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/narrrl/proton-gallery.git?rev=858d2446f71214ec5357eb8b543d6b82abf47386#858d2446f71214ec5357eb8b543d6b82abf47386"
|
||||
dependencies = [
|
||||
"aes-gcm 0.11.1",
|
||||
"async-trait",
|
||||
"getrandom 0.4.3",
|
||||
"hex",
|
||||
"rusqlite",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.11.1",
|
||||
"tempfile",
|
||||
"thiserror 2.0.21",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pg-drive"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/narrrl/proton-gallery.git?rev=858d2446f71214ec5357eb8b543d6b82abf47386#858d2446f71214ec5357eb8b543d6b82abf47386"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"hex",
|
||||
"pg-core",
|
||||
"proton-drive-rs",
|
||||
"proton-sdk",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.11.1",
|
||||
"thiserror 2.0.21",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pgp"
|
||||
version = "0.21.0"
|
||||
@@ -3999,6 +3940,70 @@ dependencies = [
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proton-gallery-app-rs"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6d18d11266ab2be5ab2f4b4040941caf2736c257e13909af7be8ea331892d59"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"futures-util",
|
||||
"hex",
|
||||
"proton-drive-rs",
|
||||
"proton-gallery-drive-rs",
|
||||
"proton-gallery-rs",
|
||||
"proton-sdk",
|
||||
"serde_json",
|
||||
"sha2 0.11.1",
|
||||
"tempfile",
|
||||
"thiserror 2.0.21",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proton-gallery-drive-rs"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "535a14f63fd542701d2606acb971d4a7e8f235ca7b9439fea8c80a3f26110186"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"hex",
|
||||
"proton-drive-rs",
|
||||
"proton-gallery-rs",
|
||||
"proton-sdk",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.11.1",
|
||||
"thiserror 2.0.21",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proton-gallery-rs"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3a1159db137629675b0c91a75fa4b2b416a4ef306127e70bad8039c372855cd3"
|
||||
dependencies = [
|
||||
"aes-gcm 0.11.1",
|
||||
"async-trait",
|
||||
"getrandom 0.4.3",
|
||||
"hex",
|
||||
"kamadak-exif",
|
||||
"rusqlite",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.11.1",
|
||||
"tempfile",
|
||||
"thiserror 2.0.21",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proton-sdk"
|
||||
version = "0.12.1"
|
||||
@@ -5139,7 +5144,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"getrandom 0.3.4",
|
||||
"getrandom 0.4.3",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
"windows-sys 0.61.2",
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@ categories = ["filesystem", "command-line-utilities"]
|
||||
[workspace.dependencies]
|
||||
proton-sdk = { version = "0.12.1" }
|
||||
proton-drive-rs = { version = "0.12.1" }
|
||||
pg-app = { git = "https://github.com/narrrl/proton-gallery.git", rev = "858d2446f71214ec5357eb8b543d6b82abf47386" }
|
||||
pg-core = { git = "https://github.com/narrrl/proton-gallery.git", rev = "858d2446f71214ec5357eb8b543d6b82abf47386" }
|
||||
proton-gallery-app-rs = "0.1.0"
|
||||
proton-gallery-rs = "0.1.0"
|
||||
chrono = { version = "0.4", default-features = false, features = ["std"] }
|
||||
|
||||
# Internal crates.
|
||||
|
||||
@@ -14,8 +14,8 @@ pdfs-core.workspace = true
|
||||
zip.workspace = true
|
||||
sha1.workspace = true
|
||||
proton-drive-rs.workspace = true
|
||||
pg-app.workspace = true
|
||||
pg-core.workspace = true
|
||||
proton-gallery-app-rs.workspace = true
|
||||
proton-gallery-rs.workspace = true
|
||||
hyper = { version = "1", features = ["http1", "server"] }
|
||||
hyper-util = { version = "0.1", features = ["tokio"] }
|
||||
http-body-util = "0.1"
|
||||
|
||||
@@ -14,10 +14,10 @@ use pdfs_core::control::{
|
||||
GalleryAction, GalleryAlbum, GalleryFolder, GalleryPlace, PhotoItem, PhotoKind, Response,
|
||||
};
|
||||
use pdfs_core::{CoreError, CoreResult};
|
||||
use pg_app::{App, View};
|
||||
use pg_core::CancellationToken;
|
||||
use pg_core::model::{AssetKey, SourceId};
|
||||
use proton_drive_rs::proton_sdk::session::ProtonApiSession;
|
||||
use proton_gallery_app_rs::{App, View};
|
||||
use proton_gallery_rs::CancellationToken;
|
||||
use proton_gallery_rs::model::{AssetKey, SourceId};
|
||||
use tokio::sync::{Mutex, Notify, OnceCell};
|
||||
|
||||
use super::{Core, NodeUid, parse_uid};
|
||||
@@ -187,8 +187,9 @@ impl Gallery {
|
||||
Ok(Arc::new(visibility))
|
||||
}
|
||||
|
||||
fn account(&self) -> CoreResult<pg_core::model::AccountId> {
|
||||
pg_core::model::AccountId::new(self.session.user_id().as_str()).map_err(gallery_error)
|
||||
fn account(&self) -> CoreResult<proton_gallery_rs::model::AccountId> {
|
||||
proton_gallery_rs::model::AccountId::new(self.session.user_id().as_str())
|
||||
.map_err(gallery_error)
|
||||
}
|
||||
|
||||
async fn page(
|
||||
@@ -345,13 +346,15 @@ impl Gallery {
|
||||
fn asset(&self, uid: &NodeUid) -> CoreResult<AssetKey> {
|
||||
Ok(AssetKey {
|
||||
account: self.account()?,
|
||||
volume: pg_core::model::VolumeId::new(uid.volume_id.as_str()).map_err(gallery_error)?,
|
||||
node: pg_core::model::NodeId::new(uid.link_id.as_str()).map_err(gallery_error)?,
|
||||
volume: proton_gallery_rs::model::VolumeId::new(uid.volume_id.as_str())
|
||||
.map_err(gallery_error)?,
|
||||
node: proton_gallery_rs::model::NodeId::new(uid.link_id.as_str())
|
||||
.map_err(gallery_error)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fn gallery_album(entry: pg_core::library::Album, proton: bool) -> GalleryAlbum {
|
||||
fn gallery_album(entry: proton_gallery_rs::library::Album, proton: bool) -> GalleryAlbum {
|
||||
GalleryAlbum {
|
||||
place: GalleryPlace {
|
||||
gallery: entry.gallery.to_string(),
|
||||
@@ -444,7 +447,7 @@ impl Core {
|
||||
"Use your Linux sign-in to unlock Hidden albums.",
|
||||
));
|
||||
}
|
||||
let subject = pg_app::desktop_auth::Subject::new(
|
||||
let subject = proton_gallery_app_rs::desktop_auth::Subject::new(
|
||||
peer.pid.as_raw_nonzero().get() as u32,
|
||||
peer.uid.as_raw(),
|
||||
)
|
||||
|
||||
@@ -11,8 +11,8 @@ use hyper::{
|
||||
};
|
||||
use hyper_util::rt::TokioIo;
|
||||
use pdfs_core::{CoreResult, control::Response as ControlResponse};
|
||||
use pg_app::video::VideoStream;
|
||||
use pg_core::CancellationToken;
|
||||
use proton_gallery_app_rs::video::VideoStream;
|
||||
use proton_gallery_rs::CancellationToken;
|
||||
use tokio::net::TcpListener;
|
||||
|
||||
type Body = UnsyncBoxBody<Bytes, io::Error>;
|
||||
|
||||
@@ -22,7 +22,7 @@ name = "pdfs-prompt"
|
||||
path = "src/prompt.rs"
|
||||
|
||||
[dependencies]
|
||||
pg-core.workspace = true
|
||||
proton-gallery-rs.workspace = true
|
||||
base64.workspace = true
|
||||
pdfs-core.workspace = true
|
||||
tracing.workspace = true
|
||||
|
||||
@@ -2360,7 +2360,7 @@ const TILE_RATIO_MAX: f64 = 2.5;
|
||||
/// The shape a photo's tile takes: its own, clamped, or square while the
|
||||
/// daemon has not seen a thumbnail of it yet.
|
||||
pub(crate) fn tile_ratio(ratio: Option<f64>) -> f64 {
|
||||
pg_core::grid::tile_ratio(ratio.unwrap_or(1.0))
|
||||
proton_gallery_rs::grid::tile_ratio(ratio.unwrap_or(1.0))
|
||||
}
|
||||
|
||||
/// The justified layout math: tiles of the given shapes, in order, broken into
|
||||
@@ -2373,7 +2373,7 @@ pub(crate) fn tile_ratio(ratio: Option<f64>) -> f64 {
|
||||
/// two photos from one day stay two photos at the target height, not two
|
||||
/// photos as tall as the window.
|
||||
pub(crate) fn plan_justified(ratios: &[f64], width: i32, target: i32) -> Vec<Vec<(i32, i32)>> {
|
||||
let Ok(grid) = pg_core::grid::plan_sections(
|
||||
let Ok(grid) = proton_gallery_rs::grid::plan_sections(
|
||||
ratios,
|
||||
&[],
|
||||
width.clamp(1, 32_768) as u32,
|
||||
|
||||
@@ -11,6 +11,12 @@ scratch (user data in `staging/` and `recovery/` is never touched by this).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- The shared Gallery engine now comes from the `proton-gallery-rs` and
|
||||
`proton-gallery-app-rs` crates on crates.io instead of a pinned Git revision of
|
||||
Proton Gallery. Builds, vendoring and the Nix package no longer fetch from Git.
|
||||
|
||||
## [3.9.0] — 2026-11-19
|
||||
|
||||
Schema: **46**. Photos adds a local database migration for incremental metadata sync.
|
||||
|
||||
@@ -46,10 +46,7 @@ rustPlatform.buildRustPackage {
|
||||
];
|
||||
};
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ../../Cargo.lock;
|
||||
allowBuiltinFetchGit = true;
|
||||
};
|
||||
cargoLock.lockFile = ../../Cargo.lock;
|
||||
|
||||
cargoBuildFlags = [
|
||||
"--bin"
|
||||
|
||||
Reference in new issue
Block a user