Implemented writing of numerical strings.
This commit is contained in:
parent
58fee40de5
commit
8554ef8d81
3 changed files with 19 additions and 3 deletions
|
@ -81,13 +81,17 @@ class _ID3(SmallTag, tinytag._ID3):
|
|||
def _compose_id3v2_frame(self, field_name, field_value) -> bytes:
|
||||
frame_id = bytes(self._ID3_WRITE_MAPPING[field_name], "ISO-8859-1")
|
||||
|
||||
field_value = field_value[0]
|
||||
if isinstance(field_value, list):
|
||||
field_value = field_value[0]
|
||||
|
||||
if isinstance(field_value, str):
|
||||
frame_value = b"\x00" + bytes(field_value, "ISO-8859-1")
|
||||
|
||||
elif isinstance(field_value, int) and frame_id.startswith(b"T"):
|
||||
frame_value = b"\x00" + bytes(str(field_value), "ISO-8859-1")
|
||||
|
||||
else:
|
||||
print(f"Writing of {field_name} is not implemented.")
|
||||
print(f"Writing of '{field_name}' (type {type(field_value)}) is not implemented.")
|
||||
return b""
|
||||
|
||||
frame_size = pack("4B", *self._synchsafe(len(frame_value)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue