Nicolas
Nicolas

Reputation: 403

Using the Google Drive API, a unique folder is listed several times

I am using the Google Drive API to list my Google Drive files and I'm finding that one of the folders in my root is listed 3 times by the API.

The folder name (title) is the same but the ID is different. Modification dates are also different.

This is a folder that I often overwrite (usually once a day) in my physical drive (not using the API).

Does anyone have any idea why this would occur and how I can fix it? My only idea is to check all files with the same title (filename) and only keep the latest (as per the modified date) but that seems like something I shouldn't be doing.

Thanks

Upvotes: 0

Views: 660

Answers (1)

pinoyyid
pinoyyid

Reputation: 22306

If the ID is different, then you simply have 3 files with the same name. This is perfectly legal in Drive. It's possible that you have Trashed the two previous versions, but your query does not include 'trashed=false', so You're seeing the trashed files in your list.

Upvotes: 1

Related Questions