Work in Progress - LazyTV - an unwatched TV Show playlist generator

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Karnagious Online
Fan
Posts: 659
Joined: Nov 2012
Reputation: 29
Post: #1
LazyTV is my first coding project.

Description:
LazyTV creates and launches a randomised playlist of the TV episodes. It scans your TV database to identify the last viewed episode for each of your shows, and populates the playlist with the next available episode.

I have tested it on a windows PC and Raspberry Pi (RaspBMC) with my library, but would appreciate someone else trying it with their library.

GitHub Repo:
https://github.com/KODeKarnage/script.lazytv

Would love to hear what you think!

:::Update June:::

I have added a skin to the list view for LazyTV as well as a context menu.

The context menu allows you to:
- select more than one show at a time
- play the selection
- play from "here" option
- export shows to any folder
- mark an episode as watched
- update the library
- refresh the list

Would be great if people could try it out and let me know any bugs they find.

Finally, I have played around with a number of ideas for a new icon. Feel free to identify the one you like the most.

(This post was last modified: 2014-06-11 15:02 by Karnagious.)
find quote
MeMeMe Offline
Senior Member
Posts: 171
Joined: Sep 2011
Reputation: 5
Post: #2
This looks very interesting. I'll test it sometime this week.
find quote
Karnagious Online
Fan
Posts: 659
Joined: Nov 2012
Reputation: 29
Post: #3
Thanks MeMeMe,

It has been rejected from the official Repo because it accesses the database directly. The line in the wiki that says there is a restriction on EDITing the databases, is meant to mean that all access is restricted, so not just writing but reading as well.

I am looking at a work-around, but would still love to hear any functionality suggestions.
find quote
MeMeMe Offline
Senior Member
Posts: 171
Joined: Sep 2011
Reputation: 5
Post: #4
It's weird that it doesn't allow you to read the database.
find quote
hstegeman Offline
Senior Member
Posts: 236
Joined: Jun 2013
Reputation: 3
Location: The Netherlands
Post: #5
I did try to download your repo but I am getting an error message. 500: Internal Server Error.
Is this because it has been rejected from the official Repo?
find quote
Karnagious Online
Fan
Posts: 659
Joined: Nov 2012
Reputation: 29
Post: #6
The GitHub link works for me. Not sure why you couldnt get to it.
find quote
Karnagious Online
Fan
Posts: 659
Joined: Nov 2012
Reputation: 29
Post: #7
I am currently reworking the addon to use the JSON-RPC API instead of querying the database directly.

Hope to have that done in the next few days.
find quote
hstegeman Offline
Senior Member
Posts: 236
Joined: Jun 2013
Reputation: 3
Location: The Netherlands
Post: #8
On the moment I am testing your script.
It's very nice that it can also play streamed TV shows.

But if I want to make use of streamed TV shows, I have to set the next option on:
Include episodes from unwatched tvseries, although I have seen some of the episode.
Sometimes I do see a problem when it's trying to play a dead stream, somehow it doesn't find the next stream.
find quote
Karnagious Online
Fan
Posts: 659
Joined: Nov 2012
Reputation: 29
Post: #9
Thanks hstegeman, thats very helpful.

I will look to put in an explicit "Include .strm" option, and have them handled better.

I have never had any .strm in my library, are you able to provide some details on them? Are they single episodes or multiple episodes in a full TV series? I mean, do they each have a different TVShowID? Also, can you 'resume' a stream? Maybe there is a few sample .strm files that I could use?

On the last issue, I suppose I could have the addon request the header to see if the link is dead before adding to the playlist. That might solve it. Though I am concerned it a check like that may slow things down.
find quote
hstegeman Offline
Senior Member
Posts: 236
Joined: Jun 2013
Reputation: 3
Location: The Netherlands
Post: #10
I did send you a pm.
(This post was last modified: 2013-08-20 10:16 by hstegeman.)
find quote
endlesslyonline Offline
Senior Member
Posts: 169
Joined: Aug 2011
Reputation: 2
Post: #11
Karnagious ,

You have no idea how long i have been searching for this addon!, well maybe you do, because if i recall correctly, you were one of the guys that helped me to change some code on my own script, that does a similar job. Mine works atm, but yours seems to have alot more options, so i am definitely going to install and use it.

One thing, I dont see it in your "feature list", so im not sure, if it is not listed, or maybe not implemented, of the latter, can you maybe think of adding this: If i have lets say 6 random episodes playing, my brain takes a few seconds to realize which show it is that is playing, so you can make a popup that will be there for like 5 or 10 secs, which shows the Show Name, SxxExx, and the title of the episode?

Thanks
find quote
endlesslyonline Offline
Senior Member
Posts: 169
Joined: Aug 2011
Reputation: 2
Post: #12
Been playing around with this for the past 20minutes or so, loks promising.

One thing, I have chosen the smart playlist way, so when i open the addon, it pops ups, and asks me for my smar playlists, and i choose one, then it gives an error, lazyTV script failed. sometimes nothing happens, sometimes the error, and then the episode starts to play, I have set to open 5 episodes, but everytime, it is error, and then only one, sometimes maybe two episodes populate. I can confirm that I have more than 5 unwatched episodes.

Dont know if you will need full debug, but here is the snippet so long

Code:
13:36:12 T:1524   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.IndexError'>
                                            Error Contents: list index out of range
                                            Traceback (most recent call last):
                                              File "C:\Users\Shaun\AppData\Roaming\XBMC\addons\script.lazytv-master\default.py", line 406, in <module>
                                                create_playlist()
                                              File "C:\Users\Shaun\AppData\Roaming\XBMC\addons\script.lazytv-master\default.py", line 242, in create_playlist
                                                this_show = [x for x in all_shows if x['tvshowid'] == SHOWID][0]
                                            IndexError: list index out of range
                                            -->End of Python script error report<--
find quote
Karnagious Online
Fan
Posts: 659
Joined: Nov 2012
Reputation: 29
Post: #13
Thanks endlesslyonline, I havent had that error reported before. It would occur if the SHOWID was an empty string. I have added a filter to eliminate empty strings for playlists and updated github, if you want to try again.

PS Actually, thinking about it some more, I dont think that was it. The filter was already being applied.

Do you have Exclude Partials set to True? And if so, is it possible that a lot of episodes are partially watched?

PPS I have tried for about an hour to replicate the problem, but no luck.
Are you able to send me your playlist file? And maybe the database too?
(This post was last modified: 2013-09-04 15:08 by Karnagious.)
find quote
endlesslyonline Offline
Senior Member
Posts: 169
Joined: Aug 2011
Reputation: 2
Post: #14
Will do. Newbie question though, how do I send you my database? and it is a SQL database, does that make a difference?

EDIT: I will check on exclude partials, but im almost sure I have them excluded. I do have a few partials, but not sure how much is a lot, if i have to take a wild guess, I would so about 30 episodes?
(This post was last modified: 2013-09-05 12:24 by endlesslyonline.)
find quote
Karnagious Online
Fan
Posts: 659
Joined: Nov 2012
Reputation: 29
Post: #15
Thanks, SQL db is fine. I will PM you my email address.

The problem occurred in testing when the list was empty, so I put in something that should exit the script when the list is empty. I dont see how an empty list can get there.
find quote
Post Reply