mirror of
https://github.com/v0l/route96.git
synced 2025-06-20 23:22:16 +00:00
Fix MIME type filtering in admin file list (#27)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
* Initial plan for issue * Initial analysis and fix compilation issue Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> * Fix MIME type filtering SQL query logic Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: v0l <1172179+v0l@users.noreply.github.com>
This commit is contained in:
@ -10,6 +10,7 @@ use anyhow::Error;
|
||||
use anyhow::Result;
|
||||
#[cfg(feature = "media-compression")]
|
||||
use ffmpeg_rs_raw::DemuxerInfo;
|
||||
#[cfg(feature = "media-compression")]
|
||||
use ffmpeg_rs_raw::StreamInfo;
|
||||
#[cfg(feature = "media-compression")]
|
||||
use rocket::form::validate::Contains;
|
||||
|
@ -234,9 +234,9 @@ impl Database {
|
||||
) -> Result<(Vec<(FileUpload, Vec<User>)>, i64), Error> {
|
||||
let mut q = QueryBuilder::new("select u.* from uploads u ");
|
||||
if let Some(m) = mime_type {
|
||||
q.push("where INSTR(");
|
||||
q.push("where INSTR(u.mime_type,");
|
||||
q.push_bind(m);
|
||||
q.push(",u.mime_type) = 0");
|
||||
q.push(") > 0");
|
||||
}
|
||||
q.push(" order by u.created desc limit ");
|
||||
q.push_bind(limit);
|
||||
|
Reference in New Issue
Block a user