2014-02-03, 12:16
You have to name your playlist !!
<name>Genre</name> or <name>Action</name>
<name>Genre</name> or <name>Action</name>
12:58:15 T:1276 WARNING: XFILE::CDirectoryFactory::Create - Unsupported protocol(image) in image://smb%3a%2f%2fFileserver-pc%2fh%2f90%27s%2fHey%20Arnold%2fHey%20Arnold%20-%20Season%205%2fhey%20arnold!%20-%205x08%20-%20suspended%20%7e%20ernie%20in%20love-thumb.jpg/
12:58:17 T:1276 WARNING: XFILE::CDirectoryFactory::Create - Unsupported protocol(image) in image://smb%3a%2f%2fFileserver-pc%2fh%2f90%27s%2fSpider-Man%20The%20Animated%20Series%2fSpider-Man%20TAS%20-%20Season%202%20-%20The%20Neogenic%20Nightmare%2fSpider-Man%20TAS%20-%20S2E07%20-%20Neogenic%20Nightmare%20Chapter%207%20-%20Enter%20The%20Punisher-thumb.jpg/
12:58:18 T:2688 WARNING: XFILE::CDirectoryFactory::Create - Unsupported protocol(image) in image://smb%3a%2f%2fFileserver-pc%2fh%2f90%27s%2fHey%20Arnold%2fHey%20Arnold%20-%20Season%205%2fhey%20arnold!%20-%205x08%20-%20suspended%20%7e%20ernie%20in%20love-thumb.jpg/
12:58:19 T:1276 WARNING: XFILE::CDirectoryFactory::Create - Unsupported protocol(image) in image://smb%3a%2f%2fFileserver-pc%2fh%2f90%27s%2fSpider-Man%20The%20Animated%20Series%2fSpider-Man%20TAS%20-%20Season%202%20-%20The%20Neogenic%20Nightmare%2fSpider-Man%20TAS%20-%20S2E07%20-%20Neogenic%20Nightmare%20Chapter%207%20-%20Enter%20The%20Punisher-thumb.jpg/
12:58:20 T:2688 WARNING: XFILE::CDirectoryFactory::Create - Unsupported protocol(image) in image://smb%3a%2f%2fFileserver-pc%2fh%2f90%27s%2fBill%20Nye%20the%20Science%20Guy%2fBill%20Nye%20The%20Science%20Guy%20S03E05%20Energy-thumb.jpg/
12:58:20 T:2688 WARNING: XFILE::CDirectoryFactory::Create - Unsupported protocol(image) in image://smb%3a%2f%2fFileserver-pc%2fh%2f90%27s%2fFreaks%20%26%20Geeks%2fFreaks%20%26%20Geeks%20-%20S01E16%20(Smooching%20%26%20Mooching)-thumb.jpg/
12:58:20 T:2688 WARNING: XFILE::CDirectoryFactory::Create - Unsupported protocol(image) in image://smb%3a%2f%2fFileserver-pc%2fh%2f90%27s%2fFreakazoid%2fFreakazoid%20-%202x08%20-%20Island%20of%20Dr.%20Mystico-thumb.jpg/
12:58:21 T:2688 WARNING: XFILE::CDirectoryFactory::Create - Unsupported protocol(image) in image://smb%3a%2f%2fFileserver-pc%2fh%2f90%27s%2fJohnny%20Bravo%2fSeason%202%2fJohnny%20Bravo%20-%202x26%20-%20Alien%20Confidential-thumb.jpg/
(2014-02-09, 23:04)Quiksmage Wrote: New question, so I'm making a separate post.
Are these lists cached? Some of my playlists take a lonnnng time before the recently added shows up (10+ minutes on the larger tv ones containing 6000 episodes).
It doesn't appear to be, as when I restart xbmc the lists are blank as they load again. If it isn't cached is there any way to make the load times on these faster? My movies section, which has about 600 movies, takes roughly a minute to load the recently added.
(2014-02-11, 12:18)mikebzh44 Wrote: Sorry but as the script return statistics about playlists (total number of items, number of item viewed and unviewed), I have to go through the entire playlist to calculate them.
So with huge library like yours, it take a loooooong time
def _timeTook( t ):
t = ( time.time() - t )
if t >= 60: return "%.3fm" % ( t / 60.0 )
return "%.3fs" % ( t )
(2014-02-11, 16:50)mikebzh44 Wrote: Function _timeTook is for calculating script running time. So nothing to do with watched / unwatched.
For example, look at _getMovies function. line 105, we use Files.GetDirectories function with playlist (xsp file) as argument to retrieve movies from the playlist.
And you can compare this function to _fetch_movies from service.skin.widget.
In service.skin.widget, line 165, JSON query can be reduce because you only need to get LIMIT latest movies ("limits": {"end": %d}), as statistics for standard library (Total number of movies, Number of movies watched, unwatched) are given by XBMC.
But for my script, I cannot use "limits": {"end": %d} because even if you just want the last 10 movies from your playlist, I have to submit query on the entire smart playlist in order to calculate how many movies you get, how many movies are watched / unwatched. By puting "limits": {"end": %d} in JSON query, your statistics will be wrong as the total number of movies will be equal to 10 (depend on skin parameter).
So, if you want to speed up the script you have to look at service.skin.widget function and add limits to JSON queries.
@Martijn : Does this script can be replace by this new feature from Gotham :
http://forum.xbmc.org/showthread.php?tid...pid1612262
http://forum.xbmc.org/showthread.php?tid=176864
Sorry but I don't understand very well BigNoid answer and I don't know if this script won't be required any more for populating widgets in Gotham.
Thanks.
(2014-02-11, 17:32)mikebzh44 Wrote: No, I'm not saying that you should use skin widgets. Skin widget is for default library, not for smart playlists.
I just say that if you want to speed up THIS script with YOUR HUGE library, you have to add limits in JSON query the way Martijn did in skin widget function but your statistics will be wrong because Ace use limit=12 parameter. So every custom menu based on smart playlist will display a total of 12 movies, even if your smart playlist contains hundreds of movies.
def _fetch_movies(self, request):
if not xbmc.abortRequested:
json_string = '{"jsonrpc": "2.0", "id": 1, "method": "VideoLibrary.GetMovies", "params": {"properties": ["title", "originaltitle", "playcount", "year", "genre", "studio", "country", "tagline", "plot", "runtime", "file", "plotoutline", "lastplayed", "trailer", "rating", "resume", "art", "streamdetails", "mpaa", "director"], "limits": {"end": %d},' %self.LIMIT
if request == 'RecommendedMovie':
json_query = xbmc.executeJSONRPC('%s "sort": {"order": "descending", "method": "lastplayed"}, "filter": {"field": "inprogress", "operator": "true", "value": ""}}}' %json_string)
elif request == 'RecentMovie' and self.RECENTITEMS_UNPLAYED:
json_query = xbmc.executeJSONRPC('%s "sort": {"order": "descending", "method": "dateadded"}, "filter": {"field": "playcount", "operator": "is", "value": "0"}}}' %json_string)
elif request == 'RecentMovie':
json_query = xbmc.executeJSONRPC('%s "sort": {"order": "descending", "method": "dateadded"}}}' %json_string)
elif request == "RandomMovie" and self.RANDOMITEMS_UNPLAYED:
json_query = xbmc.executeJSONRPC('%s "sort": {"method": "random" }, "filter": {"field": "playcount", "operator": "lessthan", "value": "1"}}}' %json_string)
else:
json_query = xbmc.executeJSONRPC('%s "sort": {"method": "random" } }}' %json_string)
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_query = simplejson.loads(json_query)
if json_query.has_key('result') and json_query['result'].has_key('movies'):
self._clear_properties(request)
count = 0
for item in json_query['result']['movies']:
count += 1
if (item['resume']['position'] and item['resume']['total'])> 0:
resume = "true"
played = '%s%%'%int((float(item['resume']['position']) / float(item['resume']['total'])) * 100)
else:
resume = "false"
played = '0%'
if item['playcount'] >= 1:
watched = "true"
else:
watched = "false"
if not self.PLOT_ENABLE and watched == "false":
plot = __localize__(32014)
else:
plot = item['plot']
art = item['art']
path = media_path(item['file'])
play = 'XBMC.RunScript(' + __addonid__ + ',movieid=' + str(item.get('movieid')) + ')'
streaminfo = media_streamdetails(item['file'].encode('utf-8').lower(),
item['streamdetails'])
self.WINDOW.setProperty("%s.%d.DBID" % (request, count), str(item.get('movieid')))
self.WINDOW.setProperty("%s.%d.Title" % (request, count), item['title'])
self.WINDOW.setProperty("%s.%d.OriginalTitle" % (request, count), item['originaltitle'])
self.WINDOW.setProperty("%s.%d.Year" % (request, count), str(item['year']))
self.WINDOW.setProperty("%s.%d.Genre" % (request, count), " / ".join(item['genre']))
self.WINDOW.setProperty("%s.%d.Studio" % (request, count), item['studio'][0])
self.WINDOW.setProperty("%s.%d.Country" % (request, count), item['country'][0])
self.WINDOW.setProperty("%s.%d.Plot" % (request, count), plot)
self.WINDOW.setProperty("%s.%d.PlotOutline" % (request, count), item['plotoutline'])
self.WINDOW.setProperty("%s.%d.Tagline" % (request, count), item['tagline'])
self.WINDOW.setProperty("%s.%d.Runtime" % (request, count), str(int((item['runtime'] / 60) + 0.5)))
self.WINDOW.setProperty("%s.%d.Rating" % (request, count), str(round(float(item['rating']),1)))
self.WINDOW.setProperty("%s.%d.mpaa" % (request, count), item['mpaa'])
self.WINDOW.setProperty("%s.%d.Director" % (request, count), " / ".join(item['director']))
self.WINDOW.setProperty("%s.%d.Trailer" % (request, count), item['trailer'])
self.WINDOW.setProperty("%s.%d.Art(poster)" % (request, count), art.get('poster',''))
self.WINDOW.setProperty("%s.%d.Art(fanart)" % (request, count), art.get('fanart',''))
self.WINDOW.setProperty("%s.%d.Art(clearlogo)" % (request, count), art.get('clearlogo',''))
self.WINDOW.setProperty("%s.%d.Art(clearart)" % (request, count), art.get('clearart',''))
self.WINDOW.setProperty("%s.%d.Art(landscape)" % (request, count), art.get('landscape',''))
self.WINDOW.setProperty("%s.%d.Art(banner)" % (request, count), art.get('banner',''))
self.WINDOW.setProperty("%s.%d.Art(discart)" % (request, count), art.get('discart',''))
self.WINDOW.setProperty("%s.%d.Resume" % (request, count), resume)
self.WINDOW.setProperty("%s.%d.PercentPlayed" % (request, count), played)
self.WINDOW.setProperty("%s.%d.Watched" % (request, count), watched)
self.WINDOW.setProperty("%s.%d.File" % (request, count), item['file'])
self.WINDOW.setProperty("%s.%d.Path" % (request, count), path)
self.WINDOW.setProperty("%s.%d.Play" % (request, count), play)
self.WINDOW.setProperty("%s.%d.VideoCodec" % (request, count), streaminfo['videocodec'])
self.WINDOW.setProperty("%s.%d.VideoResolution" % (request, count), streaminfo['videoresolution'])
self.WINDOW.setProperty("%s.%d.VideoAspect" % (request, count), streaminfo['videoaspect'])
self.WINDOW.setProperty("%s.%d.AudioCodec" % (request, count), streaminfo['audiocodec'])
self.WINDOW.setProperty("%s.%d.AudioChannels" % (request, count), str(streaminfo['audiochannels']))
del json_query