mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Merge pull request #330 from YK-Samgo/master
Add support for BDMV movie directories in native playback mode
This commit is contained in:
commit
44d4080daf
3 changed files with 22 additions and 1 deletions
|
@ -13,6 +13,7 @@ from .utils import dialog
|
||||||
from .utils import find
|
from .utils import find
|
||||||
from .utils import event
|
from .utils import event
|
||||||
from .utils import validate
|
from .utils import validate
|
||||||
|
from .utils import validate_bluray_dir
|
||||||
from .utils import values
|
from .utils import values
|
||||||
from .utils import JSONRPC
|
from .utils import JSONRPC
|
||||||
from .utils import compare_version
|
from .utils import compare_version
|
||||||
|
|
|
@ -261,6 +261,21 @@ def validate(path):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def validate_bluray_dir(path):
|
||||||
|
|
||||||
|
''' Verify if path/BDMV/ is accessible.
|
||||||
|
'''
|
||||||
|
|
||||||
|
path = path + '/BDMV/'
|
||||||
|
|
||||||
|
if not xbmcvfs.exists(path):
|
||||||
|
return False
|
||||||
|
|
||||||
|
window('jellyfin_pathverified.bool', True)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def values(item, keys):
|
def values(item, keys):
|
||||||
|
|
||||||
''' Grab the values in the item for a list of keys {key},{key1}....
|
''' Grab the values in the item for a list of keys {key},{key1}....
|
||||||
|
|
|
@ -8,7 +8,7 @@ from kodi_six.utils import py2_encode
|
||||||
|
|
||||||
import downloader as server
|
import downloader as server
|
||||||
from database import jellyfin_db, queries as QUEM
|
from database import jellyfin_db, queries as QUEM
|
||||||
from helper import api, stop, validate, jellyfin_item, library_check, values, Local
|
from helper import api, stop, validate, validate_bluray_dir, jellyfin_item, library_check, values, Local
|
||||||
from helper import LazyLogger
|
from helper import LazyLogger
|
||||||
|
|
||||||
from .obj import Objects
|
from .obj import Objects
|
||||||
|
@ -176,6 +176,11 @@ class Movies(KodiDb):
|
||||||
raise Exception("Failed to validate path. User stopped.")
|
raise Exception("Failed to validate path. User stopped.")
|
||||||
|
|
||||||
obj['Path'] = obj['Path'].replace(obj['Filename'], "")
|
obj['Path'] = obj['Path'].replace(obj['Filename'], "")
|
||||||
|
'''check bluray directries and point it to ./BDMV/index.bdmv'''
|
||||||
|
if validate_bluray_dir(obj['Path'] + obj['Filename']):
|
||||||
|
obj['Path'] = obj['Path'] + obj['Filename'] + '/BDMV/'
|
||||||
|
obj['Filename'] = 'index.bdmv'
|
||||||
|
LOG.debug("Bluray directry %s",obj['Path'])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
obj['Path'] = "plugin://plugin.video.jellyfin/%s/" % obj['LibraryId']
|
obj['Path'] = "plugin://plugin.video.jellyfin/%s/" % obj['LibraryId']
|
||||||
|
|
Loading…
Reference in a new issue