Git Product home page Git Product logo

Comments (11)

LynMoe avatar LynMoe commented on August 26, 2024

可以是可以,但是主要担心两个点

  1. 这样做了之后是不是会把你拥有的所有文件都扫描一次,这也许不是程序想要做的
  2. 之前尝试过好像不可以扫描到云端硬盘里的内容,如果确认可以可以给个反馈我有空看看

以及印象中无论什么账号个人空间都只有5T的说

from core.

yuanqiuye avatar yuanqiuye commented on August 26, 2024

@isXiaoLin

首先關於帳號的個人空間,Google的說明如下:

G Suite 教育版提供使用者多少儲存空間?
每位使用者都擁有無限的儲存空間,可供 Google 雲端硬碟、Gmail 和 Google 相簿共用。如果貴機構中的使用者不超過 4 人,每位使用者可獲得 1 TB 的儲存空間。

還有關於第二點:

  • google drive api v3 - drive_list:
{
 "kind": "drive#driveList",
 "drives": []
}

可以看到沒有共享driver:
11

  • 但如果是上述用user list files的情況:
 "kind": "drive#fileList",
 "nextPageToken": "........",
 "incompleteSearch": false,
 "files": [
  {
   "kind": "drive#file",
   "id": ".......",
   "name": "jav_test",
   "mimeType": "application/vnd.google-apps.folder"
  },
  {
   "kind": "drive#file",
   "id": "............",
   "name": "test.txt",
   "mimeType": "text/plain"
  },
  .............................

就可以讀到個人雲端的資料,關於第一點,如果有 'your_folder_id' in parents的條件,讓用戶自己指定要掃描的範圍應該還好,再者,其實掃shared drive也是差不多的道理ww,感謝作者的回復!

from core.

LynMoe avatar LynMoe commented on August 26, 2024

image
关于个人空间还是存疑,因为我个人使用的是 G Suite Business

API 接口的话应该近日有空会更新,感谢分享 :)

from core.

yuanqiuye avatar yuanqiuye commented on August 26, 2024

2222

看起來是翻譯問題hhh,簡體中文的翻譯表達模糊ww

from core.

LynMoe avatar LynMoe commented on August 26, 2024

试验了一下发现并不可行..

'folderId' in parents 代表的是 folderId 这个目录是要搜索文件的直属上级目录, 如果是间接上级目录的话就搜索不到文件了, 所以...

from core.

yuanqiuye avatar yuanqiuye commented on August 26, 2024

我大概看了一下,大概有幾種實現方式:

  • 先用上述的方法Query一次,存下結果,如果回傳的檔案類型有folder,就繼續遞迴,正常來講根據這個專案的儲存資料格式,應該只會遞迴一次(如果整個sync同步到父資料夾),但效率不明
  • 利用API v2的children:list,但資料格式轉換會比較麻煩
  • 直接無視folder,全硬碟搜索info.json?感覺走回原路ww

Drive API v3真的比v2麻煩許多。。。我之前都是實作v2的API

感謝作者對我這小小需求的回復ww

from core.

LynMoe avatar LynMoe commented on August 26, 2024

第一种递归就算了吧....太浪费时间了

至于第二种试了一下还是不能搜索到子目录的子目录下的文件,而且返回的格式好像怪怪的?

第三种的话....嗯...

from core.

yuanqiuye avatar yuanqiuye commented on August 26, 2024

翻了好多實例,看來的確沒有一種直接的方式能夠一次Query搞定...如果不方便實作的話,我自己依照我的需求更改代碼就好,不好意思麻煩了w

from core.

LynMoe avatar LynMoe commented on August 26, 2024

实现起来并不麻烦,只是感觉效率有点低

要做的话可以在数据库 drivers 表中的 driverData 里面添加几个识别字段,然后在 src/import/driver/googleDrive.js 中做相应的修改和判断就行了 (抓取目录中 info.json 文件的代码部分只在这里出现)

当然如果写完愿意提个 PR 就更棒啦~

from core.

yuanqiuye avatar yuanqiuye commented on August 26, 2024

#18
請作者參閱PR (跪

from core.

LynMoe avatar LynMoe commented on August 26, 2024

已在 0e3767c 中支持

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.