split metadata into lines (if more than one was received)
This commit is contained in:
parent
175e140f86
commit
307e944911
17
owrx/meta.py
17
owrx/meta.py
@ -155,12 +155,13 @@ class MetaParser(Parser):
|
|||||||
"NXDN": RadioIDEnricher("nxdn", self),
|
"NXDN": RadioIDEnricher("nxdn", self),
|
||||||
}
|
}
|
||||||
|
|
||||||
def parse(self, meta):
|
def parse(self, raw: str):
|
||||||
fields = meta.split(";")
|
for meta in raw.split("\n"):
|
||||||
meta = {v[0]: ":".join(v[1:]) for v in map(lambda x: x.split(":"), fields) if v[0] != ""}
|
fields = meta.split(";")
|
||||||
|
meta = {v[0]: ":".join(v[1:]) for v in map(lambda x: x.split(":"), fields) if v[0] != ""}
|
||||||
|
|
||||||
if "protocol" in meta:
|
if "protocol" in meta:
|
||||||
protocol = meta["protocol"]
|
protocol = meta["protocol"]
|
||||||
if protocol in self.enrichers:
|
if protocol in self.enrichers:
|
||||||
meta = self.enrichers[protocol].enrich(meta)
|
meta = self.enrichers[protocol].enrich(meta)
|
||||||
self.handler.write_metadata(meta)
|
self.handler.write_metadata(meta)
|
||||||
|
Loading…
Reference in New Issue
Block a user