Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Handle moving of Shared Folders for Business Accounts #2824

Open
divico opened this issue Sep 18, 2024 · 3 comments · May be fixed by #3052
Open

Feature Request: Handle moving of Shared Folders for Business Accounts #2824

divico opened this issue Sep 18, 2024 · 3 comments · May be fixed by #3052

Comments

@divico
Copy link

divico commented Sep 18, 2024

Is your feature request related to a problem? Please describe.

It would be helpful to be able to move OneDrive Business Shared Folders to a different location within OneDrive than the default "My Files" location. With a growing number of shared folders, the folder structure in "My Files" can get very messy.

Currently, syncing OneDrive Business Shared Folders works only as long as the folder (i.e. the shortcut) is left in the default location, that is at the root of its own OneDrive folder structure (i.e. "My Files").

Describe the solution you'd like

The optimal solution is to behave like the Windows client. The shared folders (i.e. shortcuts) can be moved to any other location which is then reflected locally.

Describe alternatives you've considered

Not great, but creating local symlinks outside the OneDrive folder pointing to the shared folders in OneDrive would allow you to get some sort of folder structure of the shared folders.

Additional context

Refer to: #2821

@divico divico added the Feature Request Feature Request | Enhancement Request label Sep 18, 2024
@abraunegg abraunegg added this to the v2.5.x milestone Sep 18, 2024
abraunegg added a commit that referenced this issue Dec 26, 2024
* Implement Feature Request #2824 to support the moving of Shared Folder Links to other folders
@abraunegg
Copy link
Owner

abraunegg commented Dec 26, 2024

@divico

Important

Relocatable Shared Folder Links is only a OneDrive Business supported capability. Microsoft does not support this for OneDrive Personal account types.

Please can you test extensively this PR that implements this feature request.

This PR specifically builds on the changes implemented in PR #3051

To test this PR, first install all the require platform dependencies to build the client on your respective platforms. Please read https://github.com/abraunegg/onedrive/blob/master/docs/install.md#building-from-source---high-level-requirements and then follow correctly for your platform.

Once this is done, to clone the PR to resolve your issue, you can use a script like the following:

#!/bin/bash

PR=3052

rm -rf ./onedrive-pr${PR}
git clone https://github.com/abraunegg/onedrive.git onedrive-pr${PR}
cd onedrive-pr${PR}
git fetch origin pull/${PR}/head:pr${PR}
git checkout pr${PR}

# Configure and Build
./configure --enable-debug --enable-notifications; make clean; make;
./onedrive --version

This script will create a local folder called onedrive-pr3052 with the PR version.

To run the PR, you need to run the client from the PR build directory:

./onedrive <any other options needed>

To install the PR, you will need to perform sudo make install to install the PR version to your system.

When running the PR, your version should be: onedrive v2.5.3-31-gdef04a4 or greater.

Please note PR #3051 and PR #3052 have a DB schema change which forces a resync.

PR Evidence

Online Folder Structure

image
image
image

PR Application Output

Reading configuration file: /home/alex/.config/onedrive/config
Configuration file successfully loaded
Using 'user' configuration path for application config and state data: /home/alex/.config/onedrive
D-Bus message bus daemon is available; GUI notifications are now enabled

ERROR: Unable to create /var/log/onedrive
ERROR: Please manually create '/var/log/onedrive' and set appropriate permissions to allow write access for your user to this location.
ERROR: The requested client activity log will instead be located in your users home directory

Using the following path to store the runtime application log: /home/alex
Deleting the saved application sync status ...
Using IPv4 and IPv6 (if configured) for all network operations
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Checking Application Version ...
Attempting to initialise the OneDrive API ...
Configuring Global Azure AD Endpoints
The OneDrive API was initialised successfully
Opening the item database ...
Application Version:  onedrive v2.5.3-31-gdef04a4
Account Type:         business
Default Drive ID:     b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Default Root ID:      01WIXGO5V6Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 1022.62 GB (1098031941419 bytes)
Sync Engine Initialised with new Onedrive API instance
All application operations will be performed in the configured local 'sync_dir' directory: /home/alex/OneDrive
Fetching /delta response from the OneDrive API for Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Processing API Response Bundle: 1 - Quantity of 'changes|items' in this bundle to process: 11
Finished processing /delta JSON response from the OneDrive API
Processing 10 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Creating local directory: ./L18N
Creating local directory: ./L18N/α
Creating local directory: ./L18N/เอกสาร
Creating local directory: ./L18N/Bücher
Creating local directory: ./bad_url_decode
Creating local directory: ./test_folder_in_3040

WARNING: The OneDrive Shared Folder link target 'test_folder_in_3040' cannot be found online using the provided online data.
WARNING: This is potentially a broken online OneDrive Shared Folder link or you no longer have access to it. Please correct this error online.

