forked from Furumi/furumi-web
Optimize Last.fm popularity lookups with light and full modes
This commit is contained in:
1 parent
2b3b50f7af
commit
bd1d3a4ebc
11 files changed
+955
-185
No files matched your search
@@ -110,6 +110,8 @@ pub struct ArtworkBackfillRunRequest {
|
||||
overwrite_existing: bool,
|
||||
}
|
||||
|
||||
pub type LastfmPopularityRunRequest = crate::jobs::lastfm_popularity::LastfmPopularityOptions;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub(super) struct UpdateLibraryItemRequest {
|
||||
kind: String,
|
||||
@@ -1734,6 +1736,19 @@ pub async fn run_metadata_backfill(
|
||||
Json(JobRunStartedDto { ok: true, run_id }).into_response()
|
||||
}
|
||||
|
||||
pub async fn run_lastfm_popularity(
|
||||
session: Session,
|
||||
db: Database,
|
||||
pool: &PgPool,
|
||||
Json(options): Json<LastfmPopularityRunRequest>,
|
||||
) -> cot::Result<cot::response::Response> {
|
||||
if let Err(response) = require_admin_json(&session, &db).await {
|
||||
return Ok(response);
|
||||
}
|
||||
let run_id = super::start_lastfm_popularity(&db, pool, options).await?;
|
||||
Json(JobRunStartedDto { ok: true, run_id }).into_response()
|
||||
}
|
||||
|
||||
pub async fn run_artwork_backfill(
|
||||
session: Session,
|
||||
db: Database,
|
||||
|
||||
Reference in new issue
Block a user