Repository navigation
drive: fix single Drive Document as FS root - #2016
Conversation
Allow using Drive Documents as FS root by doing a direcoty list during NewFS. Fixes rclone#1772
ncw
left a comment
There was a problem hiding this comment.
Code looks great - will merge
See inline for ideas to fix a different ticket :-)
| // return an error with an fs which points to the parent | ||
| return &newF, fs.ErrorIsFile | ||
| for _, e := range entries { | ||
| if _, isObject := e.(fs.Object); isObject && e.Remote() == remote { |
There was a problem hiding this comment.
I think this should probably check e.Remote() == remote first and do something if it was a directory too.
That will help with #1675
That issue is caused by a bug in drive which causes searching for directories with an accent not to be found so this branch of code will be entered when the thing missing is a directory too sometimes.
It isn't a 100% fix for #1675 but it would help.
Exactly what something should be I'm not sure, it it will probably involve poking the directory ID into directory cache...
I'm going to merge this as-is as it doesn't make #1675 any worse - do you fancy sending a follow-up for that issue?
There was a problem hiding this comment.
I looked into the issue and think the workaround should not be handled in NewFS.
The workaround i propose for #1675 handles all directory lookup's and not just the root case.
Allow using Drive Documents as FS root by doing a direcoty list during NewFS.
Fixes #1772