func LinkOrCopyFromReference(oid string, size int64) error { if ObjectExistsOfSize(oid, size) { return nil } altMediafile := LocalReferencePath(oid) mediafile, err := LocalMediaPath(oid) if err != nil { return err } if altMediafile != "" && tools.FileExistsOfSize(altMediafile, size) { return LinkOrCopy(altMediafile, mediafile) } return nil }
func ObjectExistsOfSize(oid string, size int64) bool { path := localstorage.Objects().ObjectPath(oid) return tools.FileExistsOfSize(path, size) }