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

Add "Trash" checkbox that show files from Google Drive Trash #82

Closed
thanamaha2002 opened this issue Feb 25, 2020 · 20 comments
Closed

Add "Trash" checkbox that show files from Google Drive Trash #82

thanamaha2002 opened this issue Feb 25, 2020 · 20 comments
Labels
enhancement New feature or request will be fixed in the next relase fix is already done and will be included in the next release wish list Would be nice to have
Milestone

Comments

@thanamaha2002
Copy link

I think this is an easy implementation just copy the checkbox "Shared" that show file from Shared with Me in Google Drive.

01

The idea of the "Trash" checkbox is to show a file from Google Drive Trash using this argument.

--drive-trashed-only

03

@thanamaha2002
Copy link
Author

Or even better design you can use the combo-box with 3 options. It also avoids the issue that you can check 2 check-boxes at the same time.

Combo-box option:

  • My Drive
  • Shared with Me
  • Trash

@kapitainsky kapitainsky added enhancement New feature or request and removed enhancement New feature or request labels Feb 25, 2020
@kapitainsky
Copy link
Owner

does rclone supports transfers from Google Drive Thrash?

@thanamaha2002
Copy link
Author

thanamaha2002 commented Feb 25, 2020

does rclone supports transfers from Google Drive Thrash?

Yes, you can download files from trash or delete it (it will permanently be deleted if you delete a file from trash via rclone.) or move it back to where it was deleted (like restore feature but you can send it back to it original directory but if you use restore from website it will restore file to the root of the drive and everything will mess up)

You can try setting up the remote by edit rclone.conf like this

[Google Drive]
type = drive
scope = drive
trashed_only = true
token = xxx

Don't get confused with the directory, it will show the current directory from My Drive but if you navigate the directory only file in the trash will show up and you can do pretty much anything with it. This is helpful since rclone can see the directory of deleted files, you can't do this if you use the website version, it will only show the deleted files but not show where it was deleted.

@thanamaha2002
Copy link
Author

thanamaha2002 commented Feb 25, 2020

I actually set up the remote for the trash but since RcloneBrowser has "Shared" checkbox why not make for the "Trash" too right? So I don't have a dupe of every remote for the trash.

Before RcloneBrowser has a "Shared" checkbox I do actually have 3 remotes for each account, you know what I mean.

04

@kapitainsky
Copy link
Owner

ok - so definitely doable. I don't expect to add this quickly though. All "google shared with me" code is very messy and would be good to clean it before adding even more complexity.
Also feel free to add this future yourself if you think it is urgent.

@kapitainsky kapitainsky added enhancement New feature or request wish list Would be nice to have labels Feb 25, 2020
@thanamaha2002
Copy link
Author

thanamaha2002 commented Feb 25, 2020

ok - so definitely doable. I don't expect to add this quickly though. All "google shared with me" code is very messy and would be good to clean it before adding even more complexity.
Also feel free to add this future yourself if you think it is urgent.

Thank you for looking into this. I not a programmer myself, and not urgently for the feature, I'll wait for your update. :)

PS. I update my reply: #82 (comment)

It has some trick that would help in some situations like you accidentally delete files from complex directory structures and when you restore all files from trash by the website the directory structure will be destroyed because the restored files will be at root of the drive. But if you use rclone to move files from the trash the directory structure will be preserved.

@kapitainsky
Copy link
Owner

Good that it is all working now too using additional "Google Thrash" remote. It is nice trick:)

@kapitainsky kapitainsky added the will be fixed in the next relase fix is already done and will be included in the next release label Mar 2, 2020
@kapitainsky
Copy link
Owner

I have it working:) Let me know what OS you are on and I send you latest version for testing.
I am not releasing it yet as want to add few other things.

@thanamaha2002
Copy link
Author

@kapitainsky Thank You! much appreciated. I using Windows 10.

@kapitainsky
Copy link
Owner

Here you are the latest beta:

https://1drv.ms/u/s!Aq335pidOrBV3-hD_QD1Whw9u0I_Iw

It includes Google drive fix and many others improvements. I am still working on adding more features so it will be few weeks before another release.

I would appreciate if you can give me some feedback on this new version. Always good to hear from power users.

@thanamaha2002
Copy link
Author

Give me one day to test it. :)

@kapitainsky
Copy link
Owner

kapitainsky commented Mar 5, 2020

