mirror of
https://github.com/ankitects/anki.git
synced 2026-01-14 06:23:57 -05:00
don't try to read file data when file marked as a deletion
If the user hadn't used the media check to clean up files with invalid names on disk, the long filename would break the 'automatically rename long filenames when syncing' functionality, causing the original long filename to be uploaded to AnkiWeb as an addition instead of a deletion
This commit is contained in:
parent
70cdb5e56e
commit
6f9079a341
1 changed files with 11 additions and 6 deletions
|
|
@ -712,13 +712,18 @@ fn zip_files<'a>(
|
|||
break;
|
||||
}
|
||||
|
||||
let file_data = match data_for_file(media_folder, &file.fname) {
|
||||
Ok(data) => data,
|
||||
Err(e) => {
|
||||
debug!(log, "error accessing {}: {}", &file.fname, e);
|
||||
invalid_entries.push(&file.fname);
|
||||
continue;
|
||||
let file_data = if file.sha1.is_some() {
|
||||
match data_for_file(media_folder, &file.fname) {
|
||||
Ok(data) => data,
|
||||
Err(e) => {
|
||||
debug!(log, "error accessing {}: {}", &file.fname, e);
|
||||
invalid_entries.push(&file.fname);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// uploading deletion
|
||||
None
|
||||
};
|
||||
|
||||
if let Some(data) = &file_data {
|
||||
|
|
|
|||
Loading…
Reference in a new issue