The branch, frodo has been updated
via fceecf38dca866cc858ca6e9723daf24c9429b34 (commit)
from 627f98d28b7a9bfc37d9a3b2bf65dad8f6231b9c (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=fceecf38dca866cc858ca6e9723daf24c9429b34
commit fceecf38dca866cc858ca6e9723daf24c9429b34
Author: Martijn Kaijser <[email protected]>
Date: Mon Sep 30 10:31:40 2013 +0200
[script.lazytv] 0.1.12
diff --git a/script.lazytv/addon.xml b/script.lazytv/addon.xml
index 472bed7..1f5bfd7 100644
--- a/script.lazytv/addon.xml
+++ b/script.lazytv/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.lazytv"
name="LazyTV"
- version="0.1.11"
+ version="0.1.12"
provider-name="KodeKarnage">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
diff --git a/script.lazytv/changelog.txt b/script.lazytv/changelog.txt
index a9da2a0..6f3794e 100644
--- a/script.lazytv/changelog.txt
+++ b/script.lazytv/changelog.txt
@@ -12,4 +12,8 @@ added function to populate list of next to watch episodes for
all TV shows
added function to backfill watched status
0.1.10
-added optional Buggalo
\ No newline at end of file
+added optional Buggalo
+
+0.1.12
+multiple empty list fixes
+added option to select primary action on addon launch
\ No newline at end of file
diff --git a/script.lazytv/default.py b/script.lazytv/default.py
index 40b64e0..552a740 100644
--- a/script.lazytv/default.py
+++ b/script.lazytv/default.py
@@ -88,7 +88,7 @@ def criteria_filter():
all_s = json_query(show_request)['result']
#checks for the absence of unwatched tv shows in the library
- if 'tvshows' not in all_s.keys():
+ if 'tvshows' not in all_s:
all_shows = {}
else:
all_shows = all_s['tvshows']
@@ -111,7 +111,7 @@ def criteria_filter():
ep = json_query(episode_request)['result']
#accounts for the query not returning any TV shows
- if 'episodes' not in ep.keys():
+ if 'episodes' not in ep:
eps = {}
filtered_eps = []
filtered_showids = []
@@ -134,7 +134,10 @@ def smart_playlist_filter(playlist):
plf = {"jsonrpc": "2.0", "method": "Files.GetDirectory", "params":
{"directory": "placeholder", "media": "video"}, "id": 1}
plf['params']['directory'] = playlist
playlist_contents = json_query(plf)['result']['files']
- filtered_showids = [x['id'] for x in playlist_contents]
+ if 'id' in playlist_contents:
+ filtered_showids = [x['id'] for x in playlist_contents]
+ else:
+ filtered_showids = []
#retrieve all tv episodes and remove the episodes that are not in the
filtered show lisy
episode_request = {"jsonrpc": "2.0",
@@ -146,7 +149,7 @@ def smart_playlist_filter(playlist):
ep = json_query(episode_request)['result']
#accounts for the query not returning any TV shows
- if 'episodes' not in ep.keys():
+ if 'episodes' not in ep:
ep = {}
filtered_eps = []
else:
@@ -164,7 +167,7 @@ def smart_playlist_filter(playlist):
all_s = json_query(show_request)['result']
#checks for the absence of unwatched tv shows in the library
- if 'tvshows' not in all_s.keys():
+ if 'tvshows' not in all_s:
all_shows = {}
filtered_showids = []
else:
@@ -275,13 +278,12 @@ def create_playlist():
if not filtered_showids and partial_exists == False:
dialog.ok('LazyTV', lang(30150))
-
+
#loop to add more files to the playlist, the loop carries on until the
playlist is full or not shows are left in the show list
while itera in range((int(playlist_length)-1) if partial_exists == True
else int(playlist_length)):
#counts the number of shows in the showlist, if it is ever
empty, the loop ends
show_count = len(filtered_showids)
-
if show_count == 0 or not filtered_showids:
itera = 10000
@@ -295,20 +297,18 @@ def create_playlist():
this_show = [x for x in all_shows if x['tvshowid'] ==
SHOWID][0]
#ascertains the appropriate season and episode number
of the last watched show
- if SHOWID in playlist_tally.keys():
+ if SHOWID in playlist_tally:
#if the show is already in the tally, then use
that entry as the last show watched
Season = playlist_tally[SHOWID][0]
Episode = playlist_tally[SHOWID][1]
- elif this_show['watchedepisodes'] == 0 and premieres ==
'true':
-
+ elif this_show['watchedepisodes'] == 0:
#if the show doesnt have any watched episodes,
the season and episode are both zero
Season = 0
Episode = 0
else:
-
#creates a list of episodes for the show that
have been watched
played_eps = [x for x in eps if x['playcount']
is not 0 and x['tvshowid'] == SHOWID]
@@ -325,7 +325,11 @@ def create_playlist():
next_ep = sorted(unplayed_eps, key = lambda
unplayed_eps: (unplayed_eps['season'], unplayed_eps['episode']))
next_ep = filter(None, next_ep)
- #creates safe version of next episode
+ #removes the next_ep if it is the first in the series
and premieres arent wanted
+ if this_show['watchedepisodes'] == 0 and premieres ==
'false':
+ next_ep = []
+
+ #creates safe version of next episode
clean_next_ep = next_ep
#if there is no next episode then remove the show from
the show list, and start again
@@ -467,6 +471,14 @@ if __name__ == "__main__":
create_playlist()
elif primary_function == '1':
create_next_episode_list()
+ elif primary_function == '2':
+ choice = dialog.yesno('LazyTV',
lang(30158),'',lang(30159), lang(30160),lang(30161))
+ if choice == 1:
+ create_playlist()
+ elif choice == 0:
+ create_next_episode_list()
+ else:
+ pass
except Exception:
proglog.close()
buggalo.onExceptionRaised()
@@ -481,6 +493,14 @@ if __name__ == "__main__":
create_playlist()
elif primary_function == '1':
create_next_episode_list()
+ elif primary_function == '2':
+ choice = dialog.yesno('LazyTV',
lang(30158),'',lang(30159), lang(30160),lang(30161))
+ if choice == 1:
+ create_playlist()
+ elif choice == 0:
+ create_next_episode_list()
+ else:
+ pass
except:
proglog.close()
dialog.ok('LazyTV', lang(30156), lang(30157))
diff --git a/script.lazytv/resources/language/English/strings.po
b/script.lazytv/resources/language/English/strings.po
index 477cff4..4df5aac 100644
--- a/script.lazytv/resources/language/English/strings.po
+++ b/script.lazytv/resources/language/English/strings.po
@@ -101,6 +101,10 @@ msgctxt "#30073"
msgid "Produce a list of 'next episodes' for each TV series"
msgstr ""
+msgctxt "#30088"
+msgid "Let me choose on launch"
+msgstr ""
+
msgctxt "#30074"
msgid "Populate based on ..."
msgstr ""
@@ -160,7 +164,7 @@ msgid "Choose Show"
msgstr ""
#dialog
-#empty strings from id 30088 to 30100
+#empty strings from id 30089 to 30100
msgctxt "#30101"
msgid "TV Shows"
@@ -239,4 +243,23 @@ msgstr "
msgctxt "#30157"
msgid "Install Buggalo 1.1.5 or higher to report the details of the error to
the author."
-msgstr "
\ No newline at end of file
+msgstr "
+
+
+#Choice at launch
+
+msgctxt "#30158"
+msgid "This addon finds the next episode in each TV show."
+msgstr "
+
+msgctxt "#30159"
+msgid "Do you want a list or a randomised playlist?"
+msgstr "
+
+msgctxt "#30160"
+msgid "Show me"
+msgstr "
+
+msgctxt "#30161"
+msgid "Surprise me"
+msgstr "
diff --git a/script.lazytv/resources/settings.xml
b/script.lazytv/resources/settings.xml
index d9f21fe..c0c56af 100644
--- a/script.lazytv/resources/settings.xml
+++ b/script.lazytv/resources/settings.xml
@@ -22,7 +22,7 @@
</category>
<category label="30070">
<setting type="lsep" label="30071"/>
- <setting id="primary_function" type="enum" label=""
lvalues="30072|30073"/>
+ <setting id="primary_function" type="enum" label=""
lvalues="30072|30073|30088"/>
<setting id="sort_list_by" type="enum" label="30079" enable="eq(-1,1)"
lvalues="30080|30081"/>
<setting type="lsep" label="30074"/>
<setting id="populate_by" type="enum" label=""
lvalues="30075|30076|30077"/>
-----------------------------------------------------------------------
Summary of changes:
script.lazytv/.gitattributes | 22 --
script.lazytv/.gitignore | 215 --------------------
script.lazytv/addon.xml | 2 +-
script.lazytv/changelog.txt | 6 +-
script.lazytv/default.py | 44 +++-
.../resources/language/English/strings.po | 27 +++-
script.lazytv/resources/settings.xml | 2 +-
7 files changed, 64 insertions(+), 254 deletions(-)
delete mode 100644 script.lazytv/.gitattributes
delete mode 100644 script.lazytv/.gitignore
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons