•   
  • 1
  • 2
  • 3
  • 4(current)
  • 5
  • 6
  • 53
  •   
[RELEASE] Random and last items smartplaylist script for Skins
#46
Big_Noid Wrote:Don't you already fetch playcount to filter watched/unwatched and resumed items? The script wouldn't run slower then if the option unwatched=true is set?
No, propertie Count is the number of movie in the library/playlist and I don't make the difference between watched or unwatched.

When you set unwatched=True, I only return limit= movies that are unwatched (i.e. playcount > 0).

So I scan movie #1 to movie #Count and if playcount > 0 then I return the movie.

I stop the loop when I reach the end of movies or the number set by limit=

If you want to have the number of unwatched movies, I have to scan all the movies, even if I already have reach the limit= number, to set the unwatched propertie. So I guess the script will be slower.

But I can make a specific version and let you test it.

I will also ask in the JSONRPC thread if a simple way exists.
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
#47
Version 1.0.5 released.

2 new properties added :

Unwatched to get unwatched number of movies in the library or playlist
Watched to get watched number of movies in the library or playlist
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
#48
Thx for adding those two properties. I do get an error with the latest version:
Code:
16:58:49 T:3360    INFO: -->Python script returned the following error<--
16:58:49 T:3360   ERROR: Error Type: <type 'exceptions.UnboundLocalError'>
16:58:49 T:3360   ERROR: Error Contents: local variable '_movie' referenced before assignment
16:58:49 T:4044   DEBUG: FileCurl::Open(09DFE348) http://mirrors.xbmc.org/addons/eden-pre/addons.xml
16:58:49 T:808    INFO: -->Python script returned the following error<--
16:58:49 T:808   ERROR: Error Type: <type 'exceptions.UnboundLocalError'>
16:58:49 T:808   ERROR: Error Contents: local variable '_movie' referenced before assignment
16:58:49 T:3500   DEBUG: Thread XFILE::CFileCache start, auto delete: 0
16:58:49 T:3360   ERROR: Traceback (most recent call last):
                                              File "C:\Users\XBMC\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 174, in <module>
                                                _getMovies()
                                              File "C:\Users\XBMC\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 72, in _getMovies
                                                _resume = _movie['resume']['position']
                                            UnboundLocalError: local variable '_movie' referenced before assignment
16:58:49 T:3360    INFO: -->End of Python script error report<--
16:58:49 T:808   ERROR: Traceback (most recent call last):
                                              File "C:\Users\XBMC\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 174, in <module>
                                                _getMovies()
                                              File "C:\Users\XBMC\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 72, in _getMovies
                                                _resume = _movie['resume']['position']
                                            UnboundLocalError: local variable '_movie' referenced before assignment
16:58:49 T:808    INFO: -->End of Python script error report<--
Reply
#49
Yes bad copy/paste.

Passion repository have been updated. Redownload the ZIP and tell me if it's still KO Sad
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
#50
Small problem with parameter resume=True.

Resumed movies are not well trap so let the parameter to false Sad
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
#51
All good now Smile
Reply
#52
Got an error with latest script:
http://paste.ubuntu.com/843519/

EDIT:
Happened because I emptied my library and the playlists still exist
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#53
Martijn Wrote:Got an error with latest script:
http://paste.ubuntu.com/843519/

EDIT:
Happened because I emptied my library and the playlists still exist
I love when user solve the problem by himself Laugh
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
#54
mikebzh44 Wrote:I love when user solve the problem by himself Laugh

Didn't say i fixed it. Just gave you on how to reproduce Cool
The exception should still be caught by the script Wink

Because when you have a certain smartplaylist with some rules you can get an empty list
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#55
we know, that's for tommorowRolleyes
Reply
#56
Martijn Wrote:Didn't say i fixed it. Just gave you on how to reproduce Cool
The exception should still be caught by the script Wink

Because when you have a certain smartplaylist with some rules you can get an empty list
Sure.

Bad news, filtering on partially watched movies will be disable on the next version because of a bug in the JSONRPC API :

http://forum.xbmc.org/showpost.php?p=101...count=1715
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
#57
Version 1.0.6 released

- [Fix] Handle exception when playlist is empty or fetching information failed
- resume= parameter is disable because of a bug in method GetDirectory of JSONRPC API

For resume= option, if method GetDirectory in JSONRPC API couldn't be fixed, I can work around this problem by making a single request for each movie in the playlist/library, but script will be slower :S
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
#58
We can use the watchlist script for resumed movies. Imo it's better to have a fast script.
Reply
#59
Yes but watchlist script will not work on playlist. So you won't be able to display a widget showing partially watched movie in playlist Kids as example.

I can make extra request for each movie only if resume is set to True. So script will run as fast as now when resume is set to False.

Because, I don't known if JSONRPC API will be modified : http://forum.xbmc.org/showpost.php?p=101...count=1716
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
#60
I have some issues with latest version 1.06...

My onload command:

Code:
<onload>XBMC.RunScript(script.randomandlastitems,limit=3,method='Last',playlist='special://skin/playlists/HDMovies.xsp',menu='Menu1')</onload>

Error in Log:

Code:
13:18:28 T:528  NOTICE: -->Python Interpreter Initialized<--
13:18:28 T:528 WARNING: CUtil::GetMatchingSource... no matching source found for ['special://skin/playlists/HDMovies.xsp']
13:18:28 T:528 WARNING: Previous line repeats 4 times.
13:18:28 T:528 WARNING: XFILE::CFactoryDirectory::Create - Unsupported protocol('special) in 'special://skin/playlists/HDMovies.xsp'
13:18:28 T:528   ERROR: Error Type: <type 'exceptions.KeyError'>
13:18:28 T:528   ERROR: Error Contents: ('result',)
13:18:28 T:528   ERROR: Traceback (most recent call last):
                                              File "C:\Users\max\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 180, in <module>
                                                _getMovies()
                                              File "C:\Users\max\AppData\Roaming\XBMC\addons\script.randomandlastitems\randomandlastitems.py", line 49, in _getMovies
                                                if (json_pl_response['result'] != None) and (json_pl_response['result'].has_key("files")):
                                            KeyError: ('result',)
13:18:30 T:4784   ERROR: Control 1 in window 10099 has been asked to focus, but it can't

Running Beta 3 on Win 7...

Any hint?

cheers,
mad-max
Image

- - - Tribute to Metallica - - -

If I managed to help you, please click my reputation
Reply
  •   
  • 1
  • 2
  • 3
  • 4(current)
  • 5
  • 6
  • 53
  •   



Logout Mark Read Team Forum Stats Members Help
[RELEASE] Random and last items smartplaylist script for Skins1
This forum uses Lukasz Tkacz MyBB addons.