fixes for series tmdb id, fix filename length, vod tmdbid without resolve

This commit is contained in:
euzu
2025-09-20 16:19:41 +02:00
parent 9bf787953d
commit 859ad169ac
5 changed files with 87 additions and 42 deletions
+9 -1
View File
@@ -91,6 +91,14 @@ impl Substring for String {
}
pub fn truncate_string(s: &str, max_len: usize) -> String {
if s.chars().count() <= max_len {
s.to_string()
} else {
s.chars().take(max_len).collect()
}
}
#[cfg(test)]
mod test {
use std::collections::HashSet;
@@ -111,4 +119,4 @@ mod test {
assert_eq!("hELLO".capitalize(), "Hello");
}
}
}