Creating local directory: ./moved shared folder link
Creating local directory: ./moved shared folder link/Sub Folder 2
WARNING: OneDrive quota information is being restricted. Please fix by speaking to your OneDrive / Office 365 Administrator.
Creating local directory: ./Documents - Issue_3020
Number of items to download from Microsoft OneDrive: 1
Downloading file: bad_url_decode/BTINserye%20Anti-Terror%20Law%20sa%20Wikang%20Filipino%20-%2.mp4 ... done
Syncing this OneDrive Business Shared Folder: test_folder_in_3040

WARNING: The OneDrive Shared Folder link target 'test_folder_in_3040' cannot be found online using the provided online data.
WARNING: This is potentially a broken online OneDrive Shared Folder link or you no longer have access to it. Please correct this error online.

No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Syncing this OneDrive Business Shared Folder: moved shared folder link/Sub Folder 2
Generating a /delta response from the OneDrive API from this Item ID: 01TZRSBFDUQZAUOGZ7BJGZ24DDTBCLCGWI
Adding OneDrive folder details for processing
Adding 2 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from online_folder_in_sub_folder2
Finished processing self generated /delta JSON response from the OneDrive API
Processing 4 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Creating local directory: ./moved shared folder link/Sub Folder 2/online_folder_in_sub_folder2
Number of items to download from Microsoft OneDrive: 2
Downloading file: moved shared folder link/Sub Folder 2/shared_folder_new_file.txt ... done
Downloading file: moved shared folder link/Sub Folder 2/online_folder_in_sub_folder2/55_44_33_.trc ... done
Syncing this OneDrive Business Shared Folder: Documents - Issue_3020
Generating a /delta response from the OneDrive API from this Item ID: 01D3ZRYZV6Y2GOVW7725BZO354PWSELRRZ
Adding OneDrive folder details for processing
Adding 5 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from file_over_4Mb_3020
Adding 1 OneDrive items for processing from file_under_4Mb_3020
Adding 1 OneDrive items for processing from newfolder
Adding 1 OneDrive items for processing from non_enrichment_over_4mb_3020
Adding 1 OneDrive items for processing from non_enrichment_under_4Mb_3020
Finished processing self generated /delta JSON response from the OneDrive API
Processing 10 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Creating local directory: ./Documents - Issue_3020/file_over_4Mb_3020
Creating local directory: ./Documents - Issue_3020/file_under_4Mb_3020
Creating local directory: ./Documents - Issue_3020/newfolder
Creating local directory: ./Documents - Issue_3020/non_enrichment_over_4mb_3020
Creating local directory: ./Documents - Issue_3020/non_enrichment_under_4Mb_3020
Number of items to download from Microsoft OneDrive: 5
Downloading file: Documents - Issue_3020/file_under_4Mb_3020/file_under_4mb.docx ... done
Downloading file: Documents - Issue_3020/newfolder/newfile.txt ... done
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 0%   |  ETA    --:--:--
Downloading file: Documents - Issue_3020/non_enrichment_under_4Mb_3020/file1.data ... done
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 5%   |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 10%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 15%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 0%   |  ETA    --:--:--
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 20%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 25%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 30%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 35%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 40%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 45%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 50%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 55%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 60%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 65%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 70%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 75%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 80%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 85%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 90%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 95%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 100% | DONE in 00:00:01
Downloading file: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... done
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 10%  |  ETA    00:00:19
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 15%  |  ETA    00:00:09
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 20%  |  ETA    00:00:06
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 25%  |  ETA    00:00:04
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 30%  |  ETA    00:00:03
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 35%  |  ETA    00:00:03
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 40%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 45%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 50%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 55%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 60%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 65%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 70%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 75%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 80%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 85%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 90%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 95%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 100% | DONE in 00:00:02
Downloading file: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... done
Performing a database consistency and integrity check on locally stored data
Processing DB entries for this Drive ID: b!DyXUf1m74EGNtZZj9Hzw3R_ccjiJb9xCvp-4dE_DvZIXUod3Az9ISaTJ7HbNvyDC
Processing: Documents - Issue_3020
The directory has not changed
Processing: Documents - Issue_3020/file_over_4Mb_3020
The directory has not changed
Processing: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx
The file has not changed
Processing: Documents - Issue_3020/file_under_4Mb_3020
The directory has not changed
Processing: Documents - Issue_3020/file_under_4Mb_3020/file_under_4mb.docx
The file has not changed
Processing: Documents - Issue_3020/newfolder
The directory has not changed
Processing: Documents - Issue_3020/newfolder/newfile.txt
The file has not changed
Processing: Documents - Issue_3020/non_enrichment_over_4mb_3020
The directory has not changed
Processing: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data
The file has not changed
Processing: Documents - Issue_3020/non_enrichment_under_4Mb_3020
The directory has not changed
Processing: Documents - Issue_3020/non_enrichment_under_4Mb_3020/file1.data
The file has not changed
Processing DB entries for this Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Processing: ~/OneDrive
The directory has not changed
Processing: L18N
The directory has not changed
Processing: L18N/α
The directory has not changed
Processing: L18N/เอกสาร
The directory has not changed
Processing: L18N/Bücher
The directory has not changed
Processing: bad_url_decode
The directory has not changed
Processing: bad_url_decode/BTINserye%20Anti-Terror%20Law%20sa%20Wikang%20Filipino%20-%2.mp4
The file has not changed
Processing: moved shared folder link
The directory has not changed
Processing DB entries for this Drive ID: b!fZgJhK-pU0eTQpylvmoYCkE4YgH_KRNDlxjRx9OWNqmV9Q_E_uWdRJKIB5L_ruPN
WARNING: OneDrive quota information is being restricted. Please fix by speaking to your OneDrive / Office 365 Administrator.
Processing: moved shared folder link/Sub Folder 2
The directory has not changed
Processing: moved shared folder link/Sub Folder 2
The directory has not changed
Processing: moved shared folder link/Sub Folder 2/online_folder_in_sub_folder2
The directory has not changed
Processing: moved shared folder link/Sub Folder 2/online_folder_in_sub_folder2/55_44_33_.trc
The file has not changed
Processing: moved shared folder link/Sub Folder 2/shared_folder_new_file.txt
The file has not changed
Scanning the local file system '~/OneDrive' for new data to upload
Performing a last examination of the most recent online data within Microsoft OneDrive to complete the reconciliation process
Fetching /delta response from the OneDrive API for Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Processing API Response Bundle: 1 - Quantity of 'changes|items' in this bundle to process: 0
Finished processing /delta JSON response from the OneDrive API
No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Syncing this OneDrive Business Shared Folder: test_folder_in_3040

