Release Random Trailers - Plays random trailers from uses library, iTunes or Folder
#16
(2013-09-02, 06:29)bluenote Wrote: For some reason whenever this is enabled it takes over the screensaver function and executes even if I change the screen saver to something else. (actually, when installed it doesnt show as selected for screen saver and still executes when the screensaver exits). I love this addon but can't tolerate the screensaver function, do you have any suggestions?

thanks

EDIT: I solved my own problem. It seems like under programs two instances of the script show up - 1.0.9 and 1.0.5 . When I install 1.0.5 it seems to work as expected. (so far)

I have not been able to duplicate this issue. I only have windows available so that is all I have tested it on. Are you running some other OS?
-ken Z-
Reply
#17
(2013-11-27, 02:59)kzeleny Wrote:
(2013-09-02, 06:29)bluenote Wrote: For some reason whenever this is enabled it takes over the screensaver function and executes even if I change the screen saver to something else. (actually, when installed it doesnt show as selected for screen saver and still executes when the screensaver exits). I love this addon but can't tolerate the screensaver function, do you have any suggestions?

thanks

EDIT: I solved my own problem. It seems like under programs two instances of the script show up - 1.0.9 and 1.0.5 . When I install 1.0.5 it seems to work as expected. (so far)

I have not been able to duplicate this issue. I only have windows available so that is all I have tested it on. Are you running some other OS?

Just windows 7
Reply
#18
(2013-11-27, 03:12)bluenote Wrote:
(2013-11-27, 02:59)kzeleny Wrote:
(2013-09-02, 06:29)bluenote Wrote: For some reason whenever this is enabled it takes over the screensaver function and executes even if I change the screen saver to something else. (actually, when installed it doesnt show as selected for screen saver and still executes when the screensaver exits). I love this addon but can't tolerate the screensaver function, do you have any suggestions?

thanks

EDIT: I solved my own problem. It seems like under programs two instances of the script show up - 1.0.9 and 1.0.5 . When I install 1.0.5 it seems to work as expected. (so far)

I have not been able to duplicate this issue. I only have windows available so that is all I have tested it on. Are you running some other OS?

Just windows 7

Ok that is strange, I have tested it on Windows XP, 7, and server 2008 and 8.1 without it doing this. I have made quite a few changes i could have fixed it and not realized it. Thans for the feedback.
-ken Z-
Reply
#19
(2013-11-27, 03:15)kzeleny Wrote:
(2013-11-27, 03:12)bluenote Wrote:
(2013-11-27, 02:59)kzeleny Wrote: I have not been able to duplicate this issue. I only have windows available so that is all I have tested it on. Are you running some other OS?

Just windows 7

Ok that is strange, I have tested it on Windows XP, 7, and server 2008 and 8.1 without it doing this. I have made quite a few changes i could have fixed it and not realized it. Thans for the feedback.

If in your guisettings.xml there is a reference to screensaver.randomtrailers after you have changed the screensaver to something else. This will cause it to activate. I key off the following

<screensaver>
<mode>screensaver.randomtrailers</mode>
<time>5</time>
<usedimonpause>true</usedimonpause>
<usemusicvisinstead>false</usemusicvisinstead>
</screensaver>

To fix do the following:
  1. Download and Install latest version of Random Trailers from my GIT repo here.
  2. Make sure Random Trailers is NOT selected as your Screensaver
  3. Exit XBMC
  4. search guisettings.xml for "<mode>screensaver.randomtrailers</mode>. Delete it if you find it.
  5. Restart XBMC and make sure trailers don't start

This should resolve the trailers starting.
-ken Z-
Reply
#20
Added new verison to git 1.1.7 supports viewing info for iTunes trailers.
-ken Z-
Reply
#21
Version 1.1.7 Now available in the official Repo!
-ken Z-
Reply
#22
Version 1.1.9 Now available in the official Repo!
-ken Z-
Reply
#23
Added Filtering by Rating. See First Post for Details
-ken Z-
Reply
#24
(2014-03-03, 20:16)kzeleny Wrote: Added Filtering by Rating. See First Post for Details

