Improve reliability in Kodi song playback
This commit is contained in:
parent
fcb5e131dc
commit
9e7868141d
1 changed files with 9 additions and 0 deletions
|
@ -15,6 +15,7 @@ from . import utils
|
||||||
from . import path_ops
|
from . import path_ops
|
||||||
from . import json_rpc as js
|
from . import json_rpc as js
|
||||||
from . import variables as v
|
from . import variables as v
|
||||||
|
from . import state
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
@ -342,6 +343,14 @@ def verify_kodi_item(plex_id, kodi_item):
|
||||||
if plex_id is not None or kodi_item.get('id') is not None:
|
if plex_id is not None or kodi_item.get('id') is not None:
|
||||||
# Got all the info we need
|
# Got all the info we need
|
||||||
return kodi_item
|
return kodi_item
|
||||||
|
# Special case playlist startup - got type but no id
|
||||||
|
if (not state.DIRECT_PATHS and state.ENABLE_MUSIC and
|
||||||
|
kodi_item.get('type') == v.KODI_TYPE_SONG and
|
||||||
|
kodi_item['file'].startswith('http')):
|
||||||
|
kodi_item['id'], _ = kodidb.kodiid_from_filename(kodi_item['file'],
|
||||||
|
v.KODI_TYPE_SONG)
|
||||||
|
LOG.debug('Detected song. Research results: %s', kodi_item)
|
||||||
|
return kodi_item
|
||||||
# Need more info since we don't have kodi_id nor type. Use file path.
|
# Need more info since we don't have kodi_id nor type. Use file path.
|
||||||
if (kodi_item['file'].startswith('plugin') or
|
if (kodi_item['file'].startswith('plugin') or
|
||||||
kodi_item['file'].startswith('http')):
|
kodi_item['file'].startswith('http')):
|
||||||
|
|
Loading…
Add table
Reference in a new issue