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

jottacloud: support userinfo feature and make link return direct download link #5399

Merged
merged 2 commits into from Oct 20, 2021

Conversation

albertony
Copy link
Contributor

@albertony albertony commented Jun 10, 2021

What is the purpose of this change?

Two small improvements to Jottacloud backend:

  1. Add support for UserInfo feature
    • Not sure exactly what information to return... Docs says "details of the person logged in to the cloud storage system". Not many backends seem to implement this feature, so not much precedence to look at. Is it for specific "information about person", or is it for a wider scope - dump of any user/account/person related information?
    • I'm currently returning username, name, email, account type and subscription type, from the CustomerInfo response from backend:
      Username string `json:"username"`
      Email string `json:"email"`
      Name string `json:"name"`
      CountryCode string `json:"country_code"`
      LanguageCode string `json:"language_code"`
      CustomerGroupCode string `json:"customer_group_code"`
      BrandCode string `json:"brand_code"`
      AccountType string `json:"account_type"`
      SubscriptionType string `json:"subscription_type"`
      Usage int64 `json:"usage"`
      Quota int64 `json:"quota"`
      BusinessUsage int64 `json:"business_usage"`
      BusinessQuota int64 `json:"business_quota"`
      WriteLocked bool `json:"write_locked"`
      ReadLocked bool `json:"read_locked"`
      LockedCause interface{} `json:"locked_cause"`
      WebHash string `json:"web_hash"`
      AndroidHash string `json:"android_hash"`
      IOSHash string `json:"ios_hash"`
  2. Change link command from returning web url to returning a direct download link, which is the preferred strategy as mentioned here: Creating direct link with "rclone link" #5381 (comment)
    • If the shared path is a directory, then the download will be a zip archive.

Was the change discussed in an issue or in the forum before?

Fixes #5391

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

Copy link
Member

@buengese buengese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backend changes look good to me.

I'm not entirely fond of the inconsistent behavior for rclone link with some backends providing a web interface link and some backends providing a direct link, though I guess this has already been the case for a long time.

@ivandeex
Copy link
Member

ivandeex commented Oct 7, 2021

@ncw Please review

@albertony albertony added this to the v1.57 milestone Oct 18, 2021
@albertony albertony mentioned this pull request Oct 18, 2021
@ncw
Copy link
Member

ncw commented Oct 20, 2021

What is the purpose of this change?

Two small improvements to Jottacloud backend:

  1. Add support for UserInfo feature

    • Not sure exactly what information to return... Docs says "details of the person logged in to the cloud storage system". Not many backends seem to implement this feature, so not much precedence to look at. Is it for specific "information about person", or is it for a wider scope - dump of any user/account/person related information?

I put that in in order to satisfy the Google Photos integration requirements. The user should be able to run it to see which account they are using...

  • I'm currently returning username, name, email, account type and subscription type

...and that sounds perfect :-)

  1. Change link command from returning web url to returning a direct download link, which is the preferred strategy as mentioned here: Creating direct link with "rclone link" #5381 (comment)

    • If the shared path is a directory, then the download will be a zip archive.

OK!

Will review now.

ncw
ncw approved these changes Oct 20, 2021
Copy link
Member

@ncw ncw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great - thank you :-)

Please merge!

@albertony albertony merged commit b868561 into rclone:master Oct 20, 2021
11 checks passed
albertony added a commit that referenced this pull request Oct 20, 2021
@albertony albertony deleted the jottacloud_userinfo branch October 20, 2021 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jottacloud: Create direct link with "rclone link"
4 participants