prasmussen / gdrive

Google Drive CLI Client
MIT License
8.99k stars 1.19k forks source link

Duplicate filenames when downloading folder #115

Open hansdg1 opened 8 years ago

hansdg1 commented 8 years ago

I am trying to download a folder recursively, but I am running into the problem of duplicate filenames on the server. The folder is my Google Photos folder, and somehow over time I've ended up with multiple files named the same thing (ex: multiple "2016-03-05.jpg"). Even though the files share the same name, they are not duplicates.

Is there any way to handle this? Maybe add a ".1" or something to the end of the downloaded file?

rpgoldman commented 5 years ago

I am having this problem, too, but it's not a problem of there being really duplicates there. I have deleted my file main.pdf, and that file is missing from the synced folder on MacOS. But when I try to download the folder containing main.pdf recursively, not only does gdrive download, it tries to download the same (by name) file twice. Here's what I see:

Downloading main.pdf -> mirror/full-proposal/main.pdf
...
Downloading main.pdf -> mirror/full-proposal/main.pdf
File 'mirror/full-proposal/main.pdf' already exists, use --force to overwrite

... and then gdrive errors out.

It seems like what might be happening is that gdrive dowload is downloading even trashed files:

$ gdrive list --max 1000 --config .gdrive --query "'<FOO>' in parents and name = 'main.pdf' and trashed != true" 
Id   Name   Type   Size   Created
$ 

When I do not check for trashed != true I find multiple files with the name main.pdf.

Is there by any chance a work-around?