-
Notifications
You must be signed in to change notification settings - Fork 36
Torrent creation: add support for mtime-based file sorting #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,6 +73,7 @@ impl Hasher { | |
|
|
||
| files.push(FileInfo { | ||
| path: file_path.clone(), | ||
| mtime: None, | ||
| md5sum, | ||
| length, | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ use crate::common::*; | |
| pub(crate) enum SortKey { | ||
| Path, | ||
| Size, | ||
| Mtime, | ||
| } | ||
|
|
||
| impl SortKey { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,6 +155,7 @@ impl Walker { | |
| file_infos.push(FileInfo { | ||
| path: file_path, | ||
| length: Bytes(len), | ||
| mtime: metadata.modified().ok(), | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should return an error if we can't read the modificiation time.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should that happen here (e.g. the FS has no mtime support at all) or later if we try to actually sort based on mtime?
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, interesting, so
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An I/O error would result in an error in the former Do you believe
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think storing it as an with a new error variant,
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The standard slices'
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather not panic. When we would sort by modification time, somewhere outside of the actual sorting, we should check if mtime isn't present, and if so, throw an error before sorting. |
||
| md5sum: None, | ||
| }); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.