Fixed worker job for cyrillyc names
Build and Publish / Build and Publish Docker Image (push) Successful in 2m35s
Build and Publish / Build and Publish Docker Image (push) Successful in 2m35s
This commit is contained in:
Generated
+1
-1
@@ -1141,7 +1141,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "furumusic"
|
name = "furumusic"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "furumusic"
|
name = "furumusic"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
description = "Reusable web-app boilerplate: auth, OIDC/SSO, admin panel, user management, i18n, PostgreSQL"
|
description = "Reusable web-app boilerplate: auth, OIDC/SSO, admin panel, user management, i18n, PostgreSQL"
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,8 @@ fn extract_tags(tags: &[symphonia::core::meta::Tag], meta: &mut RawMetadata) {
|
|||||||
}
|
}
|
||||||
StandardTagKey::Date | StandardTagKey::OriginalDate => {
|
StandardTagKey::Date | StandardTagKey::OriginalDate => {
|
||||||
if meta.year.is_none() {
|
if meta.year.is_none() {
|
||||||
meta.year = value[..4.min(value.len())].parse().ok();
|
let year_prefix: String = value.chars().take(4).collect();
|
||||||
|
meta.year = year_prefix.parse().ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StandardTagKey::Genre => {
|
StandardTagKey::Genre => {
|
||||||
|
|||||||
+1
-1
@@ -85,7 +85,7 @@ pub async fn probe_llm(
|
|||||||
let body_text = resp.text().await.unwrap_or_default();
|
let body_text = resp.text().await.unwrap_or_default();
|
||||||
return AgentProbeResult {
|
return AgentProbeResult {
|
||||||
latency_ms,
|
latency_ms,
|
||||||
error: format!("HTTP {status}: {}", &body_text[..body_text.len().min(300)]),
|
error: format!("HTTP {status}: {}", body_text.chars().take(300).collect::<String>()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,8 @@ async fn call_llm_chat(
|
|||||||
if !resp.status().is_success() {
|
if !resp.status().is_success() {
|
||||||
let status = resp.status();
|
let status = resp.status();
|
||||||
let body = resp.text().await.unwrap_or_default();
|
let body = resp.text().await.unwrap_or_default();
|
||||||
tracing::error!(%status, body = &body[..body.len().min(500)], "LLM API error");
|
let body_preview: String = body.chars().take(500).collect();
|
||||||
|
tracing::error!(%status, body = %body_preview, "LLM API error");
|
||||||
anyhow::bail!("LLM returned {}: {}", status, body);
|
anyhow::bail!("LLM returned {}: {}", status, body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,7 +441,7 @@ fn parse_batch_response(
|
|||||||
anyhow::anyhow!(
|
anyhow::anyhow!(
|
||||||
"Failed to parse batch LLM response: {} — raw: {}",
|
"Failed to parse batch LLM response: {} — raw: {}",
|
||||||
e,
|
e,
|
||||||
&response[..response.len().min(500)]
|
response.chars().take(500).collect::<String>()
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|||||||
@@ -949,9 +949,33 @@ fn sanitize_filename(name: &str) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn truncate_path(path: &str, max_len: usize) -> String {
|
fn truncate_path(path: &str, max_len: usize) -> String {
|
||||||
if path.len() <= max_len {
|
let char_count = path.chars().count();
|
||||||
|
if char_count <= max_len {
|
||||||
path.to_owned()
|
path.to_owned()
|
||||||
|
} else if max_len <= 3 {
|
||||||
|
".".repeat(max_len)
|
||||||
} else {
|
} else {
|
||||||
format!("...{}", &path[path.len() - (max_len - 3)..])
|
let suffix: String = path
|
||||||
|
.chars()
|
||||||
|
.skip(char_count - (max_len - 3))
|
||||||
|
.collect();
|
||||||
|
format!("...{suffix}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::truncate_path;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn truncate_path_handles_unicode_boundaries() {
|
||||||
|
assert_eq!(
|
||||||
|
truncate_path("KUNTEYNIR/Блёвбургер", 20),
|
||||||
|
"KUNTEYNIR/Блёвбургер"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
truncate_path("KUNTEYNIR/ОченьДлинноеНазвание", 12),
|
||||||
|
"...еНазвание"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user