mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-24 08:42:23 +02:00
fixes for series tmdb id, fix filename length, vod tmdbid without resolve
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user