mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-09-18 12:34:39 +00:00
Fix fetching videoversion itemtype and gracefully handle failure
This commit is contained in:
parent
2ca9cf212b
commit
fbfce5c423
1 changed files with 10 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division, absolute_import, print_function, unicode_literals
|
||||
|
||||
from sqlite3 import DatabaseError
|
||||
|
||||
##################################################################################################
|
||||
|
||||
from ...helper import LazyLogger
|
||||
|
@ -17,11 +19,18 @@ LOG = LazyLogger(__name__)
|
|||
|
||||
class Movies(Kodi):
|
||||
|
||||
itemtype: int
|
||||
|
||||
def __init__(self, cursor):
|
||||
|
||||
self.cursor = cursor
|
||||
Kodi.__init__(self)
|
||||
self.itemtype = self.cursor.execute(QU.get_videoversion_itemtype, [40400])
|
||||
try:
|
||||
self.cursor.execute(QU.get_videoversion_itemtype, [40400])
|
||||
self.itemtype = self.cursor.fetchone()[0]
|
||||
except (IndexError, DatabaseError, TypeError) as e:
|
||||
LOG.warning("Unable to fetch videoversion itemtype: %s", e)
|
||||
self.itemtype = 0
|
||||
|
||||
def create_entry_unique_id(self):
|
||||
self.cursor.execute(QU.create_unique_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue