Skip to content

Copy to gdrive with gdocs conversion #2046

Closed

Description

@dav1303

Hi

In some cases users want to let Microsoft Office because of ans oldest version or not want to pay for a new license.

Is it possible to add à flag to launch the conversion of an office
Document to is équivalent un gdocs when making a copy ?

Regards

Activity

  1. B4dM4n commented on Feb 6, 2018

    @B4dM4n
    Collaborator

    This sounds like a good idea and would complete document handling for drive.

    The problem is that rclone can't verify the checksum or size when doing server side conversions. You would have to run it with --ignore-size to upload files.
    It should nevertheless be possible to implement this feature.

    I suggest --drive-import-formats as a new parameter to specify the wanted conversions. By default this has to be disabled, because the document conversion is not lossless and can not be reverted.

    The --drive-formats should probably be renamed to --drive-export-formats to make the difference between both clearer.

  2. dav1303 commented on Feb 16, 2018

    @dav1303
    Author

    @B4dM4n Did you plan to integrate this feature ?

  3. B4dM4n commented on Feb 19, 2018

    @B4dM4n
    Collaborator

    Yes, I'm working on this (see B4dM4n/rclone#drive_import_formats)
    It should be working already, but I would like to implement some tests to verify this.

    @ncw I would like to add some tests to drive_test.go but I know it is generated from gen_tests.go. Any advice how I could add something like TestInternal to run before TestFinalise?

    Edit:
    How about this optional InternalTester interface for Fs?
    This would generate a TestInternal function for each backend which checks for the interface and calls it when it exists.

    diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.go
    index 34229608..96b1ae21 100644
    --- a/fstest/fstests/fstests.go
    +++ b/fstest/fstests/fstests.go
    @@ -57,6 +57,11 @@ var (
            isLocalRemote bool
     )
     
    +// InternalTester is an optional interface for Fs which allows to execute internal tests
    +type InternalTester interface {
    +       InternalTest(*testing.T)
    +}
    +
     // ExtraConfigItem describes a config item added on the fly while testing
     type ExtraConfigItem struct{ Name, Key, Value string }
     
    @@ -975,6 +980,16 @@ func TestObjectPurge(t *testing.T) {
            assert.Error(t, err, "Expecting error after on second purge")
     }
     
    +// TestInternal calls InternalTest() on the Fs
    +func TestInternal(t *testing.T) {
    +       skipIfNotOk(t)
    +       if it, ok := remote.(InternalTester); ok {
    +               it.InternalTest(t)
    +       } else {
    +               t.Skipf("%T does not implement InternalTester", remote)
    +       }
    +}
    +
     // TestFinalise tidies up after the previous tests
     func TestFinalise(t *testing.T) {
            skipIfNotOk(t)

    The interface can be implemented in the backend_internal_test.go (subtests are only available on on go1.7+):

    func (fs *Fs) InternalTest(t *testing.T) {
           t.Run("InternalTestA", func(t *testing.T) {
                   // ...
           })
    }
  4. dav1303 commented on Feb 21, 2018

    @dav1303
    Author
  5. dav1303 commented on Mar 3, 2018

    @dav1303
    Author

    @B4dM4n have you finish your tests ?

    Can i help you on tests ?

  6. dav1303 commented on May 1, 2018

    @dav1303
    Author

    Hello

    Some news around that enhancement ?

    Thanks

  7. dav1303 commented on May 20, 2018

    @dav1303
    Author

    Hello

    @B4dM4n any news arround this feature ?

  8. B4dM4n commented on Jul 27, 2018

    @B4dM4n
    Collaborator

    @dav1303
    Sorry for the delay, but I didn't have time in the last weeks to work on this issue.

    The problem I'm facing is mapping the real filename to a Google document name and back to a real filename for copy and sync to work properly.
    I think I found a solution and will try to implement it in time for rclone v1.43.

  9. dav1303 commented on Jul 28, 2018

    @dav1303
    Author

    Hi
    No problem
    Take your time i would just want to follow.
    Regards

  10. added this to the Help Wanted milestone on Aug 30, 2018
  11. B4dM4n commented on Sep 1, 2018

    @B4dM4n
    Collaborator

    There has been progress for this issue:
    #2479 is a work in progress rewrite of the drive documents handling.
    If anyone wants to help testing the new implementation, there is a beta branch containing the changes:
    https://beta.rclone.org/branch/v1.42-162-g6a66967c-drive-documents/

    Keep in mind this is not tested thoroughly yet and therefore be considered experimental.

    Please post any feedback in #2479. Updated releases will also be anounced there.

  12. modified the milestones: Help Wanted, v1.44 on Oct 4, 2018
  13. B4dM4n commented on Oct 4, 2018

    @B4dM4n
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions