This commit is contained in:
angelblue05 2016-06-19 16:24:34 -05:00
commit a8fd73740c
5 changed files with 76 additions and 82 deletions

View file

@ -1,25 +1,30 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings>
<!-- Add-on settings -->
<string id="29999">Emby for Kodi</string>
<string id="30000">Primary Server Address</string><!-- Verified -->
<string id="30002">Play from HTTP instead of SMB</string><!-- Verified -->
<string id="30004">Log level</string><!-- Verified -->
<string id="30005">Username: </string>
<string id="30006">Password: </string>
<string id="30024">Username</string><!-- Verified -->
<string id="30030">Port Number</string><!-- Verified -->
<!-- Add-on settings -->
<string id="30007">Network Username: </string>
<string id="30008">Network Password: </string>
<string id="30009">Transcode: </string>
<string id="30010">Enable Performance Profiling</string>
<string id="30011">Local caching system</string>
<string id="30014">Emby</string>
<string id="30015">Network</string>
<string id="30016">Device Name</string>
<string id="30022">Advanced</string>
<string id="30024">Username</string><!-- Verified -->
<string id="30030">Port Number</string><!-- Verified -->
<string id="30036">Number of recent Movies to show:</string>
<string id="30037">Number of recent TV episodes to show:</string>
<string id="30035">Number of recent Music Albums to show:</string>
@ -141,7 +146,7 @@
<string id="30166">Transcoding</string>
<string id="30167">Server Detection Succeeded</string>
<string id="30168">Found server</string>
<string id="30169">Address : </string>
<string id="30169">Address:</string>
<!-- Video nodes -->
<string id="30170">Recently Added TV Shows</string><!-- Verified -->
@ -175,7 +180,8 @@
<string id="30198">Search</string>
<string id="30199">Set Views</string>
<string id="30200">Select User</string>
<string id="30200">Select User</string><!-- Verified -->
<string id="30201">Profiling enabled.</string>
<string id="30202">Please remember to turn off when finished testing.</string>
<string id="30203">Error in ArtworkRotationThread</string>
@ -262,6 +268,12 @@
<string id="30409">Delete item from the server</string>
<!-- add-on settings -->
<string id="30000">Primary Server Address</string><!-- Verified -->
<string id="30002">Play from HTTP instead of SMB</string><!-- Verified -->
<string id="30004">Log level</string><!-- Verified -->
<string id="30024">Username</string><!-- Verified -->
<string id="30030">Port Number</string><!-- Verified -->
<string id="30500">Verify Host SSL Certificate</string>
<string id="30501">Client SSL certificate</string>
<string id="30502">Use alternate address</string>
@ -299,7 +311,8 @@
<string id="30534">Server messages</string>
<string id="30535">Generate a new device Id</string>
<string id="30536">Sync when screensaver is deactivated</string>
<string id="30537">Force Transcode Hi10P</string>
<string id="30537">Force Transcode Hi10P</string>
<string id="30538">Disabled</string>
<!-- service add-on -->
<string id="33000">Welcome</string>
@ -337,4 +350,12 @@
<string id="33032">Failed to generate a new device Id. See your logs for more information.</string>
<string id="33033">A new device Id has been generated. Kodi will now restart.</string>
<string id="33034">Proceed with the following server?</string>
<string id="33035">Caution! If you choose Native mode, certain Emby features will be missing, such as: Emby cinema mode, direct stream/transcode options and parental access schedule.</string>
<string id="33036">Addon (Default)</string>
<string id="33037">Native (Direct Paths)</string>
<string id="33038">"Add network credentials to allow Kodi access to your content? Important: Kodi will need to be restarted to see the credentials. They can also be added at a later time.</string>
<string id="33039">Disable Emby music library?</string>
<string id="33040">Direct stream the music library? Select this option if the music library will be remotely accessed.</string>
</strings>

View file

