Skip to content

Commit aae1b06

Browse files
committed
fix: media_id TypeError
1 parent 15bd184 commit aae1b06

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

videodb/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ def upload(
5757
description,
5858
callback_url,
5959
)
60-
if upload_data.get("id").startswith("m-"):
60+
if upload_data.get("id", "").startswith("m-"):
6161
return Video(self, **upload_data) if upload_data else None
62-
elif upload_data.get("id").startswith("a-"):
62+
elif upload_data.get("id", "").startswith("a-"):
6363
return Audio(self, **upload_data) if upload_data else None
64-
elif upload_data.get("id").startswith("i-"):
64+
elif upload_data.get("id", "").startswith("i-"):
6565
return Image(self, **upload_data) if upload_data else None

videodb/collection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ def upload(
101101
description,
102102
callback_url,
103103
)
104-
if upload_data.get("id").startswith("m-"):
104+
if upload_data.get("id", "").startswith("m-"):
105105
return Video(self._connection, **upload_data) if upload_data else None
106-
elif upload_data.get("id").startswith("a-"):
106+
elif upload_data.get("id", "").startswith("a-"):
107107
return Audio(self._connection, **upload_data) if upload_data else None
108-
elif upload_data.get("id").startswith("i-"):
108+
elif upload_data.get("id", "").startswith("i-"):
109109
return Image(self._connection, **upload_data) if upload_data else None

0 commit comments

Comments
 (0)