更新
This commit is contained in:
parent
7a9383b550
commit
64bee1de43
@ -151,9 +151,9 @@ class PikPakFileSystem:
|
||||
return node
|
||||
return None
|
||||
|
||||
async def _refresh(self, node : NodeBase):
|
||||
async def _refresh(self, node : NodeBase, no_cache : bool = False):
|
||||
if isinstance(node, DirNode):
|
||||
if node.lastUpdate != None:
|
||||
if not no_cache and node.lastUpdate != None:
|
||||
return
|
||||
next_page_token : str = None
|
||||
children_info : list[Dict[str, Any]] = []
|
||||
@ -283,11 +283,11 @@ class PikPakFileSystem:
|
||||
await self._refresh(node)
|
||||
return node.url
|
||||
|
||||
async def GetChildrenNames(self, path : str, ignore_files : bool) -> list[str]:
|
||||
async def GetChildrenNames(self, path : str, ignore_files : bool, no_cache : bool = False) -> list[str]:
|
||||
node = await self._path_to_node(path)
|
||||
if not isinstance(node, DirNode):
|
||||
return []
|
||||
await self._refresh(node)
|
||||
await self._refresh(node, no_cache)
|
||||
children_names : list[str] = []
|
||||
for child_id in node.children_id:
|
||||
child = await self._get_node_by_id(child_id)
|
||||
|
@ -9,7 +9,7 @@ class Aria2Status(Enum):
|
||||
COMPLETE = "complete"
|
||||
REMOVED = "removed"
|
||||
|
||||
ARIA_ADDRESS = "http://100.96.0.2:6800/jsonrpc"
|
||||
ARIA_ADDRESS = "http://192.168.31.21:30001/jsonrpc"
|
||||
ARIA_SECRET = "jfaieofjosiefjoiaesjfoiasejf"
|
||||
BASE_PATH = "/downloads"
|
||||
|
||||
|
2
main.py
2
main.py
@ -197,7 +197,7 @@ class App(cmd2.Cmd):
|
||||
List files in a directory
|
||||
"""
|
||||
if await Client.IsDir(args.path):
|
||||
for child_name in await Client.GetChildrenNames(args.path, False):
|
||||
for child_name in await Client.GetChildrenNames(args.path, False, True):
|
||||
await self.print(child_name)
|
||||
else:
|
||||
await self.print(await Client.GetFileUrlByPath(args.path))
|
||||
|
Loading…
x
Reference in New Issue
Block a user