Fix optional Jellyfin RunTimeTicks (#108254)

This commit is contained in:
Jan Stienstra 2024-03-11 19:09:18 +01:00 committed by GitHub
parent 145657dc21
commit ff4e9eb31e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,7 +150,9 @@ class JellyfinMediaPlayer(JellyfinEntity, MediaPlayerEntity):
media_content_type = CONTENT_TYPE_MAP.get(self.now_playing["Type"], None)
media_content_id = self.now_playing["Id"]
media_title = self.now_playing["Name"]
media_duration = int(self.now_playing["RunTimeTicks"] / 10000000)
if "RunTimeTicks" in self.now_playing:
media_duration = int(self.now_playing["RunTimeTicks"] / 10000000)
if media_content_type == MediaType.EPISODE:
media_content_type = MediaType.TVSHOW