mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-11-20 11:21:14 +00:00
Fix store delegation for public_url
This commit is contained in:
parent
786f583d98
commit
4d78ce7689
3 changed files with 14 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,6 +4,7 @@
|
|||
/client-examples/javascript/node_modules
|
||||
/docker/object-storage/storage
|
||||
/docker/object-storage/pict-rs-garage.toml
|
||||
/docker/object-storage/*.log
|
||||
/result
|
||||
/.ash_history
|
||||
/.direnv
|
||||
|
|
12
src/store.rs
12
src/store.rs
|
@ -94,9 +94,7 @@ pub(crate) trait Store: Clone + Debug {
|
|||
content_type: mime::Mime,
|
||||
) -> Result<Self::Identifier, StoreError>;
|
||||
|
||||
fn public_url(&self, _: &Self::Identifier) -> Option<url::Url> {
|
||||
None
|
||||
}
|
||||
fn public_url(&self, _: &Self::Identifier) -> Option<url::Url>;
|
||||
|
||||
async fn to_stream(
|
||||
&self,
|
||||
|
@ -160,6 +158,10 @@ where
|
|||
T::save_bytes(self, bytes, content_type).await
|
||||
}
|
||||
|
||||
fn public_url(&self, identifier: &Self::Identifier) -> Option<url::Url> {
|
||||
T::public_url(self, identifier)
|
||||
}
|
||||
|
||||
async fn to_stream(
|
||||
&self,
|
||||
identifier: &Self::Identifier,
|
||||
|
@ -231,6 +233,10 @@ where
|
|||
T::save_bytes(self, bytes, content_type).await
|
||||
}
|
||||
|
||||
fn public_url(&self, identifier: &Self::Identifier) -> Option<url::Url> {
|
||||
T::public_url(self, identifier)
|
||||
}
|
||||
|
||||
async fn to_stream(
|
||||
&self,
|
||||
identifier: &Self::Identifier,
|
||||
|
|
|
@ -109,6 +109,10 @@ impl Store for FileStore {
|
|||
Ok(self.file_id_from_path(path)?)
|
||||
}
|
||||
|
||||
fn public_url(&self, _identifier: &Self::Identifier) -> Option<url::Url> {
|
||||
None
|
||||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
async fn to_stream(
|
||||
&self,
|
||||
|
|
Loading…
Reference in a new issue