File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 1717use OCA \Encryption \Util ;
1818use OCA \Files \Exception \TransferOwnershipException ;
1919use OCA \Files_External \Config \ConfigAdapter ;
20+ use OCA \GroupFolders \Mount \GroupMountPoint ;
2021use OCP \Encryption \IManager as IEncryptionManager ;
2122use OCP \Files \Config \IHomeMountProvider ;
2223use OCP \Files \Config \IUserMountCache ;
@@ -166,6 +167,28 @@ public function transfer(
166167 );
167168 $ sizeDifference = $ sourceSize - $ view ->getFileInfo ($ finalTarget )->getSize ();
168169
170+ // Files in Team folders are not transferred, so their size needs to be subtracted to avoid warnings about size differences
171+ $ mounts = Server::get (IMountManager::class)->getAll ();
172+ foreach ($ mounts as $ mount ) {
173+ if (!$ mount instanceof GroupMountPoint || !str_starts_with ($ mount ->getMountPoint (), '/ ' . $ sourcePath . '/ ' )) {
174+ continue ;
175+ }
176+
177+ $ storage = $ mount ->getStorage ();
178+ if ($ storage === null ) {
179+ $ output ->writeln ('Failed to get storage for mount: ' . $ mount ->getMountPoint ());
180+ continue ;
181+ }
182+
183+ $ rootCacheEntry = $ storage ->getCache ()->get ('' );
184+ if ($ rootCacheEntry === false ) {
185+ $ output ->writeln ('Failed to get root cache entry for storage: ' . $ mount ->getMountPoint ());
186+ continue ;
187+ }
188+
189+ $ sizeDifference -= $ rootCacheEntry ->getSize ();
190+ }
191+
169192 // transfer the incoming shares
170193 $ sourceShares = $ this ->collectIncomingShares (
171194 $ sourceUid ,
Original file line number Diff line number Diff line change 114114 <referencedClass name =" OCA\TwoFactorNextcloudNotification\Controller\APIController" />
115115 <referencedClass name =" OCA\GlobalSiteSelector\Service\SlaveService" />
116116 <referencedClass name =" OCA\Guests\UserBackend" />
117+ <referencedClass name =" OCA\GroupFolders\Mount\GroupMountPoint" />
117118 </errorLevel >
118119 </UndefinedClass >
119120 <UndefinedFunction >
You can’t perform that action at this time.
0 commit comments