From 892dfa3b3f16f0ca759b82e20fb19dd70728023d Mon Sep 17 00:00:00 2001 From: gavanderhoorn Date: Sun, 29 Jan 2023 17:25:54 +0100 Subject: [PATCH] convenience: split retval of GTFILIST into actual list So caller doesn't have to. --- src/comet_rpc/messages.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/comet_rpc/messages.py b/src/comet_rpc/messages.py index f91d117..f9a6a32 100644 --- a/src/comet_rpc/messages.py +++ b/src/comet_rpc/messages.py @@ -177,7 +177,11 @@ class GetRawFileResponse(BaseRpcResponse): class GetFileListResponse(BaseRpcResponse): rpc: t.Literal[RpcId.GTFILIST] - value: str + value: t.List[str] + + @validator("value", pre=True) + def decode_value(cls, v): + return v.split(",") if isinstance(v, str) else v class TxMlCurPosResponse(BaseRpcResponse):