Take your time:) Great if you use it and if you notice something not working let me know in this thread. You can see what has been changed and added in CHANGELOG - should be in app folder

Also any suggestions are also welcomed. Like this one with Google trash - I was not even aware that Google supports it.

@thanamaha2002
Copy link
Author

thanamaha2002 commented Mar 5, 2020

After I testing so far this is my opinion.

  1. I wish there is an option to use the old vertical list for the remote list. The current list is kinda messed if there is a lot of remotes with different name length. Here the screenshot.

  2. Stream feature not working with Trash. I check the command line it doesn't have --drive-trashed-only when using Stream feature. The same bug also found with Share with me too (--drive-shared-with-me is needed).

@kapitainsky
Copy link
Owner

kapitainsky commented Mar 5, 2020

1. I wish there is an option to use the old vertical list for the remote list. The current list is kinda messed if there is a lot of remotes with different name length. [Here the screenshot](https://user-images.githubusercontent.com/35872889/75991107-8bfa7900-5f28-11ea-8462-4290c06c9e88.png).

change in preferences "Remotes Icons Layout" to tiles - maybe it is solution? Otherwise it will be easy to add third option - "One column list"

2. **Stream** feature not working with **Trash**. I check the command line it doesn't have **--drive-trashed-only** when using **Stream** feature. The same bug also found with **Share with me** too (**--drive-shared-with-me** is needed).

I will check this one.

@kapitainsky
Copy link
Owner

Streaming is trivial fix - thanks for noticing. It will be fixed in the final version

@thanamaha2002
Copy link
Author

thanamaha2002 commented Mar 5, 2020

Yes, please add "One column list" or give user to put the number of column. :)

@thanamaha2002
Copy link
Author

thanamaha2002 commented Mar 5, 2020

I found another bug while changing between Main, Shared with me and Trash.

Here how to replicate:

Open the drive and browse through some sub-directory that has files in it. Then change to Trash it will only refresh the root of the drive but files in the sub-directory still there even those files, not in the Trash.

But if you change to Shared with me then change to Trash this bug won't happen because it will clear all directory before refreshing the drive (It won't keep directory structure).

Solution:

It needs to clear all directory then refresh it to another type of drive, so the directories and files won't get stuck.

@kapitainsky
Copy link
Owner

kapitainsky commented Mar 5, 2020 via email

@thanamaha2002
Copy link
Author

thanamaha2002 commented Mar 5, 2020

Yet another question. Would would be most useful new feature you would like to see in this app?

I thinking about the Dedupe feature since you have a Check feature. Google Drive have a problem with duplicate files, you can have 2 files with the same name in the same directory or even the same directories with the same name in the same place.

It can happen by the user's intention or if you upload a lot of files rapidly using rclone and then you need to re-upload the same directory again but Google hasn't done the indexing file, rclone won't know the file was there when it checks then it will upload the same file again. This will result in a lot of duplicated files or directories.

Luckily, rclone has command call Dedupe, it will scan the duplicated files and directories then it'll automatically process it with the option we giving.

This is pretty easy you can make a new dialog like Check feature but with Dedupe option.

Here is an example of the Dedupe command line:

".\rclone.exe" --config=".\rclone.conf" dedupe "TestRemote:test/test directory/" --dedupe-mode largest --checkers 20

In the Dedupe you can make ComboBox that user can choose dedupe mode:

Skip - removes identical files then skips anything left. --dedupe-mode skip
First - removes identical files then keeps the first one. --dedupe-mode first
Newest - removes identical files then keeps the newest one. --dedupe-mode newest
Oldest - removes identical files then keeps the oldest one. --dedupe-mode oldest
Largest - removes identical files then keeps the largest one. --dedupe-mode largest
Rename - removes identical files then renames the rest to be different. --dedupe-mode rename

And "Google Drive Use Trash" CheckBox to decide if deleted files and directories will be sent to the trash or permanently remove by using this option. It only works on Google Drive that why the name is "Google Drive Use Trash" and should be checked by default. If the user unchecked this option it will add this to the command line:

--drive-use-trash=false

And it should have a Dry Run button too.

@thanamaha2002
Copy link
Author

I made the new issue for this suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request will be fixed in the next relase fix is already done and will be included in the next release wish list Would be nice to have
Projects
None yet
Development

No branches or pull requests

2 participants