yana-shick / portfolio

My Portfolio
0 stars 0 forks source link

steps of a deep copy function for backup #1

Open yana-shick opened 1 month ago

yana-shick commented 1 month ago
  1. get all files (from list of the folders)
  2. extract only not a folder type files
  3. add them to a result list (list of all files that needed to be copied to backup)
  4. extract only folder type files
  5. copy them to the backup???
  6. call this function again

format of a file: [ { mimeType: 'image/jpeg', parents: [ '1-lYUIl10crOouudYoaFke1CqdT-uNd_h' ], id: '1SJMHMrhESYLro3iQeCDaDX3rXocpylix', name: 'bird.jpg' } ]

format of a copied folder: [ { kind: 'drive#file', id: '1vEt7GcbXlmEl5YYtXvx84INv-N6YXu1C', name: 'insideInsideFolder', mimeType: 'application/vnd.google-apps.folder' }]

yana-shick commented 1 month ago

after adding target parent to all files:

{ mimeType: 'application/vnd.google-apps.folder', parents: [ '1-lYUIl10crOouudYoaFke1CqdT-uNd_h' ], id: '11l3jQHsZifiAlTZxjBGXVDZty7QV6qfo', name: 'First', parentTargetId: '1nvtvcOUsIgDde8MlFS3Lekb5Bs1Ny8Xa' }