Release Random Trailers - Plays random trailers from uses library, iTunes or Folder - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151) +---- Thread: Release Random Trailers - Plays random trailers from uses library, iTunes or Folder (/showthread.php?tid=166374) |
RE: Random Trailers Script / Screensaver - Play random trailers from uses library - kzeleny - 2013-11-27 (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? 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? RE: Random Trailers Script / Screensaver - Play random trailers from uses library - bluenote - 2013-11-27 (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? Just windows 7 RE: Random Trailers Script / Screensaver - Play random trailers from uses library - kzeleny - 2013-11-27 (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? 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. RE: Random Trailers Script / Screensaver - Play random trailers from uses library - kzeleny - 2013-11-27 (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? 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:
This should resolve the trailers starting. RE: Random Trailers - Plays random trailers from uses library, iTunes or Folder - kzeleny - 2014-01-06 Added new verison to git 1.1.7 supports viewing info for iTunes trailers. RE: Random Trailers - Plays random trailers from uses library, iTunes or Folder - kzeleny - 2014-01-10 Version 1.1.7 Now available in the official Repo! RE: Random Trailers - Plays random trailers from uses library, iTunes or Folder - kzeleny - 2014-02-06 Version 1.1.9 Now available in the official Repo! RE: Random Trailers - Plays random trailers from uses library, iTunes or Folder - kzeleny - 2014-03-03 Added Filtering by Rating. See First Post for Details RE: Random Trailers - Plays random trailers from uses library, iTunes or Folder - bluenote - 2014-03-17 (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 RE: Random Trailers - Plays random trailers from uses library, iTunes or Folder - kzeleny - 2014-03-17 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 RE: Random Trailers - Plays random trailers from uses library, iTunes or Folder - bluenote - 2014-03-17 Hey ken I want to play in chronological order which is the default order from the feed. Thx RE: Random Trailers - Plays random trailers from uses library, iTunes or Folder - kzeleny - 2014-03-17 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 RE: Random Trailers - Plays random trailers from uses library, iTunes or Folder - bluenote - 2014-03-18 (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. 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): The forums dont retain proper indent unless in CODE blocks. Was there an indent inside that snippet? RE: Random Trailers - Plays random trailers from uses library, iTunes or Folder - kzeleny - 2014-03-18 code in the post was not indented. Basically if you see a : on the end of the line, next line needs to be indented RE: Random Trailers - Plays random trailers from uses library, iTunes or Folder - bluenote - 2014-03-18 Hey!! Success! Thanks a lot, it's much appreciated For anyone following along, starting at line 591 should look like this: Code: . ie; add the block after line 592 (played=[]) not after played.append on line 595. Thanks kz |