diff --git a/addon.xml b/addon.xml index 650a211..f725e5a 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/lib/downloadutils.py b/resources/lib/downloadutils.py index 84cc987..15cb0d4 100644 --- a/resources/lib/downloadutils.py +++ b/resources/lib/downloadutils.py @@ -178,6 +178,7 @@ class DownloadUtils: profile = { "Name": "Kodi", + "MaxStaticBitrate": bitrate, "MaxStreamingBitrate": bitrate, "MusicStreamingTranscodingBitrate": audio_bitrate, "TimelineOffsetSeconds": 5, @@ -186,12 +187,10 @@ class DownloadUtils: "Type": "Audio" }, { - # "Container": "m3u8", "Container": "ts", "Protocol": "hls", "Type": "Video", "AudioCodec": audio_codec, - # "AudioBitrate": audio_bitrate, "VideoCodec": "h264", "MaxAudioChannels": audio_max_channels }, @@ -322,9 +321,9 @@ class DownloadUtils: } if force_transcode: - url = "{server}/emby/Items/%s/PlaybackInfo?EnableDirectPlay=false&EnableDirectStream=false" % item_id + url = "{server}/emby/Items/%s/PlaybackInfo?MaxStreamingBitrate=%s&EnableDirectPlay=false&EnableDirectStream=false" % (item_id, bitrate) else: - url = "{server}/emby/Items/%s/PlaybackInfo" % item_id + url = "{server}/emby/Items/%s/PlaybackInfo?MaxStreamingBitrate=%s" % (item_id, bitrate) log.debug("PlaybackInfo : {0}", url) log.debug("PlaybackInfo : {0}", profile) diff --git a/resources/lib/play_utils.py b/resources/lib/play_utils.py index 8e14319..af5141e 100644 --- a/resources/lib/play_utils.py +++ b/resources/lib/play_utils.py @@ -61,7 +61,7 @@ def play_all_files(items, monitor): playurl, playback_type, listitem_props = PlayUtils().get_play_url(selected_media_source) log.info("Play URL: {0} PlaybackType: {1} ListItem Properties: {2}", playurl, playback_type, listitem_props) - if playurl in None: + if playurl is None: return playback_type_string = "DirectPlay" @@ -156,6 +156,9 @@ def add_to_playlist(play_info, monitor): playurl, playback_type, listitem_props = PlayUtils().get_play_url(selected_media_source) log.info("Play URL: {0} PlaybackType: {1} ListItem Properties: {2}", playurl, playback_type, listitem_props) + if playurl is None: + return + playback_type_string = "DirectPlay" if playback_type == "2": playback_type_string = "Transcode" diff --git a/resources/lib/utils.py b/resources/lib/utils.py index eae0e5c..cc7eaf9 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -74,7 +74,7 @@ class PlayUtils: playback_type = None # check if file can be directly played - if allow_direct_file_play and (can_direct_play or container == "dvd" or container == "bluray"): + if allow_direct_file_play and can_direct_play: direct_path = media_source["Path"] direct_path = direct_path.replace("\\", "/") direct_path = direct_path.strip() @@ -86,12 +86,7 @@ class PlayUtils: direct_path = direct_path + "/BDMV/index.bdmv" if direct_path.startswith("//"): - smb_username = addon_settings.getSetting('smbusername') - smb_password = addon_settings.getSetting('smbpassword') - if not smb_username: - direct_path = "smb://" + direct_path[2:] - else: - direct_path = "smb://" + smb_username + ':' + smb_password + '@' + direct_path[2:] + direct_path = "smb://" + direct_path[2:] log.debug("playback_direct_path: {0}", direct_path) diff --git a/resources/settings.xml b/resources/settings.xml index 21ff1ac..49ad5b8 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -40,10 +40,12 @@ +