commit 254a0c6b241834e6e2408c1db75ec2c46f503b9b
parent 1d132463f2f45e5ded22bb34655a0d4468660ecf
Author: egor-achkasov <eaachkasov@gmail.com>
Date: Sat, 21 Feb 2026 15:47:42 +0000
Change thread dir name to thread id only
Diffstat:
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/src/export.rs b/src/export.rs
@@ -37,9 +37,9 @@ fn render_text_to_html(text: &str) -> String {
/// Export the thread to a simple static HTML
///
/// Creates a directory as follows:
-/// ./{thread_name}, where {thread_name} is OP subject or first 20 characters of OP text
-/// If download_files is true, downloads files to ./{thread_name}/files
-/// If download_thumbnails is true, downloads thumbnails to ./{thread_name}/thumb
+/// ./{thread_id}, where {thread_nid} is OP ID
+/// If download_files is true, downloads files to ./{thread_id}/files
+/// If download_thumbnails is true, downloads thumbnails to ./{thread_id}/thumb
///
/// WARNING: If the directory already exists, it will be overwritten
pub async fn export2html(
@@ -51,15 +51,8 @@ pub async fn export2html(
return Err("No posts to export".into());
}
- // Get thread name
- let thread_name: String = format!(
- "{}_{}",
- posts[0].subject.clone().unwrap_or_else(|| posts[0].text.chars().take(20).collect()),
- posts[0].id
- );
-
// Create directories
- let dir = format!("{}", thread_name);
+ let dir = format!("{}", posts[0].id);
std::fs::create_dir_all(&dir)?;
// Render the thread