• 1
  • 7
  • 8
  • 9(current)
  • 10
  • 11
  • 23
[RELEASE] RandomItems (Random Items) Script
Any news regarding the long time it takes to get results? Takes about 10 seconds for me and that was not the case with the script for Dharma.
Reply
frellAn Wrote:Any news regarding the long time it takes to get results? Takes about 10 seconds for me and that was not the case with the script for Dharma.

nope, it's due to json-rpc being very slow at returning the fanart results for episodes.

see my comments on this ticket:
http://trac.xbmc.org/ticket/11624
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
Is there a way to call the script with fanart=false? I do not use fanart.
My skins:

Amber
Quartz

Reply
pecinko Wrote:Is there a way to call the script with fanart=false? I do not use it.

nope and i'd rather see the issue fixed than implementing workarounds.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
OK, but in my case it's not about workaround. I just do not use random items fanart om HP so I would use it even with ussue fixed.
My skins:

Amber
Quartz

Reply
pecinko Wrote:OK, but in my case it's not about workaround. I just do not use random items fanart om HP so I would use it even with ussue fixed.

the script sets about 50 different window properties.
you propose to make all of them optional,
or just the ones you don't need? ;-p
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
ronie Wrote:the script sets about 50 different window properties.
you propose to make all of them optional,
or just the ones you don't need? ;-p

Well, I didn't think it's that complicated. I believed fanart could be the slowest operation and, since skin do not use it, it could speed up things a bit on slower devices. So it just seamed as a sane optimization.

However, if it's a hassle, leave it as is - users can wait, use recent items or turn it off in skin settings as they see fit.
My skins:

Amber
Quartz

Reply
pecinko Wrote:Well, I didn't think it's that complicated. I believed fanart could be the slowest operation and, since skin do not use it, it could speed up things a bit on slower devices. So it just seamed as a sane optimization.

it isn't really difficult to add it, though it take quite a few lines of extra code.
but my point is, it shouldn't really be needed.

if all was well, the script would only take a second or 2 to run (max.),
so no need to go through the hassle of making parts of it optional.

anyways...i've created a separate ticket for this issue:
http://trac.xbmc.org/ticket/11979
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
I see, thanks for explanation.
My skins:

Amber
Quartz

Reply
i've just upped version 3.0.3 to the pre-eden the addon repo.

it addresses all changes made to json-rpc that will be in the upcoming xbmc nightly build.

so, in order to use it, you'll be needing the next xbmc nightly build.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
I've never been satisfied by how the random item script handles TV shows. Currently it returns a random unwatched episode from a random series. This approach might be fine for something like The Simpsons but it is useless for story based shows such as 24. I've proposed changing the script to get the first unwatched episode from a series before but it fell on deaf ears.

So this morning I spent some time playing around in SqliteExplorer, messing with some sql statements this morning trying to find a good way to do this. I came up with this:

Code:
select episodeView.idShow AS epID,
episodeView.c00 AS EpisodeName,
episodeView.c01 AS Plot,
episodeView.strPath AS FilePath,
episodeView.strFileName AS FileName,
episodeView.strTitle AS ShowTitle,
episodeView.c03 AS Rating,
episodeView.c13 AS EpisodeNumber,
episodeView.c12 AS EpisodeSeason

from episodeView

where EpisodeNumber == (select MIN(c13) from episodeView where idShow == epID AND playCount is null order by c12)

order by RANDOM()
limit 5;

I haven't put that into the script and tried it in xbmc yet, pretty trivial to get it into the script. Just change the line 148 to:

Code:
sql_episodes = "select * from episodeView AS epView where epView.c13 == (select MIN(subEp.c13) from episodeView AS subEp where subEp.idShow == epView.idShow AND subEp.playCount is null order by subEp.c12) order by RANDOM() limit %d" % ( unplayed, self.LIMIT, )

I'm just wondering if anyone has any optimizations to suggest, would like it to be a little faster. I'm testing it on a database with 9,400 entries and you can feel how much slower this is then before, really would like to speed it up before replacing my own script with it.

I would highly recommend changing your approach to random t.v shows to this, it is just pretty useless the way things are. Love the music and movies approach but hate the t.v approach. I originally thought it might be good to release this as a modded script but it's never good to split userbases, even if the scripts are interchangeable.
Reply
musera Wrote:I would highly recommend changing your approach to random t.v shows to this, it is just pretty useless the way things are. Love the music and movies approach but hate the t.v approach. I originally thought it might be good to release this as a modded script but it's never good to split userbases, even if the scripts are interchangeable.

the method above may be fine for dharma,
but for the pre-eden version of the script you'll need a different approach.
it uses json-rpc instead of doing sql queries through http-api.

if there's a general interest in this functionality,
we can always add it as an option.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
i support this idea....i may be behind in a show like damages or breaking bad and then to have the script return an episode three past the one i am at is useless to me
Reply
Script seems more usable now, probably 85-90% as fast as dharma version. Alot more useable now, so if any changes thx...
Image

Check out The Carmichael - A Skin For XBMC

Check out Night - A Skin For XBMC

Check out Unfinished - A Skin For XBMC
Reply
distracto Wrote:i support this idea....i may be behind in a show like damages or breaking bad and then to have the script return an episode three past the one i am at is useless to me

there's already an option in the script to return unwatched items only.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
  • 1
  • 7
  • 8
  • 9(current)
  • 10
  • 11
  • 23

Logout Mark Read Team Forum Stats Members Help
[RELEASE] RandomItems (Random Items) Script2