File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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 \EventDispatcher \IEventDispatcher ;
2223use OCP \Files \Config \IHomeMountProvider ;
@@ -169,6 +170,28 @@ public function transfer(
169170 );
170171 $ sizeDifference = $ sourceSize - $ view ->getFileInfo ($ finalTarget )->getSize ();
171172
173+ // Files in Team folders are not transferred, so their size needs to be subtracted to avoid warnings about size differences
174+ $ mounts = Server::get (IMountManager::class)->getAll ();
175+ foreach ($ mounts as $ mount ) {
176+ if (!$ mount instanceof GroupMountPoint || !str_starts_with ($ mount ->getMountPoint (), '/ ' . $ sourcePath . '/ ' )) {
177+ continue ;
178+ }
179+
180+ $ storage = $ mount ->getStorage ();
181+ if ($ storage === null ) {
182+ $ output ->writeln ('Failed to get storage for mount: ' . $ mount ->getMountPoint ());
183+ continue ;
184+ }
185+
186+ $ rootCacheEntry = $ storage ->getCache ()->get ('' );
187+ if ($ rootCacheEntry === false ) {
188+ $ output ->writeln ('Failed to get root cache entry for storage: ' . $ mount ->getMountPoint ());
189+ continue ;
190+ }
191+
192+ $ sizeDifference -= $ rootCacheEntry ->getSize ();
193+ }
194+
172195 // transfer the incoming shares
173196 $ sourceShares = $ this ->collectIncomingShares (
174197 $ 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