Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for BDMV movie directories in native playback mode #330

Merged
merged 2 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions jellyfin_kodi/helper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from .utils import find
from .utils import event
from .utils import validate
from .utils import validate_bluray_dir
from .utils import values
from .utils import JSONRPC
from .utils import compare_version
Expand Down
15 changes: 15 additions & 0 deletions jellyfin_kodi/helper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,21 @@ def validate(path):
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):

''' Grab the values in the item for a list of keys {key},{key1}....
Expand Down
7 changes: 6 additions & 1 deletion jellyfin_kodi/objects/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import downloader as server
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 .obj import Objects
Expand Down Expand Up @@ -176,6 +176,11 @@ def get_path_filename(self, obj):
raise Exception("Failed to validate path. User stopped.")

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:
obj['Path'] = "plugin://plugin.video.jellyfin/%s/" % obj['LibraryId']
Expand Down