Skip to content

Commit

Permalink
Use correct path for extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ReagentX committed Jul 29, 2023
1 parent ec55d2c commit bdba41a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions imessage-exporter/src/app/attachment_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ use std::{
};

use filetime::{set_file_times, FileTime};
use imessage_database::tables::{attachment::Attachment, messages::Message};
use imessage_database::{
tables::{attachment::Attachment, messages::Message},
util::platform::Platform,
};
use uuid::Uuid;

use crate::app::{
Expand Down Expand Up @@ -56,8 +59,6 @@ impl AttachmentManager {
return None;
}

let ext = from.extension()?;

// Create a path to copy the file to
let mut to = config.attachment_path();

Expand All @@ -68,7 +69,8 @@ impl AttachmentManager {
// Add a random filename
to.push(Uuid::new_v4().to_string());

to.set_extension(ext);
// Set the new file's extension to the original one
to.set_extension(attachment.extension()?);

match self {
AttachmentManager::Compatible => match &config.converter {
Expand Down

0 comments on commit bdba41a

Please sign in to comment.