-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Files): Add possibility to preview video files
- Loading branch information
Showing
7 changed files
with
63 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use std::{fs, io, path::PathBuf}; | ||
|
||
use crate::STATIC_ARGS; | ||
|
||
pub fn clear_temp_files_directory(path_to_delete_specific_file: Option<PathBuf>) -> io::Result<()> { | ||
match path_to_delete_specific_file { | ||
Some(path) => fs::remove_file(&path)?, | ||
None => { | ||
let temp_files_dir = fs::read_dir(STATIC_ARGS.temp_files.clone())?; | ||
for entry in temp_files_dir { | ||
let entry = entry?; | ||
let path = entry.path(); | ||
if path.is_dir() { | ||
fs::remove_dir_all(&path)?; | ||
} else { | ||
fs::remove_file(&path)?; | ||
} | ||
} | ||
} | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod clear_temp_files_dir; | ||
pub mod img_dimensions_preview; | ||
pub mod lifecycle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters