drrlramsey / xbmc-addons

Automatically exported from code.google.com/p/xbmc-addons
0 stars 0 forks source link

[cinema.experience] Script fails if not enough videos are in folder #70

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
SlaveUnit reports on the XBMC forums:

Be aware that if you select 3 random videos and your folder only has 2 or 1 the 
whole script will not start up. I know this is basic, but I know there are 
idiots out there just like I was on this.

Steps to Duplicate:
1. Create folder with 2 video files in them
2. Set one of the intro or outro settings to "3 Random Videos"

System Information:
XBMC 10.0
Cinema Experience - SVN

Original issue reported on code.google.com by brian.wa...@gmail.com on 27 Dec 2010 at 9:54

GoogleCodeExporter commented 8 years ago
I could not duplicate this behavior. When choosing a directory that had 
insufficient videos the script loaded successfully. The only indication that 
anything was wrong was in the log file:

07:33:48 T:7100 M:4294967295  NOTICE: Traceback (most recent call last):
07:33:48 T:7100 M:4294967295  NOTICE:   File 
"C:\Users\Brian\AppData\Roaming\XBMC\addons\script.cinema.experience\resources\l
ib\xbmcscript_player.py", line 282, in _get_special_items
07:33:48 T:7100 M:4294967295  NOTICE:     path = self.tmp_paths[ count ]
07:33:48 T:7100 M:4294967295  NOTICE: IndexError: list index out of range
07:33:48 T:7100 M:4294967295  NOTICE: Traceback (most recent call last):
07:33:48 T:7100 M:4294967295  NOTICE:   File 
"C:\Users\Brian\AppData\Roaming\XBMC\addons\script.cinema.experience\resources\l
ib\xbmcscript_player.py", line 282, in _get_special_items
07:33:48 T:7100 M:4294967295  NOTICE:     path = self.tmp_paths[ count ]
07:33:48 T:7100 M:4294967295  NOTICE: IndexError: list index out of range

We could get rid of the exception entirely by checking that items <= count, or 
we could output something more friendly in the logs in the exception handler.

Original comment by brian.wa...@gmail.com on 28 Dec 2010 at 1:37

GoogleCodeExporter commented 8 years ago
Fixed the first part in r1902

r1923
Fixed showing exception if exception is because items > count - made it much 
nice and proper.

output looks like - 
[script.cinemaexperience] - Looking for 5 files, but only found 2

Kept the exception to catch other possible errors

Original comment by giftie61@gmail.com on 28 Dec 2010 at 6:17