Skip to content

Commit

Permalink
feat: the Rolemixin metadata roles updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmeric committed Apr 26, 2024
1 parent fce8f6f commit d26360c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions ebu_tt_live/bindings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,9 @@ def _semantic_compute_roles(self, dataset):

if dataset.get('role_stack') and dataset['role_stack']:
current_roles.update(dataset['role_stack'][-1])
if dataset.get('metadata_roles') and dataset['metadata_roles']:
current_roles.update(dataset['metadata_roles'])
dataset['metadata_roles'].clear()

self._computed_roles = current_roles

Expand All @@ -598,10 +601,9 @@ def _semantic_push_computed_roles(self, dataset):
dataset['role_stack'].append(self._computed_roles)

def _semantic_pop_computed_roles(self, dataset):
if dataset.get('role_stack') and len(dataset['role_stack']) > 0:
if dataset.get('role_stack') and dataset['role_stack']:
dataset['role_stack'].pop()
if dataset.get('metadata_roles') and len(dataset['metadata_roles']) > 0:
self._computed_roles.update(dataset['metadata_roles'])
if dataset.get('metadata_roles') and dataset['metadata_roles']:
dataset['metadata_roles'].clear()

@property
Expand Down Expand Up @@ -2042,7 +2044,7 @@ def _semantic_before_traversal(
if self.role is not None:
if 'metadata_roles' not in dataset:
dataset['metadata_roles'] = set()
dataset['metadata_roles'].add(self.role)
dataset['metadata_roles'].update(self.role)


raw.d_metadata_type._SetSupersedingClass(d_metadata_type)
Expand Down
1 change: 0 additions & 1 deletion ebu_tt_live/xsd/ebutt_metadata.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Please note that the EBU-TT XML Schema is a helping document and NOT normative b
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" vc:minVersion="1.1">
<xs:import namespace="urn:ebu:tt:datatypes" schemaLocation="ebutt_datatypes.xsd"/>
<xs:import namespace="http://www.w3.org/ns/ttml#metadata" schemaLocation="metadata.xsd"/>
<xs:attribute name="role" type="xs:NMTOKENS"/>
<xs:complexType name="binaryData_type">
<xs:annotation>
<xs:documentation>Binary data of the input formats or associated documents used to
Expand Down

0 comments on commit d26360c

Please sign in to comment.