@ -25,15 +25,15 @@ class InitialSetup():
global log
log = Logging(self.__class__.__name__).log
self.clientInfo = clientinfo.ClientInfo()
self.addonId = self.clientInfo.getAddonId()
self.doUtils = downloadutils.DownloadUtils()
self.addonId = clientinfo.ClientInfo().getAddonId()
self.doUtils = downloadutils.DownloadUtils().downloadUrl
self.userClient = userclient.UserClient()
def setup(self):
# Check server, user, direct paths, music, direct stream if not direct path.
addonId = self.addonId
dialog = xbmcgui.Dialog()
##### SERVER INFO #####
@ -54,10 +54,10 @@ class InitialSetup():
xbmc.executebuiltin('Addon.OpenSettings(%s)' % addonId)
return
else:
server_confirm = xbmcgui.Dialog().yesno(
heading="Emby for Kodi",
line1="Proceed with the following server?",
line2="%s %s" % (lang(30169), server))
server_confirm = dialog.yesno(
heading=lang(29999),
line1=lang(33034),
line2="%s %s" % (lang(30169), server))
if server_confirm:
# Correct server found
log("Server is selected. Saving the information.", 1)
@ -75,9 +75,8 @@ class InitialSetup():
##### USER INFO #####
log("Getting user list.", 1)
url = "%s/emby/Users/Public?format=json" % server
result = self.doUtils.downloadUrl(url, authenticate=False)
result = self.doUtils("%s/emby/Users/Public?format=json" % server, authenticate=False)
if result == "":
log("Unable to connect to %s" % server, 1)
return
@ -97,7 +96,7 @@ class InitialSetup():
users_hasPassword.append(name)
log("Presenting user list: %s" % users_hasPassword, 1)
user_select = xbmcgui.Dialog().select(lang(30200), users_hasPassword)
user_select = dialog.select(lang(30200), users_hasPassword)
if user_select > -1:
selected_user = usernames[user_select]
log("Selected user: %s" % selected_user, 1)
@ -105,38 +104,30 @@ class InitialSetup():
else:
log("No user selected.", 1)
xbmc.executebuiltin('Addon.OpenSettings(%s)' % addonId)
return
##### ADDITIONAL PROMPTS #####
dialog = xbmcgui.Dialog()
directPaths = dialog.yesno(
heading="Playback Mode",
line1=(
"Caution! If you choose Native mode, you "
"will lose access to certain Emby features such as: "
"Emby cinema mode, direct stream/transcode options, "
"parental access schedule."),
nolabel="Addon (Default)",
yeslabel="Native (Direct Paths)")
heading=lang(30511),
line1=lang(33035),
nolabel=lang(33036),
yeslabel=lang(33037))
if directPaths:
log("User opted to use direct paths.", 1)
settings('useDirectPaths', value="1")
# ask for credentials
credentials = dialog.yesno(
heading="Network credentials",
line1= (
"Add network credentials to allow Kodi access to your "
"content? Note: Skipping this step may generate a message "
"during the initial scan of your content if Kodi can't "
"locate your content."))
heading=lang(30517),
line1= lang(33038))
if credentials:
log("Presenting network credentials dialog.", 1)
passwordsXML()
musicDisabled = dialog.yesno(
heading="Music Library",
line1="Disable Emby music library?")
heading=lang(29999),
line1=lang(33039))
if musicDisabled:
log("User opted to disable Emby music library.", 1)
settings('enableMusic', value="false")
@ -144,11 +135,8 @@ class InitialSetup():
# Only prompt if the user didn't select direct paths for videos
if not directPaths:
musicAccess = dialog.yesno(
heading="Music Library",
line1=(
"Direct stream the music library? Select "
"this option only if you plan on listening "
"to music outside of your network."))
heading=lang(29999),
line1=lang(33040))
if musicAccess:
log("User opted to direct stream music.", 1)
settings('streamMusic', value="true")

View file

@ -33,7 +33,7 @@
<setting id="imageCacheLimit" type="enum" label="30513" values="Disabled|5|10|15|20|25" default="0" visible="eq(-1,true)" subsetting="true" />
<setting id="syncEmptyShows" type="bool" label="30508" default="false" />
<setting id="dbSyncScreensaver" label="30536" type="bool" default="false" />
<setting id="useDirectPaths" type="enum" label="30511" values="Addon(Default)|Native(Direct paths)" default="0" />
<setting id="useDirectPaths" type="enum" label="30511" lvalues="33036|33037" default="0" />
<setting id="enableMusic" type="bool" label="30509" default="true" />
<setting id="streamMusic" type="bool" label="30510" default="false" visible="eq(-1,true)" subsetting="true" />
<setting type="lsep" label="30523" />