File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 1212 SubtitleAlignment ,
1313 SubtitleBorderStyle ,
1414 SubtitleStyle ,
15+ TextStyle ,
1516)
1617from videodb .client import Connection
1718from videodb .exceptions import (
3738 "SubtitleAlignment" ,
3839 "SubtitleBorderStyle" ,
3940 "SubtitleStyle" ,
41+ "TextStyle" ,
4042]
4143
4244
Original file line number Diff line number Diff line change @@ -123,15 +123,18 @@ def __repr__(self) -> str:
123123class TextAsset (MediaAsset ):
124124 def __init__ (
125125 self ,
126+ text : str ,
126127 duration : Optional [int ] = None ,
127128 style : TextStyle = TextStyle (),
128129 ) -> None :
129- super ().__init__ (f"t-{ str (uuid .uuid4 ())} " )
130+ super ().__init__ (f"txt-{ str (uuid .uuid4 ())} " )
131+ self .text = text
130132 self .duration = duration
131133 self .style : TextStyle = style
132134
133135 def to_json (self ) -> dict :
134136 return {
137+ "text" : copy .deepcopy (self .text ),
135138 "asset_id" : copy .deepcopy (self .asset_id ),
136139 "duration" : copy .deepcopy (self .duration ),
137140 "style" : copy .deepcopy (self .style .__dict__ ),
@@ -140,6 +143,7 @@ def to_json(self) -> dict:
140143 def __repr__ (self ) -> str :
141144 return (
142145 f"TextAsset("
146+ f"text={ self .text } , "
143147 f"asset_id={ self .asset_id } , "
144148 f"duration={ self .duration } , "
145149 f"style={ self .style } )"
You can’t perform that action at this time.
0 commit comments