2009-07-30, 17:42
i'm creating a script that can play random local trailers. i do not know the movie name that the thumb was cached on. it may not have even been cached. so there is no way for me to set the thumb to the proper cached name.
if these are on smb:// shares they do not display when you bring up the video info while watching.
will skinners add background="true" to videoplayer.cover. this solves the issue. maybe the music one also?
here is the code it first checks for a thumb based on trailer name, then it checks for a thumb stripping -trailer. in case you store your trailers with your movies, but trailer ext can be different than movie ext. so i need the above.
thanks
if these are on smb:// shares they do not display when you bring up the video info while watching.
will skinners add background="true" to videoplayer.cover. this solves the issue. maybe the music one also?
here is the code it first checks for a thumb based on trailer name, then it checks for a thumb stripping -trailer. in case you store your trailers with your movies, but trailer ext can be different than movie ext. so i need the above.
thanks
PHP Code:
def _get_thumbnail( self, path ):
# check for a thumb based on trailername.tbn
thumbnail = os.path.splitext( path )[ 0 ] + ".tbn"
# if thumb does not exist try stripping -trailer
if ( not xbmc.executehttpapi( "FileExists(%s)" % ( thumbnail, ) ) == "<li>True" ):
thumbnail = "%s.tbn" % ( os.path.splitext( path )[ 0 ].replace( "-trailer", "" ), )
# if thumb does not exist return empty
if ( not xbmc.executehttpapi( "FileExists(%s)" % ( thumbnail, ) ) == "<li>True" ):
# set empty string
thumbnail = None
# return result
return thumbnail