Repository navigation
Do not use -1 as the size for the root folder of the home storage - #5768
Conversation
|
I guess it won't work for legacy home storages where the URI is "local:/srv/www/owncloud/data/user1" ? |
|
Could we just detect legacy URI's and make them use the new Home storage class ? Might save having to check for both versions when needed. |
|
Test passed. |
|
The other problem with this PR is that it will duplicate the code for "calculateFolderSize". Maybe we can try and detect whether it's home storage or legacy home storage in the original cache's calculateFolderSize method. |
|
For the duplicate code issue, maybe HomeCache can check whether $path === ''. If yes, use the special logic. Else call parent::calculateFolderSize(). |
|
I don't want to move the check to the general cache as I would like to keep storage specific code outside the general cache. the second option sounds sensible |
|
👍 |
|
👎 for now as this won't work for legacy storages with URLs like "local:/srv/www/owncloud/data/user1" (when upgrading from 5.0.12) |
|
@PVince81 Can they easiely be migrated to the new storages? |
|
I'm not sure, maybe updating the oc_storages table would do. @icewind1991 ? |
|
I've made the change for calling the parent method. Next, I'll look into the home dir migration. |
|
Test passed. |
Legacy home storage ids with the format "local://path/to/datadir/user1" are now also wrapped by the HomeStorage.
|
I've rebased and added a commit for wrapping legacy storage (local://path/to/datadir/username) with the HomeStorage class. This will make it work for users migrated directly from 5.0.12 to OC 6. Please review @icewind1991 @DeepDiver1975 @kabum |
|
Test passed. |
|
code looks good 👍 |
|
👍 |
…tsize-home-only Do not use -1 as the size for the root folder of the home storage
Replacement of #5684
Same logic only applied to the home storage to prevent sizes of external storages to be shown incorrect