Updates to artist credit handling

This commit is contained in:
Connor Johnstone
2026-03-18 14:34:13 -04:00
parent 1fbafc25df
commit dae5fce12c
2 changed files with 27 additions and 0 deletions

View File

@@ -63,3 +63,12 @@ pub async fn purge_expired(db: &DatabaseConnection) -> DbResult<u64> {
.await?;
Ok(result.rows_affected)
}
/// Delete all cache entries whose key starts with the given prefix.
pub async fn purge_prefix(db: &DatabaseConnection, prefix: &str) -> DbResult<u64> {
let result = SearchCache::delete_many()
.filter(search_cache::Column::QueryKey.starts_with(prefix))
.exec(db)
.await?;
Ok(result.rows_affected)
}