mirror of
https://github.com/kopia/kopia.git
synced 2026-01-25 23:08:01 -05:00
bundle tweaks
This commit is contained in:
@@ -64,7 +64,7 @@ func (p *Permissions) UnmarshalJSON(b []byte) error {
|
||||
// EntryMetadata stores attributes of a single entry in a directory.
|
||||
type EntryMetadata struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Type EntryType `json:"type"`
|
||||
Type EntryType `json:"type,omitempty"`
|
||||
Permissions Permissions `json:"mode,omitempty"`
|
||||
FileSize int64 `json:"size,omitempty"`
|
||||
ModTime time.Time `json:"mtime,omitempty"`
|
||||
|
||||
@@ -341,6 +341,10 @@ type uploadBundle struct {
|
||||
func (b *uploadBundle) append(e File) {
|
||||
b.files = append(b.files, e)
|
||||
b.metadata.FileSize += e.Metadata().FileSize
|
||||
emt := e.Metadata().ModTime
|
||||
if b.metadata.ModTime.IsZero() || b.metadata.ModTime.Before(emt) {
|
||||
b.metadata.ModTime = emt
|
||||
}
|
||||
}
|
||||
|
||||
type uploadedBundleFile struct {
|
||||
@@ -403,7 +407,7 @@ func getBundleNumber(md *EntryMetadata) int {
|
||||
// TODO(jkowalski): This is not ready yet, uncomment when ready.
|
||||
|
||||
// if md.FileMode().IsRegular() && md.FileSize < maxBundleFileSize {
|
||||
// return md.ModTime().Year()*100 + int(md.ModTime().Month())
|
||||
// return md.ModTime.Year()*100 + int(md.ModTime.Month())
|
||||
// }
|
||||
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user