Skip to content

Commit

Permalink
avoid obsolete singlejpeg ffmpeg format; appease clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
dicej committed Dec 24, 2024
1 parent 1f7120c commit cf2faa5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions server/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn hash_password(salt: &[u8], secret: &[u8]) -> String {
&mut hash,
);

base64::encode(&hash)
base64::encode(hash)
}

/// Attempt to authenticate a user based on the credentials specified in `request`.
Expand All @@ -47,8 +47,8 @@ pub fn hash_password(salt: &[u8], secret: &[u8]) -> String {
/// * `mutex`: used to bottleneck all calls to this method in order to mitigate parallel brute force attacks
///
/// * `invalid_credential_delay`: minimum delay added to responses to invalid authentication requests. Note that
/// these delays will stack up if invalid requests are received more often than once per this interval, so the
/// actual delay experienced by a given request may be much longer.
/// these delays will stack up if invalid requests are received more often than once per this interval, so the
/// actual delay experienced by a given request may be much longer.
pub async fn authenticate(
conn: &AsyncMutex<SqliteConnection>,
request: &TokenRequest,
Expand Down
8 changes: 4 additions & 4 deletions server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ fn response() -> response::Builder {
/// * `conn`: used to access the Tagger database
///
/// * `image_locks`: used to control concurrent access to the cache directory, e.g. to avoid simultaneous reads and
/// writes to cache files
/// writes to cache files
///
/// * `options`: server configuration -- see [Options] for details
///
Expand Down Expand Up @@ -937,7 +937,7 @@ mod test {
let response = warp::test::request()
.method("POST")
.path("/token")
.body(&format!(
.body(format!(
"grant_type=password&username={user}&password=invalid+password"
))
.reply(&routes)
Expand All @@ -952,7 +952,7 @@ mod test {
let response = warp::test::request()
.method("POST")
.path("/token")
.body(&format!(
.body(format!(
"grant_type=password&username={user}&password={password}"
))
.reply(&routes)
Expand Down Expand Up @@ -2830,7 +2830,7 @@ mod test {
.arg("-frames:v")
.arg("1")
.arg("-f")
.arg("singlejpeg")
.arg("mjpeg")
.arg("-")
.output()
.await?;
Expand Down
7 changes: 3 additions & 4 deletions server/src/media.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ async fn still_image(image_dir: &str, path: &str) -> Result<(Vec<u8>, ImageForma
.arg("-frames:v")
.arg("1")
.arg("-f")
.arg("singlejpeg")
.arg("mjpeg")
.arg("-")
.output()
.await?;
Expand Down Expand Up @@ -331,7 +331,7 @@ pub fn group_similar<'a>(similar: HashMap<&'a Item, HashSet<&'a Item>>) -> Vec<H
}
}

groups_to_items.into_iter().map(|(_, v)| v).collect()
groups_to_items.into_values().collect()
}

/// Group `potential_duplicates` according to which ones appear to be duplicates of each other.
Expand Down Expand Up @@ -1133,11 +1133,10 @@ async fn thumbnail(

{
let orientation = ExifMetadata::new_from_buffer(&image)
.map(|metadata| {
.inspect(|metadata| {
let orientation = metadata.get_orientation();
metadata.clear();
metadata.set_orientation(orientation);
metadata
})
.as_ref()
.map(|m| m.get_orientation())
Expand Down
2 changes: 1 addition & 1 deletion server/src/tags.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! This module provides two functions:
//!
//! * [tags]: handles GET /tags requests, which retrieve an optionally filtered list of tags currently applied to
//! at least one media item
//! at least one media item
//!
//! * [apply]: handles PATCH /tags requests, which add and/or remove tags to/from media items
Expand Down
4 changes: 2 additions & 2 deletions shared/src/tag_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//! * [TagExpression]: A boolean expression which may combine tags with AND, OR, and NOT operators
//!
//! * [TagTree]: A tree expression representing a disjunction of conjuctions, which may be converted to a
//! `TagExpression` when needed. This form is used in the Tagger client to allow the user to incrementally refine
//! a filter using a hierarchical menu of tags.
//! `TagExpression` when needed. This form is used in the Tagger client to allow the user to incrementally
//! refine a filter using a hierarchical menu of tags.
use {
crate::tag_expression_grammar::TagExpressionParser,
Expand Down

0 comments on commit cf2faa5

Please sign in to comment.