From 4d793b8ee842b177225e730a8c099edd54ccaeda Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 9 Jun 2018 12:00:50 +0100 Subject: [PATCH] drive: remove part of workaround for #1675 Now that https://issuetracker.google.com/issues/64468406 has been fixed, we can remove part of the workaround which fixed #1675 - 019adc35609c2136 This will make queries marginally more efficient. We still need the other part of the workaround since the `=` operator is case insensitive. --- backend/drive/drive.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/drive/drive.go b/backend/drive/drive.go index d64b7ac81..5609ba3b6 100644 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -294,8 +294,7 @@ func (f *Fs) list(dirID string, title string, directoriesOnly bool, filesOnly bo searchTitle = strings.Replace(searchTitle, `'`, `\'`, -1) // Convert / to / for search searchTitle = strings.Replace(searchTitle, "/", "/", -1) - // use contains to work around #1675 - query = append(query, fmt.Sprintf("name contains '%s'", searchTitle)) + query = append(query, fmt.Sprintf("name='%s'", searchTitle)) } if directoriesOnly { query = append(query, fmt.Sprintf("mimeType='%s'", driveFolderType)) @@ -343,7 +342,8 @@ OUTER: for _, item := range files.Files { // Convert / to / for listing purposes item.Name = strings.Replace(item.Name, "/", "/", -1) - // skip items introduced by workaround (#1675) + // Check the case of items is correct since + // the `=` operator is case insensitive. if title != "" && title != item.Name { continue }