fix: supprimer les variables inutilisées et la fonction morte (warnings Rust)
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 6s

- metadata.rs: simplifier la query get_missing_books, library_id et
  series_name étaient extraits mais non utilisés
- series.rs: supprimer resolve_series_id jamais appelée

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-30 09:29:26 +02:00
parent c5ada110ab
commit 97abaaeda4
2 changed files with 1 additions and 22 deletions

View File

@@ -515,19 +515,14 @@ pub async fn get_missing_books(
) -> Result<Json<MissingBooksDto>, ApiError> { ) -> Result<Json<MissingBooksDto>, ApiError> {
// Verify link exists // Verify link exists
let link = sqlx::query( let link = sqlx::query(
"SELECT eml.library_id, eml.series_id, s.name AS series_name \ "SELECT eml.series_id FROM external_metadata_links eml WHERE eml.id = $1",
FROM external_metadata_links eml \
JOIN series s ON s.id = eml.series_id \
WHERE eml.id = $1",
) )
.bind(id) .bind(id)
.fetch_optional(&state.pool) .fetch_optional(&state.pool)
.await? .await?
.ok_or_else(|| ApiError::not_found("link not found"))?; .ok_or_else(|| ApiError::not_found("link not found"))?;
let library_id: Uuid = link.get("library_id");
let series_id: Uuid = link.get("series_id"); let series_id: Uuid = link.get("series_id");
let series_name: String = link.get("series_name");
// Count external books // Count external books
let total_external: i64 = let total_external: i64 =

View File

@@ -9,22 +9,6 @@ use crate::{auth::AuthUser, books::BookItem, error::ApiError, state::AppState};
// ─── Helper functions ──────────────────────────────────────────────────────── // ─── Helper functions ────────────────────────────────────────────────────────
/// Resolve a series UUID from library_id + name. Returns NotFound if no such series exists.
pub(crate) async fn resolve_series_id(
pool: &sqlx::PgPool,
library_id: Uuid,
name: &str,
) -> Result<Uuid, ApiError> {
sqlx::query_scalar::<_, Uuid>(
"SELECT id FROM series WHERE library_id = $1 AND LOWER(name) = LOWER($2)"
)
.bind(library_id)
.bind(name)
.fetch_optional(pool)
.await?
.ok_or_else(|| ApiError::not_found(format!("series '{}' not found", name)))
}
/// Get or create a series row, returning its UUID. /// Get or create a series row, returning its UUID.
pub(crate) async fn get_or_create_series( pub(crate) async fn get_or_create_series(
pool: &sqlx::PgPool, pool: &sqlx::PgPool,