mirror of
https://github.com/NotAShelf/stash.git
synced 2026-06-24 05:33:26 +00:00
various: validate lower and upper boundaries before storing; add CLI flags
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6484f9579a8799d952b15adcb47c8eec6a6a6964
This commit is contained in:
parent
02ba05dc95
commit
3a14860ae1
4 changed files with 68 additions and 33 deletions
|
|
@ -175,6 +175,7 @@ fn negotiate_mime_type(
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub trait WatchCommand {
|
||||
fn watch(
|
||||
&self,
|
||||
|
|
@ -183,6 +184,8 @@ pub trait WatchCommand {
|
|||
excluded_apps: &[String],
|
||||
expire_after: Option<Duration>,
|
||||
mime_type_preference: &str,
|
||||
min_size: Option<usize>,
|
||||
max_size: usize,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -194,6 +197,8 @@ impl WatchCommand for SqliteClipboardDb {
|
|||
excluded_apps: &[String],
|
||||
expire_after: Option<Duration>,
|
||||
mime_type_preference: &str,
|
||||
min_size: Option<usize>,
|
||||
max_size: usize,
|
||||
) {
|
||||
smol::block_on(async {
|
||||
log::info!(
|
||||
|
|
@ -349,6 +354,8 @@ impl WatchCommand for SqliteClipboardDb {
|
|||
max_dedupe_search,
|
||||
max_items,
|
||||
Some(excluded_apps),
|
||||
min_size,
|
||||
max_size,
|
||||
) {
|
||||
Ok(id) => {
|
||||
log::info!("Stored new clipboard entry (id: {id})");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue