-
Notifications
You must be signed in to change notification settings - Fork 506
Fix bug with missing downloadURL for docs/sheets #25
Conversation
51aebfa
to
81cfdd9
Compare
Maybe we should touch an empty file locally for Docs files and prefer not to download the contents. We can easily detect the Docs files remotely and skip them during the upload. One consistency problem would arise if someone locally delete a Docs file and replace it with a regular one and runs a push. Exporting is good to back things up, but I don't think that's the expected behavior for the majority of the users. |
Good idea. Sounds like a plan, however we shall need to inform the users in the README about the trips with Docs. |
@rakyll could this then become a feature ie exporting or creating backups and then retain the empty file creation for Doc files? |
There could be a separate command to backup the Docs file, and backing up should not support upstreaming. |
Aye aye, thanks for the clarification. |
Adds the ability for one to go like this: mkdir ~/drive cd drive drive init ... drive pull Photos cd Photos drive push drive publish Photos refactoring: pull & push into changes
Google Docs + Sheets do not populate 'DownloadUrl', but instead provide an map of exportLinks ie csv, docx, pptx, txt etc. Simple heuristic to determine the url to export as well as create the target extension to avoid clobbering of the original file on a re-sync.
@rakyll, please see the latest. |
// exportable type since we cannot directly download the raw data. | ||
// We also need to pay attention and add the exported extension | ||
// to avoid overriding the original file on re-syncing. | ||
if len(change.Src.BlobAt) < 1 && exportOnBackup && IsGoogleDoc(change.Src) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this if be as simple as:
if hasExportLinks(change.Str) && export {
}
Why do we have to care about BlobAt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, see I am thinking about the case that a file has both exportLinks as well as BlobAt. In this case we would want to download the actual file.
Actually you are right, given that isGoogleDoc involves a check for BlobAt == "".
@rakyll, got the desired -exports fmt1,fmt2,fmt3 etc in, plus fixed a couple of the nits raised. |
83f8b97
to
2a327f9
Compare
6feb3ed
to
c83bc67
Compare
This enables pushes from arbitrary paths e.g `drive push -r /Volumes/SDCard ~/gdrive` instead of always having to copy content first into the drive then pushing it. Basic idea is the creation of a symlink that gets cleared on deferal.
@rakyll ping! |
ba0e00e
to
0aa17b4
Compare
Allows for command like this: `drive pull -export doc` Equal to `drive pull -export docx` and any other similar formats bunched together
+ Moved duplicated code into one function. + Ensuring that exported docs have the correct paths.
Any idea when this could be implemented into master? |
Implemented in my fork: https://github.com/odeke-em/drive |
Google Docs + Sheets do not populate 'DownloadUrl', but
instead provide an map of exportLinks ie csv, docx, pptx,
txt etc. Simple heuristic to determine the url to export
as well as create the target extension to avoid clobbering
of the original file on a re-sync.
This PR addresses issues #11, #31. It also potentially addresses #29 but the receipe will be fully complete once PR #32 or even better PR #39 gets merged.