Hey kz

Could you give me a hint on how to modify a cloned copy of this to only play in order? I find the loops very confusing.
I had this working, but only until #6 or #10, then it would not load any more trailers. I guess it's my poor understanding of python loops.
What I do is copy the addon, change ID, configure for DVD releases only, then make my modifications.

I don't need you to do it for me but maybe you can point out the end point I am missing?

thanks so much, this addon is super useful

EDIT: darnit, I think I should have posted this in the other main thread, sorry
Reply
#25
What order are you trying to get the DVD releases to play in? The script uses a function to select a random item from a collection of items and then play that item if it has not been played already.

If you give me a bit more detail I can point you in the right direction.

Thanks!

Ken
-ken Z-
Reply
#26
Hey ken

I want to play in chronological order which is the default order from the feed.

Thx
Reply
#27
Get the latest version from git I found a bug where I pulled extra trailers that were not on the DVD list.

in the top of default.py you will see all the variables defined

add the following: I put mine on line 79 just above def getTitleFont():

trailer_index=0

In Class TrailerWindow find the line random.shuffle(trailers) and comment it out by putting a # at the beginning
Should be around line 584
Insert below that line

global trailer_index

find the line played.append(trailer["number"] Should be at about line 592

Insert the following below that

if trailer_index==len(trailers):trailer_index=0
trailer=trailers[trailer_index]
trailer_index=trailer_index+1

This will make all trailers play in whatever order they came from the source.
first line starts over if we run out of trailers
second line picks a trailer
next line adds one to it so we will play that the next time through

Make sure to pay attention to indents and you should be good to go.

Ken
-ken Z-
Reply
#28
(2014-03-17, 21:43)kzeleny Wrote: Get the latest version from git I found a bug where I pulled extra trailers that were not on the DVD list.

in the top of default.py you will see all the variables defined

add the following: I put mine on line 79 just above def getTitleFont():

trailer_index=0

In Class TrailerWindow find the line random.shuffle(trailers) and comment it out by putting a # at the beginning
Should be around line 584
Insert below that line

global trailer_index

find the line played.append(trailer["number"] Should be at about line 592

Insert the following below that

if trailer_index==len(trailers):trailer_index=0
trailer=trailers[trailer_index]
trailer_index=trailer_index+1

This will make all trailers play in whatever order they came from the source.
first line starts over if we run out of trailers
second line picks a trailer
next line adds one to it so we will play that the next time through

Make sure to pay attention to indents and you should be good to go.

Ken

I'm embarassed to put you through this level of hand holding, so thanks.
There is only one instance of played.append and it is played.append(trailer['title']) at line 595 - when I did make the change here assuming a typo, it did not seem to work properly.

Line 591 is
if trailercount == len (trailers):
played=[]

I checked it in git as well and that's the current state so I'm not sure if you've got changes that I don't have?

Previously the method I attempted was to rip out every shuffle and random.choice but I think this sort of end runs that

Ah I think I understand the problem.
Code:
if trailercount == len(trailers):
  played=[]

The forums dont retain proper indent unless in CODE blocks. Was there an indent inside that snippet?
Reply
#29
code in the post was not indented. Basically if you see a : on the end of the line, next line needs to be indented
-ken Z-
Reply
#30
Hey!! Success!

Thanks a lot, it's much appreciated Smile

For anyone following along, starting at line 591 should look like this:

Code:
.
        if trailercount == len(trailers):
                played=[]
        if trailer_index==len(trailers):trailer_index=0
        trailer=trailers[trailer_index]
        trailer_index=trailer_index+1        
        if trailer['trailer']=='tmdb':
            trailer=getTmdbTrailer(trailer['id'])
        played.append(trailer['title'])

ie; add the block after line 592 (played=[]) not after played.append on line 595.

Thanks kz
Reply

Logout Mark Read Team Forum Stats Members Help
Random Trailers - Plays random trailers from uses library, iTunes or Folder1