client: dry

This commit is contained in:
Christoph Polcin 2015-12-09 10:02:37 +01:00
parent b12f1c1b33
commit 8f99657223

View File

@ -92,15 +92,14 @@ func (c *Client) ReadDir(path string) ([]os.FileInfo, error) {
f.name = p.Name f.name = p.Name
} }
f.path = path + f.name f.path = path + f.name
f.modified = parseModified(&p.Modified)
if p.Type.Local == "collection" { if p.Type.Local == "collection" {
f.path += "/" f.path += "/"
f.size = 0 f.size = 0
f.modified = parseModified(&p.Modified)
f.isdir = true f.isdir = true
} else { } else {
f.size = parseInt64(&p.Size) f.size = parseInt64(&p.Size)
f.modified = parseModified(&p.Modified)
f.isdir = false f.isdir = false
} }