Skip to content

Commit 899116a

Browse files
committed
fix: lxml.etree.tostring returns ASCII
Not a bug, but decoding ASCII should be faster.
1 parent 097147f commit 899116a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

bbblb/model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,8 @@ class PlaybackFormat(Base):
545545
recording: Mapped[Recording] = relationship(back_populates="formats")
546546
format: Mapped[str] = mapped_column(nullable=False)
547547

548-
# We need this for getMeetings search results, so store it ...
548+
# Parts of the XML can contain arbitrary extentions, so we keep it
549+
# around for getRecordings requests.
549550
xml: Mapped[str] = mapped_column(nullable=False)
550551

551552

bbblb/services/recording.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _format_from_metadata(metadata_xml: "FormatXMLWrapper", recording: model.Rec
119119
return model.PlaybackFormat(
120120
recording=recording,
121121
format=metadata_xml.format,
122-
xml=lxml.etree.tostring(metadata_xml.playback_node).decode("UTF-8"),
122+
xml=lxml.etree.tostring(metadata_xml.playback_node).decode("ASCII"),
123123
)
124124

125125

0 commit comments

Comments
 (0)