various: remove dead code; fix skipped tests

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9100489be899f9e9fbd32f6aca3080196a6a6964
This commit is contained in:
raf 2026-02-05 00:18:02 +03:00
commit cfdc3d0622
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
18 changed files with 1445 additions and 28 deletions

View file

@ -212,15 +212,13 @@ fn handle_api_result(state: &mut AppState, result: ApiResult) {
state.search_selected = Some(0);
}
}
ApiResult::Tags(tags) => {
ApiResult::AllTags(tags) => {
// All tags in the system (for Tags view)
state.tags = tags;
if !state.tags.is_empty() {
state.tag_selected = Some(0);
}
}
ApiResult::AllTags(tags) => {
state.all_tags = tags;
}
ApiResult::Collections(cols) => {
state.collections = cols;
if !state.collections.is_empty() {
@ -623,6 +621,16 @@ async fn handle_action(
match client.list_jobs().await {
Ok(jobs) => {
tracing::debug!("Found {} background jobs", jobs.len());
for job in &jobs {
tracing::debug!(
"Job {}: kind={:?}, status={:?}, created={}, updated={}",
job.id,
job.kind,
job.status,
job.created_at,
job.updated_at
);
}
}
Err(e) => tracing::warn!("Failed to list jobs: {}", e),
}
@ -728,7 +736,7 @@ async fn handle_action(
}
View::Tags => match client.list_tags().await {
Ok(tags) => {
if let Err(e) = tx.send(AppEvent::ApiResult(ApiResult::Tags(tags))) {
if let Err(e) = tx.send(AppEvent::ApiResult(ApiResult::AllTags(tags))) {
tracing::warn!("failed to send event: {e}");
}
}

View file

@ -102,9 +102,7 @@ pub struct DuplicateGroupResponse {
}
/// Background job response from the API.
/// Fields are used for deserialization; the job count is logged in the Database view.
#[derive(Debug, Clone, Deserialize)]
#[allow(dead_code)]
pub struct JobResponse {
pub id: String,
pub kind: serde_json::Value,

View file

@ -11,11 +11,9 @@ pub enum AppEvent {
}
#[derive(Debug)]
#[allow(dead_code)]
pub enum ApiResult {
MediaList(Vec<crate::client::MediaResponse>),
SearchResults(crate::client::SearchResponse),
Tags(Vec<crate::client::TagResponse>),
AllTags(Vec<crate::client::TagResponse>),
Collections(Vec<crate::client::CollectionResponse>),
ImportDone(crate::client::ImportResponse),