Specify folder parameter for folder-based filter#361
Specify folder parameter for folder-based filter#361ryanseys wants to merge 1 commit intogoogleapis:masterfrom ryanseys:storage-folders
Conversation
|
Agh, tags. What ones do I use?? I just added a boat-load of them. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Lol What does the API response ( |
|
|
Looks something like |
|
What if on the File object itself, it had a "folder" property that was it's prefix? I don't think an array of prefixes is too useful. |
|
Yeah, thought of that too! A complaint I have with that with doing that is that suddenly everyone's code will need to handle the case where the file isn't actually a file and has no metadata or id or anything, and just contains a folder property instead. |
|
How would that happen? I'm envisioning: bucket.getFiles(function(err, files) {
files[0].name = 'iamin/a/folder.jpg'
files[0].folder = 'iamin/a'
files[1].name = 'iamnotinafolder.jpg'
files[0].folder = undefined
});Though, chasing this thought down, I'm still not sure that's a helpful bit of knowledge to have. If I really wanted to, I could use the native |
|
The problem with your example is that the files might not exist but the folders would. Also, |
|
Because, the |
|
My head is spinning a bit, because I still don't see the value to a user. There's clear value to var folders = { dir1: [], dir2: [] };
Object.keys(folders).forEach(function(folder) {
bucket.getFiles({ folder: folder }, function (err, files) {
folders[folder] = files;
});
});Hope I'm not overlooking something obvious. As is evident from my history on this project, it sometimes just takes a while for me to understand the Google APIs :) // also, would it be useful / possible to accept |
|
Yeah my head is spinning too. In this case I think it's best if we just find the simplest way to return the parameter rather than potentially messing up some folder-related methods that we don't fully understand. |
|
Ok, no |
|
I'll let you make the call on this. |
|
Yeah, I've decided this idea sucks. Will reconsider #342 or something similar. |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.0.2` -> `^8.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/7.0.2/8.0.0) | --- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-asset).
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Add folder-based filtering to
Bucket#getFileswith afolderquery parameter.Also implemented weird idea for returning prefixes for #342. I'm not sure how bad an idea it is, but basically return the
prefixesas a property of thefilesArray. Yes, a property on an Array... How bad of an idea is that? 👶