diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index a6a57abfd..1b0037aee 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -654,7 +654,7 @@ angular.module('syncthing.core') if (state === 'error') { return 'stopped'; // legacy, the state is called "stopped" in the GUI } - if (state === 'idle' && $scope.model[folderCfg.id].needFiles + $scope.model[folderCfg.id].needDeletes > 0) { + if (state === 'idle' && $scope.neededItems(folderCfg.id) > 0) { return 'outofsync'; } if (state === 'scanning') { diff --git a/lib/db/set.go b/lib/db/set.go index b7691fedc..f432e1b98 100644 --- a/lib/db/set.go +++ b/lib/db/set.go @@ -73,7 +73,7 @@ func (s *sizeTracker) addFile(f FileIntf) { switch { case f.IsDeleted(): s.Deleted++ - case f.IsDirectory(): + case f.IsDirectory() && !f.IsSymlink(): s.Directories++ case f.IsSymlink(): s.Symlinks++ @@ -93,7 +93,7 @@ func (s *sizeTracker) removeFile(f FileIntf) { switch { case f.IsDeleted(): s.Deleted-- - case f.IsDirectory(): + case f.IsDirectory() && !f.IsSymlink(): s.Directories-- case f.IsSymlink(): s.Symlinks-- diff --git a/lib/db/structs.go b/lib/db/structs.go index a9d005501..7fa3495c6 100644 --- a/lib/db/structs.go +++ b/lib/db/structs.go @@ -50,7 +50,7 @@ func (f FileInfoTruncated) FileSize() int64 { if f.Deleted { return 0 } - if f.IsDirectory() { + if f.IsDirectory() || f.IsSymlink() { return protocol.SyntheticDirectorySize } return f.Size diff --git a/lib/protocol/bep_extensions.go b/lib/protocol/bep_extensions.go index 766467ddb..8d168806d 100644 --- a/lib/protocol/bep_extensions.go +++ b/lib/protocol/bep_extensions.go @@ -63,7 +63,7 @@ func (f FileInfo) FileSize() int64 { if f.Deleted { return 0 } - if f.IsDirectory() { + if f.IsDirectory() || f.IsSymlink() { return SyntheticDirectorySize } return f.Size