Choose to replace user ratings with #media versions

This commit is contained in:
tomkat83 2017-05-31 14:13:45 +02:00
parent 8282283a65
commit d4c290effb
6 changed files with 32 additions and 4 deletions

View file

@ -1944,3 +1944,13 @@ msgstr ""
msgctxt "#39717" msgctxt "#39717"
msgid "PKC uses free additional artwork from www.themoviedb.org. Many thanks!" msgid "PKC uses free additional artwork from www.themoviedb.org. Many thanks!"
msgstr "" msgstr ""
# Shown during very first PKC setup only
msgctxt "#39718"
msgid "Do you want to replace your custom user ratings with an indicator of how many versions of a media item you posses?"
msgstr ""
# In PKC Settings under Sync
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr ""

View file

@ -1288,10 +1288,17 @@ class API():
except (KeyError, ValueError): except (KeyError, ValueError):
lastPlayedDate = None lastPlayedDate = None
try: if state.INDICATE_MEDIA_VERSIONS is True:
userrating = int(float(item['userRating']))
except (KeyError, ValueError):
userrating = 0 userrating = 0
for entry in self.item.findall('./Media'):
userrating += 1
# Don't show a value of '1'
userrating = 0 if userrating == 1 else userrating
else:
try:
userrating = int(float(item['userRating']))
except (KeyError, ValueError):
userrating = 0
try: try:
rating = float(item['audienceRating']) rating = float(item['audienceRating'])

View file

@ -488,10 +488,16 @@ class InitialSetup():
if dialog.yesno(heading=lang(29999), line1=lang(39061)): if dialog.yesno(heading=lang(29999), line1=lang(39061)):
log.debug("User opted to use FanArtTV") log.debug("User opted to use FanArtTV")
settings('FanartTV', value="true") settings('FanartTV', value="true")
# Do you want to replace your custom user ratings with an indicator of
# how many versions of a media item you posses?
if dialog.yesno(heading=lang(29999), line1=lang(39718)):
log.debug("User opted to replace user ratings with version number")
settings('indicate_media_versions', value="true")
# If you use several Plex libraries of one kind, e.g. "Kids Movies" and # If you use several Plex libraries of one kind, e.g. "Kids Movies" and
# "Parents Movies", be sure to check https://goo.gl/JFtQV9 # "Parents Movies", be sure to check https://goo.gl/JFtQV9
dialog.ok(heading=lang(29999), line1=lang(39076)) dialog.ok(heading=lang(29999), line1=lang(39076))
# Need to tell about our image source for collections: themoviedb.org # Need to tell about our image source for collections: themoviedb.org
dialog.ok(heading=lang(29999), line1=lang(39717)) dialog.ok(heading=lang(29999), line1=lang(39717))
# Make sure that we only ask these questions upon first installation # Make sure that we only ask these questions upon first installation

View file

@ -22,6 +22,8 @@ RESTRICTED_USER = False
# Direct Paths (True) or Addon Paths (False)? Along with # Direct Paths (True) or Addon Paths (False)? Along with
# window('useDirectPaths') # window('useDirectPaths')
DIRECT_PATHS = False DIRECT_PATHS = False
# Shall we replace custom user ratings with the number of versions available?
INDICATE_MEDIA_VERSIONS = False
# Along with window('plex_authenticated') # Along with window('plex_authenticated')
AUTHENTICATED = False AUTHENTICATED = False

View file

@ -165,6 +165,8 @@ class UserClient(threading.Thread):
if settings('useDirectPaths') == "1" else 'false') if settings('useDirectPaths') == "1" else 'false')
state.DIRECT_PATHS = True if settings('useDirectPaths') == "1" \ state.DIRECT_PATHS = True if settings('useDirectPaths') == "1" \
else False else False
state.INDICATE_MEDIA_VERSIONS = True \
if settings('indicate_media_versions') == "true" else False
window('plex_force_transcode_pix', value='true' window('plex_force_transcode_pix', value='true'
if settings('force_transcode_pix') == "1" else 'false') if settings('force_transcode_pix') == "1" else 'false')

View file

@ -59,6 +59,7 @@
<setting id="dbSyncScreensaver" type="bool" label="39062" default="false" /><!--Sync when screensaver is deactivated--> <setting id="dbSyncScreensaver" type="bool" label="39062" default="false" /><!--Sync when screensaver is deactivated-->
<setting type="lsep" label="30538" /><!-- Complete Re-Sync necessary --> <setting type="lsep" label="30538" /><!-- Complete Re-Sync necessary -->
<setting id="indicate_media_versions" type="bool" label="39719" default="false" /><!-- Replace user ratings with number of versions -->
<setting id="enableMusic" type="bool" label="30509" default="true" /> <setting id="enableMusic" type="bool" label="30509" default="true" />
<setting id="useDirectPaths" type="enum" label="30511" values="Addon(Default)|Native(Direct paths)" default="0" visible="true"/> <!-- Playback mode --> <setting id="useDirectPaths" type="enum" label="30511" values="Addon(Default)|Native(Direct paths)" default="0" visible="true"/> <!-- Playback mode -->