few small changes to the auto play logic

This commit is contained in:
faush01
2020-06-23 19:42:17 +10:00
parent 867545a9b3
commit 7edede7707
5 changed files with 12 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.embycon"
name="EmbyCon"
version="1.9.90"
version="1.9.91"
provider-name="Team B">
<requires>
<import addon="xbmc.python" version="2.25.0"/>

View File

@@ -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)

View File

@@ -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"

View File

@@ -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)

View File

@@ -40,10 +40,12 @@
<setting id="audio_playback_bitrate" type="select" label="30418" values="128|160|192|256|320|384|448|640" default="256" visible="true"/>
<setting id="audio_max_channels" type="slider" label="30420" default="8" range="2,1,8" option="int" visible="true"/>
<!--
<setting label="30209" type="lsep"/>
<setting type="sep" />
<setting id="smbusername" type="text" label="30007" default="" enable="true" visible="true"/>
<setting id="smbpassword" type="text" label="30008" default="" option="hidden" enable="true" visible="true"/>
-->
</category>
<category label="30214">