nurdtechie98 / drive-cli

A command line interface for accessing google drive

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Google Docs duplication during pull and push

nurdtechie98 opened this issue · comments

When a file of google docs is pulled we need to export it to some other format. In doing so whenever we have pull, a new file in exported format is created even though there has been no changes since the last pull. Similarly while pushing this exported file gets pushed back as well thus causing duplication. This duplication must not happen.

@nurdtechie98 I want to solve this issue.

@nurdtechie98 @NightWing1998 can you please give a brief of this issue. I didn't understand what exactly the problem is. Does this happen only with google docs?

@nurdtechie98 @NightWing1998 can you please give a brief of this issue. I didn't understand what exactly the problem is. Does this happen only with google docs?

When you download a file for eg "sample"( word document ) that is a google doc ( .gdocx is the extension given by Google to such files ) it converts the file to .docx and then downloads it. If the repo inside which i'm pulling already has a sample doc in it then it creates a duplicate of it even though no changes were made to that file. Similarly it creates a duplicate when one tries to push such files.

Does this issue is only with doc?

For Google sheet, ppt is it working fine?

All types of google docs, i.e. , slides sheets docs etc

Wait for some time. I'll try to send some screenshots of what is happening
Or if you want try to clone a Google doc/sheet/slide and use the push pull commands

ok, I will try.

Screenshot 2019-04-10 at 8 29 09 PM
Screenshot 2019-04-10 at 8 29 26 PM
Refer to these screenshots
You can see that when one downloads a google doc/sheet/ppt it successfully downloads it but when one tries to push it, it uploads the same as a separate file whereas it should have updated the google doc/sheet/ppt
Also you can see that even if one downloaded the file it again creates a duplicate of it (.odt and .rtf) are 2 instances of the same file.

I have a solution for this issue, we can use google docs/google sheet/... api to update file content.

I have a solution for this issue, we can use google docs/google sheet/... api to update file content.

@inishchith @NightWing1998 @nurdtechie98 comment on this. If you have another idea please discuss.

@raghav-dalmia I didn't get much time to think and consider alternatives. I'd suggest you work the solution ( in case you're clear with it) and later we can have a discussion over the PR.
Else i'll update this thread once i get time.

Thanks for your patience

@inishchith I will wait of your (@NightWing1998 @nurdtechie98 @inishchith ) reply. When you got time please update this thread. Thank you

@raghav-dalmia your approach looks good to me feel free to go ahead

@nurdtechie98 @inishchith don't you think if we use more G-suite APIs, it will slow down our code. There should be another alternative.

It might take some time, agreed but do we have any other alternative. Let me know if you can think of something good.

Another alternative could be track the files that were converted and then downloaded and while pushing back change the extension back to what it was.
For eg if one has downloaded text.gdoc as text.docx then while pushing update change the extension back to .gdoc and then push. But not sure if it will work

Sorry for the late reply, I am busy with my exams. @NightWing1998 your idea seems good to me. @nurdtechie98 @inishchith please comment.