[REQUEST] Editing/Changing this addon
#16
(2013-06-25, 05:19)stanley87 Wrote: And, yes - possible to add 5x ep's to a playlist

add_playlist_command = {
'jsonrpc': '2.0',
'method': 'Playlist.Add',
'params': {'playlistid':1, 'item': {'file': episodes[season['watchedepisodes']]['file']},
'id': '1'}
json_query(add_playlist_command)

You may also want to clear the playlist before starting to add items:

clear_playlist_command = {
'jsonrpc': '2.0',
'method': 'Playlist.Clear',
'params': {'playlistid':1},
'id': '1'}
json_query(clear_playlist_command)

You will also need to use the below play command instead:

play_command = {
'jsonrpc': '2.0',
'method': 'Player.Open',
'params': {'item': {'playlistid':1}},
'id': '1'}
json_query(play_command)

excuse my ignorance, but where would i be adding this?

end of the script, beginning?
Reply
#17
Wherever the command to play is in the current script. But my script has those changes already.

It just doesnt include stanleys extra notification code.
Reply
#18
Ok, everything is running smoothly, cant thank everyone involved in this enough!

One last request now, i promise Wink

So now the script plays random episodes with excluding some genres, i copied the script, to make a second one, and it is working, but now i want to edit the second one to only play specific genres, so this code will have to change, but to what?

Code:
if show['watchedepisodes'] < show['episode'] and show['tvshowid'] not in IGNORE and "Children" not in show['genre']:

so this above excludes children genre, so the new script i would want to only include results with the genre "sitcom"
Reply
#19
if show['watchedepisodes'] < show['episode'] and show['tvshowid'] not in IGNORE and "sitcom" in show['genre']: Huh
Reply
#20
(2013-07-09, 11:17)matthuisman Wrote: if show['watchedepisodes'] < show['episode'] and show['tvshowid'] not in IGNORE and "sitcom" in show['genre']: Huh

hmm, i tried that, maybe i did something wrong. Im in no way a coder, so im learning whilst doing. Thanks, will go test the code when I get home.
Reply
#21
Remember. it's case sensitive.
If the show['genre'] = "Sitcom, Thriller"
then "sitcom" in show['genre'] will return false
You could lowercase the show['genre'] to stop this issue

eg: if show['watchedepisodes'] < show['episode'] and show['tvshowid'] not in IGNORE and "sitcom" in show['genre'].lower():

I'm assuming show['genre'] is a string... if it's an array, then lower won't work
Reply
#22
I played around yesterday and saw that it is case sensitive. Thanks for the last code snippet, will test it tonight.
Reply

Logout Mark Read Team Forum Stats Members Help
[REQUEST] Editing/Changing this addon0