refactor(assets): consolidate duplicated query utilities and remove unused code

- Extract shared helpers to database/queries/common.py:
  - MAX_BIND_PARAMS, calculate_rows_per_statement, iter_chunks, iter_row_chunks
  - build_visible_owner_clause

- Remove duplicate _compute_filename_for_asset, consolidate in path_utils.py

- Remove unused get_asset_info_with_tags (duplicated get_asset_detail)

- Remove redundant __all__ from cache_state.py

- Make internal helpers private (_check_is_scalar)

Amp-Thread-ID: https://ampcode.com/threads/T-019c2ad9-9432-7451-94a8-79287dbbb19e
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Luke Mino-Altherr
2026-02-04 15:04:30 -08:00
parent 7fc59a9c53
commit 06d249c9ba
15 changed files with 514 additions and 309 deletions

View File

@@ -3,7 +3,6 @@ from app.assets.services.asset_management import (
delete_asset_reference,
get_asset_by_hash,
get_asset_detail,
get_asset_info_with_tags,
list_assets_page,
resolve_asset_for_download,
set_asset_preview,
@@ -49,7 +48,6 @@ __all__ = [
"asset_exists",
"get_asset_by_hash",
"get_asset_detail",
"get_asset_info_with_tags",
"list_assets_page",
"resolve_asset_for_download",
"update_asset_metadata",