event_parser: make id optional
Build and test / build (push) Waiting to run
Build and test / check (push) Waiting to run
Build and test / test (push) Waiting to run
Build and test / docs (push) Waiting to run

This commit is contained in:
2024-12-15 15:31:01 +01:00
parent 00cae63272
commit e3297bef15
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -109,7 +109,7 @@ pub enum Event {
VideoReconfig,
AudioReconfig,
PropertyChange {
id: u64,
id: Option<u64>,
name: String,
data: Option<MpvDataType>,
},
@@ -296,7 +296,7 @@ fn parse_client_message(event: &Map<String, Value>) -> Result<Event, MpvError> {
}
fn parse_property_change(event: &Map<String, Value>) -> Result<Event, MpvError> {
let id = get_key_as!(as_u64, "id", event);
let id = get_optional_key_as!(as_u64, "id", event);
let property_name = get_key_as!(as_str, "name", event);
let data = event.get("data").map(json_to_value).transpose()?;