summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ninjacloud.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ninjacloud.go b/src/ninjacloud.go
index f15d7f1..5632709 100644
--- a/src/ninjacloud.go
+++ b/src/ninjacloud.go
@@ -234,10 +234,12 @@ func listDir(path string, recursive bool, filter []string, returnType string) (l
234 var e element 234 var e element
235 modTime := strconv.FormatInt(d.ModTime().UnixNano(), 10) 235 modTime := strconv.FormatInt(d.ModTime().UnixNano(), 10)
236 modTime = modTime[:len(modTime)-6] 236 modTime = modTime[:len(modTime)-6]
237 uri := filepath.Clean(path + "/" + d.Name()) 237 uri := path + "/" + d.Name()
238 uri = filepath.Clean(drivePrefix + projectsDir + "/" + uri)
239 uri = filepath.ToSlash(uri)
238 e.Type = "directory" 240 e.Type = "directory"
239 e.Name = d.Name() 241 e.Name = d.Name()
240 e.Uri = filepath.Clean(drivePrefix + projectsDir + "/" + uri) 242 e.Uri = uri
241 e.CreationDate = modTime // TODO 243 e.CreationDate = modTime // TODO
242 e.ModifiedDate = modTime 244 e.ModifiedDate = modTime
243 e.Size = strconv.FormatInt(d.Size(), 10) 245 e.Size = strconv.FormatInt(d.Size(), 10)
@@ -260,9 +262,11 @@ func listDir(path string, recursive bool, filter []string, returnType string) (l
260 var e element 262 var e element
261 modTime := strconv.FormatInt(d.ModTime().UnixNano(), 10) 263 modTime := strconv.FormatInt(d.ModTime().UnixNano(), 10)
262 modTime = modTime[:len(modTime)-6] 264 modTime = modTime[:len(modTime)-6]
265 uri := filepath.Clean(drivePrefix + projectsDir + "/" + path + "/" + d.Name())
266 uri = filepath.ToSlash(uri)
263 e.Type = "file" 267 e.Type = "file"
264 e.Name = d.Name() 268 e.Name = d.Name()
265 e.Uri = filepath.Clean(drivePrefix + projectsDir + "/" + path + "/" + d.Name()) 269 e.Uri = uri
266 e.CreationDate = modTime // TODO 270 e.CreationDate = modTime // TODO
267 e.ModifiedDate = modTime 271 e.ModifiedDate = modTime
268 e.Size = strconv.FormatInt(d.Size(), 10) 272 e.Size = strconv.FormatInt(d.Size(), 10)