WARNING: The OneDrive Shared Folder link target 'test_folder_in_3040' cannot be found online using the provided online data.
WARNING: This is potentially a broken online OneDrive Shared Folder link or you no longer have access to it. Please correct this error online.

No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Syncing this OneDrive Business Shared Folder: moved shared folder link/Sub Folder 2
Generating a /delta response from the OneDrive API from this Item ID: 01TZRSBFDUQZAUOGZ7BJGZ24DDTBCLCGWI
Adding OneDrive folder details for processing
Adding 2 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from online_folder_in_sub_folder2
Finished processing self generated /delta JSON response from the OneDrive API
Processing 4 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Syncing this OneDrive Business Shared Folder: Documents - Issue_3020
Generating a /delta response from the OneDrive API from this Item ID: 01D3ZRYZV6Y2GOVW7725BZO354PWSELRRZ
Adding OneDrive folder details for processing
Adding 5 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from file_over_4Mb_3020
Adding 1 OneDrive items for processing from file_under_4Mb_3020
Adding 1 OneDrive items for processing from newfolder
Adding 1 OneDrive items for processing from non_enrichment_over_4mb_3020
Adding 1 OneDrive items for processing from non_enrichment_under_4Mb_3020
Finished processing self generated /delta JSON response from the OneDrive API
Processing 10 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state

Sync with Microsoft OneDrive is complete
Attempting to perform a database vacuum to optimise database
Database vacuum is complete

Local Directory Structure

.
├── bad_url_decode
│   └── BTINserye%20Anti-Terror%20Law%20sa%20Wikang%20Filipino%20-%2.mp4
├── Documents - Issue_3020
│   ├── file_over_4Mb_3020
│   │   └── file_over_4mb.docx
│   ├── file_under_4Mb_3020
│   │   └── file_under_4mb.docx
│   ├── newfolder
│   │   └── newfile.txt
│   ├── non_enrichment_over_4mb_3020
│   │   └── file1.data
│   └── non_enrichment_under_4Mb_3020
│       └── file1.data
├── L18N
│   ├── Bücher
│   ├── α
│   └── เอกสาร
├── moved shared folder link
│   └── Sub Folder 2
│       ├── online_folder_in_sub_folder2
│       │   └── 55_44_33_.trc
│       └── shared_folder_new_file.txt
└── test_folder_in_3040

16 directories, 8 files

@divico
Copy link
Author

divico commented Dec 28, 2024

@abraunegg cool thank you very much for working on my feature request. I could compile the PR on my machine. I will make tests using version onedrive v2.5.3-31-gdef04a4. Can I come back to you by Jan 12 or is it too late?

@abraunegg
Copy link
Owner

abraunegg commented Dec 28, 2024

@divico
Please can you test extensivly so this can be included in v2.5.4 at some point in January.

@abraunegg abraunegg changed the title Feature Request: Handle moving of Shared Folders Feature Request: Handle moving of Shared Folders for Business Accounts Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants