diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a9b34bad..1e01a61b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -234,6 +234,8 @@ jobs: dockerhub-sync-readme: runs-on: ubuntu-latest + permissions: + contents: read if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.update_readme == 'true') steps: - name: Sync README diff --git a/app/library/DataStore.py b/app/library/DataStore.py index 96c64a3d..691f034f 100644 --- a/app/library/DataStore.py +++ b/app/library/DataStore.py @@ -46,7 +46,7 @@ class DataStore: return any((key and self.dict[i].info._id == key) or (url and self.dict[i].info.url == url) for i in self.dict) - def get(self, key: str, url: str | None = None) -> Download: + def get(self, key: str | None = None, url: str | None = None) -> Download: if not key and not url: msg = "key or url must be provided." raise KeyError(msg) diff --git a/app/library/HttpSocket.py b/app/library/HttpSocket.py index 190221ec..988608de 100644 --- a/app/library/HttpSocket.py +++ b/app/library/HttpSocket.py @@ -117,7 +117,9 @@ class HttpSocket: @staticmethod def _injector(func, event: str): - async def wrapper(sid, data, **kwargs): + async def wrapper(sid, data=None, **kwargs): + if not data: + data = {} return await Services.get_instance().handle_async(func, sid=sid, data=data, event=event, **kwargs) return wrapper diff --git a/app/routes/socket/connection.py b/app/routes/socket/connection.py index d1d49f9e..7977fe06 100644 --- a/app/routes/socket/connection.py +++ b/app/routes/socket/connection.py @@ -34,11 +34,12 @@ async def connect(config: Config, queue: DownloadQueue, notify: EventBus, sid: s @route(RouteType.SOCKET, "disconnect", "socket_disconnect") -async def disconnect(sid: str, data: str = None): +async def disconnect(sio: socketio.AsyncServer, sid: str, data: str = None): """ Handle client disconnection. Args: + sio (socketio.AsyncServer): The Socket.IO server instance. sid (str): The session ID of the client. data (str): The reason for disconnection. @@ -47,7 +48,7 @@ async def disconnect(sid: str, data: str = None): for event in _Data.subscribers: if sid in _Data.subscribers[event]: - await unsubscribe(sid=sid, data=event) + await unsubscribe(sio=sio, sid=sid, data=event) @route(RouteType.SOCKET, "subscribe", "socket_subscribe") diff --git a/ui/components/ConfirmDialog.vue b/ui/components/ConfirmDialog.vue index 19998c26..04f2afe6 100644 --- a/ui/components/ConfirmDialog.vue +++ b/ui/components/ConfirmDialog.vue @@ -8,7 +8,8 @@