Hello again,
I just tried your method (copying files in a new directory) and using multiimage and it works certainly better than what I was doing previously.
I was a bit worried that the time needed to copy the files would be visible but it's done in a snap, which is good.
Here is a sample of the python script tvshowscreencap.py (it is more than loosely based on yours !) :
Code:
def _copy_all_tvshow_thumb( self ):
dest_path = xbmc.translatePath( "special://profile/Thumbnails/Video/TVShow_Thumb")
if ( not os.path.isdir( dest_path ) ):
os.mkdir( dest_path )
# set the request that grabs all and every episodes. No jealous here
sql_episodes = "select * from episodeview"
# query the database
episodes_xml = xbmc.executehttpapi( "QueryVideoDatabase(%s)" % quote_plus( sql_episodes ), )
# separate the records
episodes = re.findall( "<record>(.+?)</record>", episodes_xml, re.DOTALL )
# enumerate thru our records and set our properties
for count, episode in enumerate( episodes ):
# separate individual fields
fields = re.findall( "<field>(.*?)</field>", episode, re.DOTALL )
# get cache names of path to use for thumbnail
thumb_cache = self._get_media( fields[ 24 ], fields[ 23 ] ) [0]
# initial thumb path
thumb = "special://profile/Thumbnails/Video/%s/%s" % ( thumb_cache[ 0 ], thumb_cache, )
# if thumb exists, copy it in a temporary directory
complete_path = xbmc.translatePath( thumb )
if ( os.path.isfile( complete_path ) ):
shutil.copy(complete_path, dest_path)
It runs independently of recentlyadded.py, as I wanted it to run without conditions.
A last question : How did you managed to have the coverarts change in no particular order and not all at once ?
Here is the xml I added in my home.xml
Code:
<control type="group">
<posx>300</posx>
<posy>120</posy>
<control type="multiimage">
<posx>0</posx>
<posy>0</posy>
<width>300</width>
<height>200</height>
<imagepath background="true">C:\datas\Programs\XBMC\userdata\Thumbnails\Video\TVShow_Thumb</imagepath>
<aspectratio>scale</aspectratio>
<timeperimage>4000</timeperimage>
<randomize>true</randomize>
<fadetime>500</fadetime>
<include>backgroundfade</include>
</control>
<control type="multiimage">
<posx>310</posx>
<posy>0</posy>
<width>300</width>
<height>200</height>
<imagepath background="true">C:\datas\Programs\XBMC\userdata\Thumbnails\Video\TVShow_Thumb</imagepath>
<aspectratio>scale</aspectratio>
<timeperimage>4000</timeperimage>
<randomize>true</randomize>
<fadetime>500</fadetime>
<include>backgroundfade</include>
</control>
<control type="multiimage">
<posx>0</posx>
<posy>210</posy>
<width>300</width>
<height>200</height>
<imagepath background="true">C:\datas\Programs\XBMC\userdata\Thumbnails\Video\TVShow_Thumb</imagepath>
<aspectratio>scale</aspectratio>
<timeperimage>4000</timeperimage>
<randomize>true</randomize>
<fadetime>500</fadetime>
<include>backgroundfade</include>
</control>
<control type="multiimage">
<posx>310</posx>
<posy>210</posy>
<width>300</width>
<height>200</height>
<imagepath background="true">C:\datas\Programs\XBMC\userdata\Thumbnails\Video\TVShow_Thumb</imagepath>
<aspectratio>scale</aspectratio>
<timeperimage>4000</timeperimage>
<randomize>true</randomize>
<fadetime>500</fadetime>
<include>backgroundfade</include>
</control>
<animation effect="rotatey" center="700" start="6" end="6" time="0" condition="true">Conditional</animation>
<visible>[Container(5040).HasFocus(3) | Container(5041).HasFocus(3)] + !Player.HasVideo</visible>
</control>