Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rachpt committed May 27, 2020
1 parent db32090 commit 80a2b8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions cloud189/api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,15 @@ def _get_one_page(page: int=1) -> bool:
name = item['fileName']
fid = item['fileId']
pid = item['parentId']
opt_time = item['lastOpTime']
ctime = item['createTime']
optime = item['lastOpTime']
size = item['fileSize']
ftype = item['fileType']
durl = item['downloadUrl']
isFolder = item['isFolder']
isFamily = item['isFamilyFile']
path = item['pathStr']
all_file_lists.append(RecInfo(name, fid, pid, opt_time, size, ftype, durl, isFolder, isFamily, path, familyId))
all_file_lists.append(RecInfo(name, fid, pid, ctime, optime, size, ftype, durl, isFolder, isFamily, path, familyId))
logger.debug(f"RecycleBin{page=}: {resp['recordCount']=}, {resp['pageNum']=}, {resp['pageSize']=}")
return resp['recordCount'] > resp['pageNum'] * resp['pageSize']
while _get_one_page(page): # TODO(rachpt): 大于 60 条记录需要验证是否正确
Expand Down
4 changes: 2 additions & 2 deletions cloud189/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def get_absolute_path(self, fid) -> str:
res = ''
if item := self.find_by_id(fid):
if item.pid:
res = self.get_absolute_path(item.pid) + item.name
res = self.get_absolute_path(item.pid) + '/' + item.name
else:
res = item.name + '/' + res
res = item.name + res
return res

def get_path_id(self) -> dict:
Expand Down
2 changes: 1 addition & 1 deletion cloud189/api/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
_file_info = ('name', 'id', 'pid', 'ctime', 'optime', 'size', 'ftype', 'isFolder', 'isStarred', 'account', 'durl', 'count')
FileInfo = namedtuple('FileInfo', _file_info, defaults=('',) * len(_file_info))
# 回收站文件
RecInfo = namedtuple('RecInfo', ['name', 'id', 'pid', 'time', 'size', 'type', 'durl', 'isFolder', 'isFamily', 'path', 'fid'], defaults=('',) * 11)
RecInfo = namedtuple('RecInfo', ['name', 'id', 'pid', 'ctime', 'optime', 'size', 'type', 'durl', 'isFolder', 'isFamily', 'path', 'fid'], defaults=('',) * 12)
# 文件路径
PathInfo = namedtuple('PathInfo', ['name', 'id', 'isCoShare'])

Expand Down

0 comments on commit 80a2b8e

Please sign in to comment.