Fix MIME type filtering in admin file list (#27)
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:
Copilot
2025-06-17 15:25:22 +01:00
committed by GitHub
parent dccc2d23eb
commit 510ba00368
2 changed files with 3 additions and 2 deletions

View File

@ -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;

View File

@ -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);