mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 18:34:41 +01:00
operations: fix -u/--update with google photos / files of unknown size
Before this change if -u/--update was in effect we compared the size of the files to see if the transfer should go ahead. This was comparing -1 with an actual size so the transfer always proceeded. After this change we use the existing `sizeDiffers` function which does the correct comparison with -1 for files of unknown length. See: https://forum.rclone.org/t/sync-with-google-photos-to-local-drive-will-result-in-recoping/11605
This commit is contained in:
parent
b3db38ae31
commit
530ba66d35
@ -1527,7 +1527,7 @@ func NeedTransfer(ctx context.Context, dst, src fs.Object) bool {
|
||||
case dt <= -modifyWindow:
|
||||
fs.Debugf(src, "Destination is older than source, transferring")
|
||||
default:
|
||||
if src.Size() == dst.Size() {
|
||||
if !sizeDiffers(src, dst) {
|
||||
fs.Debugf(src, "Destination mod time is within %v of source and sizes identical, skipping", modifyWindow)
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user