[xbmc-addons] r1769 committed - [script.apple.movie.trailers] - Version: 2.0.0...

0 views
Skip to first unread message

xbmc-...@googlecode.com

unread,
Aug 16, 2010, 11:51:56 AM8/16/10
to xbmc-addo...@googlegroups.com
Revision: 1769
Author: nuka...@gmail.com
Date: Mon Aug 16 08:49:42 2010
Log: [script.apple.movie.trailers] - Version: 2.0.0

-changed: made xbox compatible*
-changed: icon.png, made xbmc compatible
-changed: normalized settings and strings and versions
-added: dependents

*requires patches to xbmc4xbox
http://code.google.com/p/xbmc-addons/source/detail?r=1769

Added:
/addons/script.apple.movie.trailers/resources/__init__.py
/addons/script.apple.movie.trailers/resources/lib/__init__.py
/addons/script.apple.movie.trailers/resources/lib/xbox.py

/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/__init__.py

/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/lib

/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/lib/__init__.py

/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/lib/categories.py

/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/lib/player.py

/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/lib/videos.py

/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/lib/xbox.py
Deleted:
/addons/script.apple.movie.trailers/resources/lib/elementtree

/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/amtAPI
Modified:
/addons/script.apple.movie.trailers/addon.py
/addons/script.apple.movie.trailers/addon.xml
/addons/script.apple.movie.trailers/icon.png
/addons/script.apple.movie.trailers/resources/lib/cacheurl.py
/addons/script.apple.movie.trailers/resources/lib/chooser.py
/addons/script.apple.movie.trailers/resources/lib/context_menu.py
/addons/script.apple.movie.trailers/resources/lib/credits.py
/addons/script.apple.movie.trailers/resources/lib/database.py
/addons/script.apple.movie.trailers/resources/lib/gui.py
/addons/script.apple.movie.trailers/resources/lib/search.py
/addons/script.apple.movie.trailers/resources/lib/settings.py
/addons/script.apple.movie.trailers/resources/lib/showtimes.py
/addons/script.apple.movie.trailers/resources/lib/trailers.py
/addons/script.apple.movie.trailers/resources/lib/update.py
/addons/script.apple.movie.trailers/resources/lib/utilities.py

/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/addon.py

/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/addon.xml

/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/icon.png

=======================================
--- /dev/null
+++ /addons/script.apple.movie.trailers/resources/__init__.py Mon Aug 16
08:49:42 2010
@@ -0,0 +1,1 @@
+# Dummy file to make this directory a package.
=======================================
--- /dev/null
+++ /addons/script.apple.movie.trailers/resources/lib/__init__.py Mon Aug
16 08:49:42 2010
@@ -0,0 +1,1 @@
+# Dummy file to make this directory a package.
=======================================
--- /dev/null
+++ /addons/script.apple.movie.trailers/resources/lib/xbox.py Mon Aug 16
08:49:42 2010
@@ -0,0 +1,99 @@
+""" xbox compatibilty module """
+
+import sys
+import os
+import xbmc
+import re
+
+def _append_module_paths():
+ # main modules path
+ modulepath = xbmc.translatePath( "special://home/scripts/.modules" )
+ # get modules
+ modules = os.listdir( modulepath )
+ # loop thru and append the lib folder to path
+ for module in modules:
+ # make full path
+ fullpath = os.path.join( modulepath, module, "lib" )
+ # only add modules with a lib folder
+ # FIXME: will this be the only format? (module.name/lib)
+ if ( os.path.isdir( fullpath ) ):
+ sys.path.append( fullpath )
+# FIXME: do we want to add this directly in xbmc4xbox to match xbmc (this
doesn't work properly)
+_append_module_paths()
+
+# path of main addon
+_path = os.getcwd()
+# check if we're at root folder of addon
+if ( not os.path.isfile( os.path.join( _path, "addon.xml" ) ) ):
+ # we're not at root, assume resources/lib/
+ _path = os.path.dirname( os.path.dirname( os.getcwd() ) )
+
+# language method
+_L_ = xbmc.Language( _path ).getLocalizedString
+# settings method, try catch necessary as not all scripts have settings
+try:
+ _S_ = xbmc.Settings( _path )
+except:
+ _S_ = None
+
+
+class XBMCADDON:
+ """
+ xbmcaddon module class
+ """
+ # dictionary to hold addon info
+ INFO = {}
+
+ class Addon:
+ """
+ Class to emulate xbmcaddon.Addon methods.
+ """
+ def __init__( self, id ):
+ # TODO: do we want to use id for anything?
+ # parse addon.xml and set all addon info
+ self._set_addon_info( id )
+
+ def _set_addon_info( self, id ):
+ # get source
+ xml = open( os.path.join( _path, "addon.xml" ), "r" ).read()
+ # regex's
+ addon_regex = re.compile( "<addon
id=\"([^\"]+)\".+?name=\"([^\"]+)\".+?version=\"([^\"]+)\".+?provider-name=\"([^\"]+)\".*?>",
re.DOTALL )
+ metadata_type_regex = re.compile( "<extension
point=\"([^\"]+)\".+?library=\"([^\"]+)\".*?>", re.DOTALL )
+ metadata_summary_regex =
re.compile( "<summary>([^<]*)</summary>", re.DOTALL )
+ metadata_disclaimer_regex =
re.compile( "<disclaimer>([^<]*)</disclaimer>", re.DOTALL )
+ metadata_description_regex =
re.compile( "<description>([^<]*)</description>", re.DOTALL )
+ # set addon.xml info into dictionary
+ XBMCADDON.INFO[ "id" ], XBMCADDON.INFO[ "name" ],
XBMCADDON.INFO[ "version" ], XBMCADDON.INFO[ "author" ] =
addon_regex.search( xml ).groups( 1 )
+ XBMCADDON.INFO[ "type" ] = metadata_type_regex.search( xml
).group( 1 )
+ XBMCADDON.INFO[ "summary" ] = metadata_summary_regex.search(
xml ).group( 1 )
+ XBMCADDON.INFO[ "disclaimer" ] =
metadata_disclaimer_regex.search( xml ).group( 1 )
+ XBMCADDON.INFO[ "description" ] =
metadata_description_regex.search( xml ).group( 1 )
+ # set other info
+ XBMCADDON.INFO[ "path" ] = _path
+ XBMCADDON.INFO[ "icon" ] = os.path.join( _path, "default.tbn" )
+ XBMCADDON.INFO[ "fanart" ] = os.path.join( _path, "fanart.jpg"
)
+ XBMCADDON.INFO[ "changelog" ] = os.path.join(
_path, "changelog.txt" )
+ if ( _path.startswith( "Q:\\plugins" ) and not
_path.startswith( "Q:\\plugins\\weather" ) ):
+ XBMCADDON.INFO[ "profile" ]
= "special://profile/plugin_data/%s/%s" % ( os.path.basename(
os.path.dirname( _path ) ), os.path.basename( _path ), )
+ else:
+ XBMCADDON.INFO[ "profile" ]
= "special://profile/script_data/%s" % ( os.path.basename( _path ), )
+
+ @staticmethod
+ def getLocalizedString( id ):
+ return _L_( id )
+
+ @staticmethod
+ def getSetting( id ):
+ return _S_.getSetting( id )
+
+ @staticmethod
+ def setSetting( id, value ):
+ _S_.setSetting( id, value )
+
+ @staticmethod
+ def openSettings():
+ _S_.openSettings()
+
+ @staticmethod
+ def getAddonInfo( id ):
+ return XBMCADDON.INFO[ id.lower() ]
=======================================
--- /dev/null
+++
/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/__init__.py
Mon Aug 16 08:49:42 2010
@@ -0,0 +1,1 @@
+# Dummy file to make this directory a package.
=======================================
--- /dev/null
+++
/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/lib/__init__.py
Mon Aug 16 08:49:42 2010
@@ -0,0 +1,1 @@
+# Dummy file to make this directory a package.
=======================================
--- /dev/null
+++
/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/lib/categories.py
Mon Aug 16 08:49:42 2010
@@ -0,0 +1,156 @@
+"""
+ Category module: fetches a list of genres to use as folders
+"""
+
+# main imports
+import sys
+import os
+import xbmc
+import xbmcgui
+import xbmcplugin
+try:
+ import xbmcaddon
+except:
+ # get xbox compatibility module
+ from xbox import *
+ xbmcaddon = XBMCADDON()
+
+from pysqlite2 import dbapi2 as sqlite
+
+
+_ = xbmcaddon.Addon( id="plugin.video.apple.movie.trailers"
).getLocalizedString
+_S = xbmcaddon.Addon( id="plugin.video.apple.movie.trailers" ).getSetting
+
+class Main:
+ # base paths
+ BASE_SKIN_THUMBNAIL_PATH = os.path.join(
xbmc.translatePath( "special://skin/" ), "media", sys.modules[ "__main__"
].__plugin__ )
+ print BASE_SKIN_THUMBNAIL_PATH
+ # TODO: remove all references
+ #BASE_PLUGIN_THUMBNAIL_PATH = os.path.join( sys.modules[ "__main__"
].BASE_PATH, "thumbnails" )
+
+ def __init__( self ):
+ # if no database was found we need to run the script to create it.
+ if ( not os.path.isfile( _S( "amt_db_path" ) ) ):
+ self._launch_script()
+ else:
+ self.get_categories()
+
+ def _launch_script( self ):
+ # we need to get the localized strings before the call to
endOfDirectory()
+ msg1 = _( 30600 )
+ msg2 = _( 30601 )
+ msg3 = _( 30602 )
+ # no database was found so notify XBMC we're finished, false so no
blank list is shown
+ xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ),
succeeded=False )
+ # we use "U:\\" for linux, windows and osx for platform mode
+ drive = xbmc.translatePath( "special://home/" )
+ # ask to run script to create the database
+ if ( os.path.isfile( os.path.join( drive, "scripts",
sys.modules[ "__main__" ].__script__, "addon.py" ) ) ):
+ if ( xbmcgui.Dialog().yesno( sys.modules[ "__main__"
].__plugin__, msg1, msg3 ) ):
+ xbmc.executebuiltin( "XBMC.RunScript(%s)" % (
os.path.join( drive, "scripts", sys.modules[ "__main__"
].__script__, "addon.py" ) ), )
+ else:
+ ok = xbmcgui.Dialog().ok( sys.modules[ "__main__"
].__plugin__, msg1, msg2, sys.modules[ "__main__" ].__svn_url__ )
+
+ def get_categories( self ):
+ try:
+ # fetch genres from database
+ genres = self._fetch_records()
+ # add search category
+ genres += [ ( -99, _( 30900 ), 0, 0, "", ) ]
+ # fill media list
+ self._fill_media_list( genres )
+ except:
+ # oops print error message
+ print "ERROR: %s::%s (%d) - %s" % ( self.__class__.__name__,
sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno,
sys.exc_info()[ 1 ], )
+
+ def _fill_media_list( self, genres ):
+ try:
+ ok = True
+ # enumerate through the list of genres and add the item to the
media list
+ for genre in genres:
+ url = "%s?genre_id=%d&genre=%s" % ( sys.argv[ 0 ], genre[
0 ], repr( genre[ 1 ] ), )
+ # check for a valid custom thumbnail for the current
category
+ thumbnail = self._get_thumbnail( genre[ 1 ] )
+ # set the default icon
+ icon = "DefaultFolder.png"
+ # only need to add label, icon and thumbnail, setInfo()
and addSortMethod() takes care of label2
+ listitem=xbmcgui.ListItem( genre[ 1 ], iconImage=icon,
thumbnailImage=thumbnail )#, "(%d)" % genre[ 2 ] )
+ # add the different infolabels we want to sort by
+ listitem.setInfo( type="Video",
infoLabels={ "Date": "%s-%s-%s" % ( genre[ 4 ][ 8 : ], genre[ 4 ][ 5 : 7 ],
genre[ 4 ][ : 4 ], ) } )
+ # add the item to the media list
+ ok = xbmcplugin.addDirectoryItem( handle=int(sys.argv[ 1
]), url=url, listitem=listitem, isFolder=True, totalItems=len(genres) )
+ if ( not ok ): raise
+ except:
+ # user cancelled dialog or an error occurred
+ print "ERROR: %s::%s (%d) - %s" % ( self.__class__.__name__,
sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno,
sys.exc_info()[ 1 ], )
+ ok = False
+ # if successful and user did not cancel, set our sort orders,
content and fanart
+ if ( ok ):
+ xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_LABEL )
+ xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_DATE )
+ # set content
+ xbmcplugin.setContent( handle=int( sys.argv[ 1 ] ),
content="movies" )
+ try:
+ # set our fanart from user setting
+ if ( _S( "fanart_genre" ) == "true" ):
+ if ( _S( "fanart_genre_path" ) ):
+ image_path = os.path.join( _S( "fanart_genre_path"
), "Genres.tbn" )
+ if ( os.path.isfile ( image_path ) ):
+ xbmcplugin.setPluginFanart( handle=int(
sys.argv[ 1 ] ), image=image_path, color1=_S( "fanart_color1" ),
color2=_S( "fanart_color2" ), color3=_S( "fanart_color3" ) )
+ elif ( _S( "fanart_image" ) ):
+ xbmcplugin.setPluginFanart( handle=int( sys.argv[ 1 ]
), image=_S( "fanart_image" ), color1=_S( "fanart_color1" ),
color2=_S( "fanart_color2" ), color3=_S( "fanart_color3" ) )
+ except:
+ pass
+ # send notification we're finished, successfully or unsuccessfully
+ xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ),
succeeded=ok )
+
+ def _get_thumbnail( self, title ):
+ # create the full thumbnail path for skins directory
+ thumbnail = os.path.join( self.BASE_SKIN_THUMBNAIL_PATH,
title.replace( "*", "" ) + ".tbn" )
+ # use a plugin custom thumbnail if a custom skin thumbnail does
not exists
+ if ( not os.path.isfile( thumbnail ) ):
+ # TODO: remove this block (no plans on supplying thumbnails)
+ # create the full thumbnail path for plugin directory
+ #thumbnail = xbmc.translatePath( os.path.join(
self.BASE_PLUGIN_THUMBNAIL_PATH, title.replace( "*", "" ) + ".tbn" ) )
+ # use a default thumbnail if a custom thumbnail does not exists
+ #if ( not os.path.isfile( thumbnail ) ):
+ thumbnail = ""
+ return thumbnail
+
+ def _fetch_records( self ):
+ records = Records( amt_db_path=xbmc.translatePath(
_S( "amt_db_path" ) ) )
+ result = records.fetch( Query()[ "genres" ] )
+ records.close()
+ return result
+
+
+class Records:
+ def __init__( self, *args, **kwargs ):
+ self.connect( kwargs[ "amt_db_path" ] )
+
+ def connect( self, db ):
+ self.db = sqlite.connect( db )
+ self.cursor = self.db.cursor()
+
+ def close( self ):
+ self.db.close()
+
+ def fetch( self, sql, params=None ):
+ try:
+ if ( params is not None ): self.cursor.execute( sql, params )
+ else: self.cursor.execute( sql )
+ retval = self.cursor.fetchall()
+ except:
+ retval = None
+ return retval
+
+
+class Query( dict ):
+ def __init__( self ):
+ self[ "genres" ] = """
+ SELECT genres.idGenre, genres.genre,
count(genre_link_movie.idGenre), count(movies.favorite), genres.updated
+ FROM genre_link_movie, genres, movies
+ WHERE genre_link_movie.idGenre=genres.idGenre
+ AND genre_link_movie.idMovie=movies.idMovie
+ GROUP BY genres.genre;
+ """
=======================================
--- /dev/null
+++
/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/lib/player.py
Mon Aug 16 08:49:42 2010
@@ -0,0 +1,252 @@
+"""
+ Player module: downloads then plays trailers
+"""
+
+# TODO: remove this when dialog issue is resolved
+import xbmc
+try:
+ import xbmcaddon
+except:
+ # get xbox compatibility module
+ from xbox import *
+ xbmcaddon = XBMCADDON()
+
+_ = xbmcaddon.Addon( id="plugin.video.apple.movie.trailers"
).getLocalizedString
+_S = xbmcaddon.Addon( id="plugin.video.apple.movie.trailers" ).getSetting
+
+# set our title
+g_title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
+# set our studio (only works if the user is using the video library)
+g_studio = unicode( xbmc.getInfoLabel( "ListItem.Studio" ), "utf-8" )
+# set our genre (only works if the user is using the video library)
+g_genre = unicode( xbmc.getInfoLabel( "ListItem.Genre" ), "utf-8" )
+# set our rating (only works if the user is using the video library)
+g_mpaa_rating = xbmc.getInfoLabel( "ListItem.MPAA" )
+# set our thumbnail
+g_thumbnail = xbmc.getInfoImage( "ListItem.Thumb" )
+# set our plotoutline
+g_plotoutline = unicode( xbmc.getInfoLabel( "ListItem.PlotOutline"
), "utf-8" )
+# set our released date
+g_releasedate = xbmc.getInfoLabel( "ListItem.Property(releasedate)" )
+# set our year
+g_year = 0
+if ( xbmc.getInfoLabel( "ListItem.Year" ) ):
+ g_year = int( xbmc.getInfoLabel( "ListItem.Year" ) )
+
+# create the progress dialog (we do it here so there is minimal delay with
nothing displayed)
+import xbmcgui
+pDialog = xbmcgui.DialogProgress()
+pDialog.create( g_title, _( 30503 ) )
+
+# main imports
+import sys
+import os
+import xbmcplugin
+
+import urllib
+
+
+class _Info:
+ def __init__( self, *args, **kwargs ):
+ self.__dict__.update( kwargs )
+
+
+class Main:
+ # base paths
+ BASE_CACHE_PATH = os.path.join(
xbmc.translatePath( "special://profile" ), "Thumbnails", "Video" )
+
+ def __init__( self ):
+ self._get_settings()
+ # parse argv for our trailer url and movie id
+ self._parse_argv()
+ # split trailer_url into separate videos
+ urls = self.args.trailer_url.replace( "stack://", ""
).split( " , " )
+ # do we need to download the videos
+ if ( self.settings[ "mode" ] > 0 ):
+ # download the video
+ urls = self._download_video()
+ # play the video
+ self._play_video( urls )
+
+ def _parse_argv( self ):
+ # call _Info() with our formatted argv to create the self.args
object
+ exec "self.args = _Info(%s)" % ( sys.argv[ 2 ][ 1 :
].replace( "&", ", " ).replace( "\\u0027", "'" ).replace( "\\u0022", '"'
).replace( "\\u0026", "&" ), )
+
+ def _get_settings( self ):
+ self.settings = {}
+ self.settings[ "mode" ] = int( _S( "mode" ) )
+ self.settings[ "download_path" ] = _S( "download_path" )
+ self.settings[ "mark_watched" ] = _S( "mark_watched" ) == "true"
+ self.settings[ "amt_db_path" ] = xbmc.translatePath(
_S( "amt_db_path" ) )
+ ##self.settings[ "player_core" ] = ( xbmc.PLAYER_CORE_MPLAYER,
xbmc.PLAYER_CORE_DVDPLAYER, )[ int( _S( "player_core" ) ) ]
+
+ def _download_video( self ):
+ try:
+ urls = self.args.trailer_url.replace( "stack://", ""
).split( " , " )
+ # TODO: No longer needed as we sort in the videos module ****
remove after testing
+ #urls.sort()
+ filepaths = []
+ for count, url in enumerate( urls ):
+ title = g_title
+ # construct an xbox compatible filepath
+ ext = os.path.splitext( url )[ 1 ]
+ # we need to keep the end of the title if more than one
trailer
+ multiple = len( urls ) > 1
+ # split and insert the trailer number if more than one
+ filepath = "%s%s" % ( title, ( "", "_%d" % ( count + 1, ),
)[ multiple ], )
+ # folder to save to
+ dirname = "Z:/"
+ if ( not self.settings[ "download_path"
].startswith( "smb://" ) ):
+ dirname = self.settings[ "download_path" ]
+ # get a valid filepath
+ filepath = self._make_legal_filepath( os.path.join(
dirname, filepath + ext ), save_end=multiple )
+ # if the file does not exist, download it
+ if ( os.path.isfile( os.path.join(
self.settings[ "download_path" ], os.path.basename( filepath ) ) ) ):
+ filepath = os.path.join(
self.settings[ "download_path" ], os.path.basename( filepath ) )
+ else:
+ if ( self.settings[ "mode" ] == 1 ):
+ filepath = "Z:/AMT_Video_%d%s" % ( count, ext, )
+ # set our display message
+ self.msg = "%s %d of %d" % ( _( 30500 ), count + 1,
len( urls ), )
+ # fetch the video
+ urllib.urlretrieve( url, filepath, self._report_hook )
+ # make the conf file and copy to smb share if necessary
+ filepath = self._make_conf_file( filepath )
+ filepaths += [ filepath ]
+ except:
+ if ( os.path.isfile( filepath ) ):
+ os.remove( filepath )
+ filepaths = []
+ pDialog.close()
+ return filepaths
+
+ def _report_hook( self, count, blocksize, totalsize ):
+ percent = int( float( count * blocksize * 100) / totalsize )
+ pDialog.update( percent, self.msg )
+ if ( pDialog.iscanceled() ): raise
+
+ def _make_legal_filepath( self, path, compatible=False,
extension=True, conf=True, save_end=False ):
+ # xbox, win32 and linux have different filenaming requirements
+ environment = os.environ.get( "OS", "xbox" )
+ # first we normalize the path (win32 and xbox support / as path
separators)
+ if ( environment == "win32" or environment == "xbox" ):
+ path = path.replace( "\\", "/" )
+ # split our drive letter
+ drive, tail = os.path.splitdrive( path )
+ # split the rest of the path
+ parts = tail.split( "/" )
+ # if this is a linux path and compatible is true set the drive
+ if ( not drive and parts[ 0 ].endswith( ":" ) and len( parts[ 0 ]
) == 2 and compatible ):
+ drive = parts[ 0 ]
+ parts[ 0 ] = ""
+ # here is where we make the filepath valid
+ if ( environment == "xbox" or environment == "win32" or compatible
):
+ # win32 and xbox invalid characters
+ illegal_characters = """,*=|<>?;:"+"""
+ # enumerate through and make each part valid
+ for count, part in enumerate( parts ):
+ tmp_name = ""
+ for char in part:
+ # if char's ord() value is > 127 or an illegal
character remove it
+ if ( char in illegal_characters or ord( char ) > 127
): char = ""
+ tmp_name += char
+ if ( environment == "xbox" or compatible ):
+ # we need to trim the part if it's larger than 42, we
need to account for ".conf"
+ if ( len( tmp_name ) > 42 - ( conf * 5 ) ):
+ # special handling of the last part with extension
+ if ( count == len( parts ) - 1 and extension ==
True ):
+ # split the part into filename and extention
+ filename, ext = os.path.splitext( tmp_name )
+ # do we need to save the last two characters
of the part for file number (eg _1, _2...)
+ if ( save_end ):
+ tmp_name = filename[ : 35 - len( ext ) ] +
filename[ -2 : ]
+ else:
+ tmp_name = filename[ : 37 - len( ext ) ]
+ tmp_name = "%s%s" % ( tmp_name.strip(), ext )
+ # not the last part so just trim the length
+ else:
+ tmp_name = tmp_name[ : 42 ].strip()
+ # add our validated part to our list
+ parts[ count ] = tmp_name
+ # join the parts into a valid path, we use forward slash to remain
os neutral
+ filepath = drive + "/".join( parts )
+ # win32 needs to be encoded to utf-8
+ if ( environment == "win32" ):
+ return filepath.encode( "utf-8" )
+ else:
+ return filepath
+
+ def _make_conf_file( self, filepath ):
+ try:
+ new_filepath = filepath
+ # create conf file for better MPlayer playback
+ if ( not os.path.isfile( filepath + ".conf" ) ):
+ f = open( filepath + ".conf" , "w" )
+ f.write( "nocache=1" )
+ f.close()
+ # if save location is a samba share, copy the file
+ if ( self.settings[ "download_path" ].startswith( "smb://" ) ):
+ new_filepath = os.path.join(
self.settings[ "download_path" ], os.path.basename( filepath ) )
+ new_thumbpath = os.path.join(
self.settings[ "download_path" ], os.path.splitext( os.path.basename(
filepath ) )[ 0 ] + ".tbn" )
+ xbmc.executehttpapi("FileCopy(%s,%s)" % ( filepath,
new_filepath, ) )
+ xbmc.executehttpapi("FileCopy(%s,%s)" % ( g_thumbnail,
new_thumbpath, ) )
+ except:
+ # oops print error message
+ print "ERROR: %s::%s (%d) - %s" % ( self.__class__.__name__,
sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno,
sys.exc_info()[ 1 ], )
+ return new_filepath
+
+
+ def _play_video( self, filepaths ):
+ if ( filepaths ):
+ # set the thumbnail
+ thumbnail = g_thumbnail
+ # set the default icon
+ icon = "DefaultVideo.png"
+ # create our playlist
+ playlist = xbmc.PlayList( xbmc.PLAYLIST_VIDEO )
+ # clear any possible entries
+ playlist.clear()
+ # enumerate thru and add our item
+ for count, filepath in enumerate( filepaths ):
+ # only need to add label, icon and thumbnail, setInfo()
and addSortMethod() takes care of label2
+ listitem = xbmcgui.ListItem( g_title, iconImage=icon,
thumbnailImage=thumbnail )
+ # set the key information
+ listitem.setInfo( "video", { "Title": "%s%s" % ( g_title,
( "", " (%s %d)" % ( _( 30504 ), count + 1, ) )[ len( filepaths ) > 1 ],
), "Genre": g_genre, "Studio": g_studio, "Plot":
g_plotoutline, "PlotOutline": g_plotoutline, "Year": g_year } )
+ # set release date property
+ listitem.setProperty( "releasedate", g_releasedate )
+ # add our item
+ playlist.add( filepath, listitem )
+ # mark the video watched
+ if ( self.settings[ "mark_watched" ] ):
+ self._mark_watched()
+ # we're finished
+ pDialog.close()
+ # play the playlist (TODO: when playlist can set the player
core, add this back in)
+ xbmc.Player().play( playlist )#self.settings[ "player_core" ]
+
+ def _mark_watched( self ):
+ try:
+ pDialog.update( -1, _( 30502 ), _( 30503 ) )
+ from pysqlite2 import dbapi2 as sqlite
+ import datetime
+ fetch_sql = "SELECT times_watched FROM movies WHERE idMovie=?;"
+ update_sql = "UPDATE movies SET times_watched=?,
last_watched=? WHERE idMovie=?;"
+ # connect to the database
+ db = sqlite.connect( self.settings[ "amt_db_path" ] )
+ # get our cursor object
+ cursor = db.cursor()
+ # we fetch the times watched so we can increment by one
+ cursor.execute( fetch_sql, ( self.args.idMovie, ) )
+ # increment the times watched
+ times_watched = cursor.fetchone()[ 0 ] + 1
+ # get todays date
+ last_watched = datetime.date.today()
+ # update the record with our new values
+ cursor.execute( update_sql, ( times_watched, last_watched,
self.args.idMovie, ) )
+ # commit the update
+ db.commit()
+ # close the database
+ db.close()
+ except:
+ # oops print error message
+ print "ERROR: %s::%s (%d) - %s" % ( self.__class__.__name__,
sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno,
sys.exc_info()[ 1 ], )
=======================================
--- /dev/null
+++
/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/lib/videos.py
Mon Aug 16 08:49:42 2010
@@ -0,0 +1,352 @@
+"""
+ Videos module: fetches a list of playable streams for a specific
category
+"""
+
+# main imports
+import sys
+import os
+import xbmc
+import xbmcgui
+import xbmcplugin
+try:
+ import xbmcaddon
+except:
+ # get xbox compatibility module
+ from xbox import *
+ xbmcaddon = XBMCADDON()
+
+import re
+from random import randrange
+
+from pysqlite2 import dbapi2 as sqlite
+
+_ = xbmcaddon.Addon( id="plugin.video.apple.movie.trailers"
).getLocalizedString
+_S = xbmcaddon.Addon( id="plugin.video.apple.movie.trailers" ).getSetting
+
+
+class _Info:
+ def __init__( self, *args, **kwargs ):
+ self.__dict__.update( kwargs )
+
+
+class Main:
+ # base paths
+ BASE_DATA_PATH = os.path.join(
xbmc.translatePath( "special://masterprofile/"
), "addon_data", "script.apple.movie.trailers" )
+
+ def __init__( self ):
+ self._get_settings()
+ self._parse_argv()
+ self.get_videos()
+
+ def _parse_argv( self ):
+ # call _Info() with our formatted argv to create the self.args
object
+ exec "self.args = _Info(%s)" % ( sys.argv[ 2 ][ 1 :
].replace( "&", ", " ), )
+
+ def _get_settings( self ):
+ self.settings = {}
+ self.settings[ "quality" ] = int( _S( "quality" ) )
+ self.settings[ "only_hd" ] = _S( "only_hd" ) == "true"
+ self.settings[ "play_all" ] = _S( "play_all" ) == "true"
+ self.settings[ "rating" ] = int( _S( "rating" ) )
+ self.settings[ "mode" ] = int( _S( "mode" ) )
+ self.settings[ "download_path" ] = xbmc.translatePath(
_S( "download_path" ) )
+ self.settings[ "mark_watched" ] = _S( "mark_watched" ) == "true"
+ self.settings[ "whole_words" ] = _S( "whole_words" ) == "true"
+ #self.settings[ "player_core" ] = int( _S( "player_core" ) )
+ self.settings[ "fanart_genre" ] = _S( "fanart_genre" ) == "true"
+ self.settings[ "fanart_genre_path" ] = _S( "fanart_genre_path" )
+ self.settings[ "fanart_image" ] = _S( "fanart_image" )
+ self.settings[ "fanart_color1" ] = _S( "fanart_color1" )
+ self.settings[ "fanart_color2" ] = _S( "fanart_color2" )
+ self.settings[ "fanart_color3" ] = _S( "fanart_color3" )
+ self.settings[ "amt_db_path" ] = xbmc.translatePath(
_S( "amt_db_path" ) )
+
+ def get_videos( self ):
+ try:
+ # fetch trailers from database
+ if ( self.args.genre_id == -99 ):
+ trailers = self._search_query()
+ else:
+ trailers = self._genre_query()
+ # fill media list
+ ok = self._fill_media_list( trailers )
+ except:
+ # oops print error message
+ print "ERROR: %s::%s (%d) - %s" % ( self.__class__.__name__,
sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno,
sys.exc_info()[ 1 ], )
+ ok = False
+ # send notification we're finished, successfully or unsuccessfully
+ xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ),
succeeded=ok )
+
+ def _parse_extra_info( self, records ):
+ if ( not records ): return self.args.genre, "", []
+ genre = ""
+ studio = records[ 0 ][ 1 ]
+ cast = []
+ for record in records:
+ if ( record[ 0 ] not in genre ):
+ genre += record[ 0 ] + " / "
+ if ( record[ 2 ] not in cast ):
+ cast += [ record[ 2 ] ]
+ genre = genre[ : -3 ]
+ return genre, studio, cast
+
+ def _fill_media_list( self, trailers ):
+ try:
+ records = Records( amt_db_path=self.settings[ "amt_db_path" ] )
+ ok = True
+ # enumerate through the list of trailers and add the item to
the media list
+ for trailer in trailers:
+ # select the correct trailer quality.
+ url = self._get_trailer_url( trailer[ 0 ], eval( trailer[
3 ] ), eval( trailer[ 13 ] ) )
+ if ( url ):
+ # check for a valid thumbnail
+ thumbnail = ""
+ if ( trailer[ 4 ] and trailer[ 4 ] is not None ):
+ thumbnail = os.path.join(
self.BASE_DATA_PATH, ".cache", trailer[ 4 ][ 0 ], trailer[ 4 ] )
+ # set the default icon
+ icon = "DefaultVideo.png"
+ # if a rating exists format it
+ rating = ( "", "[%s]" % trailer[ 7 ], )[ trailer[ 7
] != "" ]
+ # if a plot does not exist, use a default message
+ plot = ( "No synopsis provided by the studio.",
trailer[ 5 ], )[ trailer[ 5 ] != "" ]
+ # only need to add label, icon and thumbnail,
setInfo() and addSortMethod() takes care of label2
+ listitem = xbmcgui.ListItem( trailer[ 1 ], rating,
iconImage=icon, thumbnailImage=thumbnail )
+ # fetch extra info
+ result = records.fetch( Query()[ "extra" ], ( trailer[
0 ], ) )
+ # parse information
+ genre, studio, cast = self._parse_extra_info( result )
+ # set watched status
+ watched = trailer[ 10 ] > 0
+ # set an overlay if one is practical
+ overlay = ( xbmcgui.ICON_OVERLAY_NONE,
xbmcgui.ICON_OVERLAY_HD, )[ "720p.mov" in url or "1080p.mov" in url ]
+ overlay = ( overlay, xbmcgui.ICON_OVERLAY_WATCHED, )[
watched ]
+ # release date and year
+ try:
+ parts = trailer[ 9 ].split( " " )
+ year = int( parts[ 2 ] )
+ day = int( parts[ 1 ][ : -3 ] )
+ month =
[ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
].index( parts[ 0 ] ) + 1
+ release_date = "%02d-%02d-%04d" % ( day, month,
year, )
+ except:
+ release_date = ""
+ year = 0
+ # add the different infolabels we want to sort by
+ listitem.setInfo( type="Video",
infoLabels={ "Watched": watched, "Date": release_date, "Overlay":
overlay, "Duration": trailer[ 6 ], "MPAA": rating, "Plot":
plot, "Plotoutline": plot, "Title": trailer[ 1 ], "Year": year, "Genre":
genre, "Studio": studio, "Cast": cast } )
+ # set release date property
+ listitem.setProperty( "releasedate", trailer[ 9 ] )
+ # add the item to the media list
+ ok = xbmcplugin.addDirectoryItem( handle=int(
sys.argv[ 1 ] ), url=url, listitem=listitem, totalItems=len(trailers) )
+ # if user cancels, call raise to exit loop
+ if ( not ok ): raise
+ except:
+ # user cancelled dialog or an error occurred
+ print "ERROR: %s::%s (%d) - %s" % ( self.__class__.__name__,
sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno,
sys.exc_info()[ 1 ], )
+ ok = False
+ records.close()
+ # if successful and user did not cancel, set our sort orders,
content, plugin category and fanart
+ if ( ok ):
+ xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_LABEL )
+ xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_DATE )
+ xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_MPAA_RATING )
+ xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_VIDEO_RUNTIME )
+ xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_VIDEO_YEAR )
+ xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_STUDIO )
+ # set content
+ xbmcplugin.setContent( handle=int( sys.argv[ 1 ] ),
content="movies" )
+ try:
+ # set our plugin category
+ xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ),
category=self.args.genre )
+ # set our fanart from user setting
+ if ( self.settings[ "fanart_genre" ] ):
+ # use an image named after the current genre
+ if ( self.settings[ "fanart_genre_path" ] ):
+ image_path = os.path.join(
self.settings[ "fanart_genre_path" ], self.args.genre + ".tbn" )
+ if ( os.path.isfile ( image_path ) ):
+ xbmcplugin.setPluginFanart( handle=int(
sys.argv[ 1 ] ), image=image_path, color1=self.settings[ "fanart_color1" ],
color2=self.settings[ "fanart_color2" ],
color3=self.settings[ "fanart_color3" ] )
+ elif ( self.settings[ "fanart_image" ] ):
+ xbmcplugin.setPluginFanart( handle=int( sys.argv[ 1 ]
), image=self.settings[ "fanart_image" ],
color1=self.settings[ "fanart_color1" ],
color2=self.settings[ "fanart_color2" ],
color3=self.settings[ "fanart_color3" ] )
+ except:
+ pass
+ return ok
+
+ def _get_trailer_url( self, idMovie, trailer_urls, saved_trailers ):
+ # pick a random url (only really applies to multiple urls)
+ rnd = randrange( len( trailer_urls ) )
+ total = rnd + 1
+ urls = []
+ # if play_all is enabled we want to cycle through all the videos
+ if ( self.settings[ "play_all" ] and len( trailer_urls ) > 1 ):
+ rnd = 0
+ total = len( trailer_urls )
+ for count in range( rnd, total ):
+ # get intial choice
+ choice = ( self.settings[ "quality" ], len( trailer_urls[
count ] ) - 1, )[ self.settings[ "quality" ] >= len( trailer_urls[ count ]
) ]
+ # if quality is non progressive
+ if ( self.settings[ "quality" ] <= 2 ):
+ # select the correct non progressive trailer
+ while ( trailer_urls[ count ][ choice ].endswith( "p.mov"
) and choice != -1 ): choice -= 1
+ # quality is progressive
+ else:
+ # select the proper progressive quality
+ quality = ( "480p", "720p", "1080p", )[
self.settings[ "quality" ] - 3 ]
+ # select the correct progressive trailer
+ while ( quality not in trailer_urls[ count ][ choice ] and
trailer_urls[ count ][ choice ].endswith( "p.mov" ) and choice != -1 ):
choice -= 1
+ # if there was a valid trailer set it
+ if ( choice >= 0 and ( not self.settings[ "only_hd" ] or
self.settings[ "quality" ] < 4 or ( self.settings[ "only_hd" ] and
self.settings[ "quality" ] > 3 and ( "720p.mov" in trailer_urls[ count ][
choice ] or "1080p.mov" in trailer_urls[ count ][ choice ] ) ) ) ):
+ urls += [ trailer_urls[ count ][ choice ] ]
+ # sort the urls, same as in main script
+ urls.sort()
+ # initialize our new list
+ url_list = []
+ # enumerate through the urls and check if a saved trailer exists
+ for url in urls:
+ for trailer in saved_trailers:
+ # if a svaed trailer with the exact http address exists,
use the saved trailer
+ if ( url == trailer[ 1 ] ):
+ url = trailer[ 0 ]
+ break
+ # add our url to the new list
+ url_list += [ url ]
+ # we now join multiple urls together and create a stack:// url to
pass to the player module
+ url = " , ".join( url_list )
+ if ( " , " in url ):
+ url = "stack://" + url
+ # TODO: fix player core when XBMC supports it
+ # if it is a stack:// url (multiple trailers), we want to download
the trailer or mark it as watched, set the new url callback to the plugin
+ if ( url and ( url.startswith( "stack://" ) or
self.settings[ "mode" ] > 0 or self.settings[ "mark_watched" ] ) ):#or
self.settings[ "player_core" ] > 0 ) ):
+ url = "%s?idMovie=%d&trailer_url=%s" % ( sys.argv[ 0 ],
idMovie, repr( url ), )
+ return url
+
+ def _fetch_records( self, query, params=None ):
+ records = Records( amt_db_path=self.settings[ "amt_db_path" ] )
+ result = records.fetch( query, params )
+ records.close()
+ return result
+
+ def _genre_query( self ):
+ trailers = self._fetch_records( Query()[ "movies" ] %
self._get_limits(), ( self.args.genre_id, ) )
+ return trailers
+
+ def _get_limits( self ):
+ # HD sql statement
+ hd_sql = ( "", "AND (movies.trailer_urls LIKE '%720p.mov%' OR
movies.trailer_urls LIKE '%1080p.mov%')", )[ self.settings[ "only_hd" ] and
( self.settings[ "quality" ] > 3 ) ]
+ # mpaa ratings
+ mpaa_ratings = [ "G", "PG", "PG-13", "R", "NC-17" ]
+ rating_sql = ""
+ # if the user set a valid rating add all up to the selection
+ if ( self.settings[ "rating" ] < len( mpaa_ratings ) ):
+ user_rating = mpaa_ratings[ self.settings[ "rating" ] ]
+ rating_sql = "AND ("
+ # enumerate through mpaa ratings and add the selected ones to
our sql statement
+ for rating in mpaa_ratings:
+ rating_sql += "rating='%s' OR " % ( rating, )
+ # if we found the users choice, we're finished
+ if ( rating == user_rating ): break
+ # fix the sql statement
+ rating_sql = rating_sql[ : -4 ] + ") "
+ return ( hd_sql, rating_sql, )
+
+ def _search_query( self ):
+ trailers = []
+ qv = self.get_keyboard( heading=_( 30501 ) )
+ xbmc.sleep(10)
+ if ( qv ):
+ keywords = qv.split()
+ where = ""
+ compare = False
+ pattern = ( "LIKE '%%%s%%'", "regexp('\\b%s\\b')", )[
self.settings[ "whole_words" ] ]
+ for word in keywords:
+ if ( word.upper() == "AND" or word.upper() == "OR" ):
+ where += " %s " % word.upper()
+ compare = False
+ continue
+ elif ( word.upper() == "NOT" ):
+ where += "NOT "
+ continue
+ elif ( compare ):
+ where += " AND "
+ compare = False
+ where += "(title %s OR " % ( pattern % ( word, ), )
+ where += "plot %s OR " % ( pattern % ( word, ), )
+ where += "actor %s OR " % ( pattern % ( word, ), )
+ where += "studio %s OR " % ( pattern % ( word, ), )
+ where += "genre %s)" % ( pattern % ( word, ), )
+ compare = True
+ trailers = self._fetch_records( Query()[ "search" ] % ( (
where, ) + self._get_limits() ), )
+ return trailers
+
+ def get_keyboard( self, default="", heading="", hidden=False ):
+ """ shows a keyboard and returns a value """
+ keyboard = xbmc.Keyboard( default, heading, hidden )
+ keyboard.doModal()
+ if ( keyboard.isConfirmed() ):
+ return keyboard.getText()
+ return default
+
+class Records:
+ def __init__( self, *args, **kwargs ):
+ self.connect( kwargs[ "amt_db_path" ] )
+
+ def connect( self, db ):
+ self.db = sqlite.connect( db )
+ self.db.create_function( "regexp", 2, self.regexp )
+ self.cursor = self.db.cursor()
+
+ def regexp( self, pattern, item ):
+ return re.search( pattern, item, re.IGNORECASE ) is not None
+
+ def close( self ):
+ self.db.close()
+
+ def fetch( self, sql, params=None ):
+ try:
+ if ( params is not None ): self.cursor.execute( sql, params )
+ else: self.cursor.execute( sql )
+ retval = self.cursor.fetchall()
+ except:
+ # oops print error message
+ print "ERROR: %s::%s (%d) - %s" % ( self.__class__.__name__,
sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno,
sys.exc_info()[ 1 ], )
+ retval = []
+ return retval
+
+
+class Query( dict ):
+ def __init__( self ):
+ self[ "extra" ] = """
+ SELECT genres.genre, studios.studio,
actors.actor
+ FROM movies, genres, genre_link_movie,
studios, studio_link_movie, actors, actor_link_movie
+ WHERE movies.idMovie=?
+ AND
studio_link_movie.idMovie=movies.idMovie
+ AND
studio_link_movie.idStudio=studios.idStudio
+ AND
actor_link_movie.idMovie=movies.idMovie
+ AND
actor_link_movie.idActor=actors.idActor
+ AND
genre_link_movie.idMovie=movies.idMovie
+ AND
genre_link_movie.idGenre=genres.idGenre;
+ """
+
+ self[ "movies" ] = """
+ SELECT movies.*
+ FROM movies, genre_link_movie
+ WHERE
genre_link_movie.idMovie=movies.idMovie
+ AND genre_link_movie.idGenre=?
+ AND movies.trailer_urls IS NOT NULL
+ AND movies.trailer_urls!='[]'
+ %s
+ %s;
+ """
+
+ self[ "search" ] = """
+ SELECT DISTINCT movies.*
+ FROM movies, genres, genre_link_movie,
studios, studio_link_movie, actors, actor_link_movie
+ WHERE %s
+ AND movies.trailer_urls IS NOT NULL
+ AND movies.trailer_urls!='[]'
+ %s
+ %s
+ AND
studio_link_movie.idMovie=movies.idMovie
+ AND
studio_link_movie.idStudio=studios.idStudio
+ AND
actor_link_movie.idMovie=movies.idMovie
+ AND
actor_link_movie.idActor=actors.idActor
+ AND
genre_link_movie.idMovie=movies.idMovie
+ AND
genre_link_movie.idGenre=genres.idGenre;
+ """
=======================================
--- /dev/null
+++
/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/resources/lib/xbox.py
Mon Aug 16 08:49:42 2010
@@ -0,0 +1,99 @@
+""" xbox compatibilty module """
+
+import sys
+import os
+import xbmc
+import re
+
+def _append_module_paths():
+ # main modules path
+ modulepath = xbmc.translatePath( "special://home/scripts/.modules" )
+ # get modules
+ modules = os.listdir( modulepath )
+ # loop thru and append the lib folder to path
+ for module in modules:
+ # make full path
+ fullpath = os.path.join( modulepath, module, "lib" )
+ # only add modules with a lib folder
+ # FIXME: will this be the only format? (module.name/lib)
+ if ( os.path.isdir( fullpath ) ):
+ sys.path.append( fullpath )
+# FIXME: do we want to add this directly in xbmc4xbox to match xbmc (this
doesn't work properly)
+_append_module_paths()
+
+# path of main addon
+_path = os.getcwd()
+# check if we're at root folder of addon
+if ( not os.path.isfile( os.path.join( _path, "addon.xml" ) ) ):
+ # we're not at root, assume resources/lib/
+ _path = os.path.dirname( os.path.dirname( os.getcwd() ) )
+
+# language method
+_L_ = xbmc.Language( _path ).getLocalizedString
+# settings method, try catch necessary as not all scripts have settings
+try:
+ _S_ = xbmc.Settings( _path )
+except:
+ _S_ = None
+
+
+class XBMCADDON:
+ """
+ xbmcaddon module class
+ """
+ # dictionary to hold addon info
+ INFO = {}
+
+ class Addon:
+ """
+ Class to emulate xbmcaddon.Addon methods.
+ """
+ def __init__( self, id ):
+ # TODO: do we want to use id for anything?
+ # parse addon.xml and set all addon info
+ self._set_addon_info( id )
+
+ def _set_addon_info( self, id ):
+ # get source
+ xml = open( os.path.join( _path, "addon.xml" ), "r" ).read()
+ # regex's
+ addon_regex = re.compile( "<addon
id=\"([^\"]+)\".+?name=\"([^\"]+)\".+?version=\"([^\"]+)\".+?provider-name=\"([^\"]+)\".*?>",
re.DOTALL )
+ metadata_type_regex = re.compile( "<extension
point=\"([^\"]+)\".+?library=\"([^\"]+)\".*?>", re.DOTALL )
+ metadata_summary_regex =
re.compile( "<summary>([^<]*)</summary>", re.DOTALL )
+ metadata_disclaimer_regex =
re.compile( "<disclaimer>([^<]*)</disclaimer>", re.DOTALL )
+ metadata_description_regex =
re.compile( "<description>([^<]*)</description>", re.DOTALL )
+ # set addon.xml info into dictionary
+ XBMCADDON.INFO[ "id" ], XBMCADDON.INFO[ "name" ],
XBMCADDON.INFO[ "version" ], XBMCADDON.INFO[ "author" ] =
addon_regex.search( xml ).groups( 1 )
+ XBMCADDON.INFO[ "type" ] = metadata_type_regex.search( xml
).group( 1 )
+ XBMCADDON.INFO[ "summary" ] = metadata_summary_regex.search(
xml ).group( 1 )
+ XBMCADDON.INFO[ "disclaimer" ] =
metadata_disclaimer_regex.search( xml ).group( 1 )
+ XBMCADDON.INFO[ "description" ] =
metadata_description_regex.search( xml ).group( 1 )
+ # set other info
+ XBMCADDON.INFO[ "path" ] = _path
+ XBMCADDON.INFO[ "icon" ] = os.path.join( _path, "default.tbn" )
+ XBMCADDON.INFO[ "fanart" ] = os.path.join( _path, "fanart.jpg"
)
+ XBMCADDON.INFO[ "changelog" ] = os.path.join(
_path, "changelog.txt" )
+ if ( _path.startswith( "Q:\\plugins" ) and not
_path.startswith( "Q:\\plugins\\weather" ) ):
+ XBMCADDON.INFO[ "profile" ]
= "special://profile/plugin_data/%s/%s" % ( os.path.basename(
os.path.dirname( _path ) ), os.path.basename( _path ), )
+ else:
+ XBMCADDON.INFO[ "profile" ]
= "special://profile/script_data/%s" % ( os.path.basename( _path ), )
+
+ @staticmethod
+ def getLocalizedString( id ):
+ return _L_( id )
+
+ @staticmethod
+ def getSetting( id ):
+ return _S_.getSetting( id )
+
+ @staticmethod
+ def setSetting( id, value ):
+ _S_.setSetting( id, value )
+
+ @staticmethod
+ def openSettings():
+ _S_.openSettings()
+
+ @staticmethod
+ def getAddonInfo( id ):
+ return XBMCADDON.INFO[ id.lower() ]
=======================================
--- /addons/script.apple.movie.trailers/addon.py Fri Jul 9 12:06:38 2010
+++ /addons/script.apple.movie.trailers/addon.py Mon Aug 16 08:49:42 2010
@@ -2,8 +2,12 @@
import sys
import os

-import xbmcaddon
-
+try:
+ import xbmcaddon
+except:
+ # get xbox compatibility module
+ from resources.lib.xbox import *
+ xbmcaddon = XBMCADDON()

# Script constants
__scriptname__ = "Apple Movie Trailers"
@@ -11,62 +15,40 @@
__url__ = "http://code.google.com/p/xbmc-scripting/"
__svn_url__
= "http://xbmc-scripting.googlecode.com/svn/trunk/Apple%20Movie%20Trailers"
__credits__ = "XBMC TEAM, freenode/#xbmc-scripting"
-__version__ = "pre-0.99.8"
-__svn_revision__ = "$Revision$"
+__version__ = "2.0.0"
__XBMC_Revision__ = "31632"

-def _check_compatible():
- try:
- # spam plugin statistics to log
- xbmc.log( "[SCRIPT] '%s: Version - %s-r%s' initialized!" % (
__scriptname__, __version__, __svn_revision__.replace( "$", ""
).replace( "Revision", "" ).replace( ":", "" ).strip() ), xbmc.LOGNOTICE )
- # get xbmc revision
- xbmc_rev = int( xbmc.getInfoLabel( "System.BuildVersion"
).split( " r" )[ -1 ] )
- # compatible?
- ok = xbmc_rev >= int( __XBMC_Revision__ )
- except:
- # error, so unknown, allow to run
- xbmc_rev = 0
- ok = 2
- # spam revision info
- xbmc.log( " ** Required XBMC Revision: r%s **" % (
__XBMC_Revision__, ), xbmc.LOGNOTICE )
- xbmc.log( " ** Found XBMC Revision: r%d [%s] **" % ( xbmc_rev,
( "Not Compatible", "Compatible", "Unknown", )[ ok ], ), xbmc.LOGNOTICE )
- # if not compatible, inform user
- if ( not ok ):
- import xbmcgui
- import os
- # inform user
- xbmcgui.Dialog().ok( "%s - %s: %s" % ( __script__, __language__(
32700 ), __version__, ), __language__( 32701 ) % ( __script__, ),
__language__( 32702 ) % ( __XBMC_Revision__, ), __language__( 32703 ) )
- #return result
- return ok
-
+def _log_start():
+ # spam plugin statistics to log
+ xbmc.log( "[SCRIPT] '%s: Version - %s' initialized!" % (
__scriptname__, __version__, ), xbmc.LOGNOTICE )

# Shared resources
BASE_RESOURCE_PATH = os.path.join( os.getcwd(), "resources" )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ) )

# create our language object
-__language__ = xbmcaddon.Addon( id="script.apple.movie.trailers"
).getLocalizedString
+__Addon__ = xbmcaddon.Addon( id=os.path.basename( os.getcwd() ) )

# Main team credits
-__credits_l1__ = __language__( 910 )#"Head Developer & Coder"
+__credits_l1__ = __Addon__.getLocalizedString( 910 )#"Head Developer &
Coder"
__credits_r1__ = "Killarny"
-__credits_l2__ = __language__( 911 )#"Coder & Skinning"
+__credits_l2__ = __Addon__.getLocalizedString( 911 )#"Coder & Skinning"
__credits_r2__ = "Nuka1195"
-__credits_l3__ = __language__( 912 )#"Graphics & Skinning"
+__credits_l3__ = __Addon__.getLocalizedString( 912 )#"Graphics & Skinning"
__credits_r3__ = "Pike"

# additional credits
-__add_credits_l1__ = __language__( 1 )#"Xbox Media Center"
+__add_credits_l1__ = __Addon__.getLocalizedString( 1 )#"Xbox Media Center"
__add_credits_r1__ = "Team XBMC"
-__add_credits_l2__ = __language__( 913 )#"Usability"
+__add_credits_l2__ = __Addon__.getLocalizedString( 913 )#"Usability"
__add_credits_r2__ = "Spiff & JMarshall"
-__add_credits_l3__ = __language__( 914 )#"Language File"
-__add_credits_r3__ = __language__( 2 )#"Translators name"
+__add_credits_l3__ = __Addon__.getLocalizedString( 914 )#"Language File"
+__add_credits_r3__ = __Addon__.getLocalizedString( 2 )#"Translators name"


# Start the main gui
if __name__ == "__main__":
# only run if compatible
- if ( _check_compatible() ):
- # main window
- import gui
+ _log_start()
+ # main window
+ import gui
=======================================
--- /addons/script.apple.movie.trailers/addon.xml Fri Jul 9 12:06:38 2010
+++ /addons/script.apple.movie.trailers/addon.xml Mon Aug 16 08:49:42 2010
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.apple.movie.trailers" name="Apple Movie Trailers"
version="pre-0.99.8" provider-name="nuka1195">
+<addon id="script.apple.movie.trailers" name="Apple Movie Trailers"
version="2.0.0" provider-name="nuka1195">
<requires>
<import addon="xbmc.python" version="1.0"/>
<import addon="script.module.pysqlite" version="2.5.6"/>
+ <import addon="script.module.elementtree" version="1.2.7"/>
<import addon="script.module.pil" version="1.1.7"/>
</requires>
<extension point="xbmc.python.script" library="addon.py">
@@ -10,9 +11,8 @@
</extension>
<extension point="xbmc.addon.metadata">
<platform>all</platform>
- <minversion>31632</minversion>
<summary>Watch movie trailers.</summary>
- <description>Watch movie trailers from http://trailers.apple.com/.
Check movie showtimes for theaters in your area.</description>
<disclaimer></disclaimer>
+ <description>Watch movie trailers from http://trailers.apple.com/.
Check movie showtimes for theaters in your area.</description>
</extension>
</addon>
=======================================
--- /addons/script.apple.movie.trailers/icon.png Fri Jul 9 12:06:38 2010
+++ /addons/script.apple.movie.trailers/icon.png Mon Aug 16 08:49:42 2010
Binary file, no diff available.
=======================================
--- /addons/script.apple.movie.trailers/resources/lib/cacheurl.py Fri Jul
9 12:06:38 2010
+++ /addons/script.apple.movie.trailers/resources/lib/cacheurl.py Mon Aug
16 08:49:42 2010
@@ -27,7 +27,7 @@
#__useragent__ = "iTunes/4.7"
__useragent__ = "QuickTime/7.2 (qtver=7.2;os=Windows NT 5.1Service Pack 3)"

-_ = sys.modules[ "__main__" ].__language__
+_ = sys.modules[ "__main__" ].__Addon__.getLocalizedString


def percent_from_ratio( top, bottom ):
=======================================
--- /addons/script.apple.movie.trailers/resources/lib/chooser.py Fri Jul 9
12:06:38 2010
+++ /addons/script.apple.movie.trailers/resources/lib/chooser.py Mon Aug 16
08:49:42 2010
@@ -11,10 +11,9 @@

from utilities import *

-_ = sys.modules[ "__main__" ].__language__
+_ = sys.modules[ "__main__" ].__Addon__.getLocalizedString
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
-__svn_revision__ = sys.modules[ "__main__" ].__svn_revision__


class GUI( xbmcgui.WindowXMLDialog ):
=======================================
--- /addons/script.apple.movie.trailers/resources/lib/context_menu.py Fri
Jul 9 12:06:38 2010
+++ /addons/script.apple.movie.trailers/resources/lib/context_menu.py Mon
Aug 16 08:49:42 2010
@@ -9,10 +9,9 @@

from utilities import *

-_ = sys.modules[ "__main__" ].__language__
+_ = sys.modules[ "__main__" ].__Addon__.getLocalizedString
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
-__svn_revision__ = sys.modules[ "__main__" ].__svn_revision__


class GUI( xbmcgui.WindowXMLDialog ):
=======================================
--- /addons/script.apple.movie.trailers/resources/lib/credits.py Fri Jul 9
12:06:38 2010
+++ /addons/script.apple.movie.trailers/resources/lib/credits.py Mon Aug 16
08:49:42 2010
@@ -9,11 +9,10 @@

from utilities import *

-_ = sys.modules[ "__main__" ].__language__
+_ = sys.modules[ "__main__" ].__Addon__.getLocalizedString
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
__svn_url__ = sys.modules[ "__main__" ].__svn_url__
-__svn_revision__ = sys.modules[ "__main__" ].__svn_revision__


class GUI( xbmcgui.WindowXMLDialog ):
@@ -30,7 +29,7 @@
try:
#team credits
self.getControl( 20 ).setLabel( __scriptname__ )
- self.getControl( 30 ).setLabel( "%s: %s-%s" % ( _( 1006 ),
__version__, __svn_revision__, ) )
+ self.getControl( 30 ).setLabel( "%s: %s" % ( _( 1006 ),
__version__, ) )
self.getControl( 40 ).addLabel( __svn_url__ )
self.getControl( 901 ).setLabel( _( 901 ) )
self.getControl( 101 ).reset()
=======================================
--- /addons/script.apple.movie.trailers/resources/lib/database.py Fri Jul
9 12:06:38 2010
+++ /addons/script.apple.movie.trailers/resources/lib/database.py Mon Aug
16 08:49:42 2010
@@ -13,10 +13,9 @@

from utilities import *

-_ = sys.modules[ "__main__" ].__language__
+_ = sys.modules[ "__main__" ].__Addon__.getLocalizedString
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
-__svn_revision__ = sys.modules[ "__main__" ].__svn_revision__


class Database:
=======================================
--- /addons/script.apple.movie.trailers/resources/lib/gui.py Fri Jul 9
12:06:38 2010
+++ /addons/script.apple.movie.trailers/resources/lib/gui.py Mon Aug 16
08:49:42 2010
@@ -15,10 +15,9 @@
else:
dialog.close()

-_ = sys.modules[ "__main__" ].__language__
+_ = sys.modules[ "__main__" ].__Addon__.getLocalizedString
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
-__svn_revision__ = sys.modules[ "__main__" ].__svn_revision__

try:
_progress_dialog( None )
@@ -854,7 +853,11 @@
##if ( self.Timer is not None ): self.Timer.cancel()
self._set_video_resolution( True )
self.close()
- if ( restart ): xbmc.executebuiltin( "XBMC.RunScript(%s)" % (
os.path.join( os.getcwd(), "addon.py" ), ) )
+ if ( restart ):
+ if ( os.path.isfile( os.path.join( os.getcwd(), "addon.py" ) )
):
+ xbmc.executebuiltin( "XBMC.RunScript(%s)" % (
os.path.join( os.getcwd(), "addon.py" ), ) )
+ else:
+ xbmc.executebuiltin( "XBMC.RunScript(%s)" % (
os.path.join( os.getcwd(), "default.py" ), ) )

def onClick( self, controlId ):
try:
@@ -941,7 +944,6 @@

def main():
_progress_dialog( len( modules ) + 1, _( 55 ) )
- settings = Settings().get_settings()
ui = GUI( "script-%s-main.xml" % ( __scriptname__.replace( " ", "_" ),
), os.getcwd(), "Default", "PAL16x9" )
_progress_dialog( -1 )
ui.doModal()
=======================================
--- /addons/script.apple.movie.trailers/resources/lib/search.py Fri Jul 9
12:06:38 2010
+++ /addons/script.apple.movie.trailers/resources/lib/search.py Mon Aug 16
08:49:42 2010
@@ -12,10 +12,9 @@
from utilities import *
import database

-_ = sys.modules[ "__main__" ].__language__
+_ = sys.modules[ "__main__" ].__Addon__.getLocalizedString
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
-__svn_revision__ = sys.modules[ "__main__" ].__svn_revision__


class GUI( xbmcgui.WindowXMLDialog ):
@@ -51,7 +50,7 @@
def _set_labels( self ):
try:
self.getControl( self.CONTROL_TITLE_LABEL ).setLabel(
__scriptname__ )
- self.getControl( self.CONTROL_VERSION_LABEL
).setLabel( "%s: %s-%s" % ( _( 1006 ), __version__, __svn_revision__, ) )
+ self.getControl( self.CONTROL_VERSION_LABEL
).setLabel( "%s: %s" % ( _( 1006 ), __version__, ) )
self.getControl( self.CONTROL_SQL_RESULTS_LABEL
).setLabel( "%s:" % ( _( 93 ), ) )
self.getControl( 102 ).setLabel( _( 113 ) )
self.getControl( 112 ).setLabel( _( 114 ) )
=======================================
--- /addons/script.apple.movie.trailers/resources/lib/settings.py Fri Jul
9 12:06:38 2010
+++ /addons/script.apple.movie.trailers/resources/lib/settings.py Mon Aug
16 08:49:42 2010
@@ -12,10 +12,9 @@
from utilities import *
import chooser

-_ = sys.modules[ "__main__" ].__language__
+_ = sys.modules[ "__main__" ].__Addon__.getLocalizedString
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
-__svn_revision__ = sys.modules[ "__main__" ].__svn_revision__


class GUI( xbmcgui.WindowXMLDialog ):
@@ -42,7 +41,7 @@
def _set_labels( self ):
try:
#self.getControl( 20 ).setLabel( __scriptname__ )
- self.getControl( 30 ).setLabel( "%s: %s-%s" % ( _( 1006 ),
__version__, __svn_revision__, ) )
+ self.getControl( 30 ).setLabel( "%s: %s" % ( _( 1006 ),
__version__, ) )
#self.getControl( 250 ).setLabel( _( 250 ) )
#self.getControl( 251 ).setLabel( _( 251 ) )
#self.getControl( 252 ).setLabel( _( 252 ) )
=======================================
--- /addons/script.apple.movie.trailers/resources/lib/showtimes.py Fri Jul
9 12:06:38 2010
+++ /addons/script.apple.movie.trailers/resources/lib/showtimes.py Mon Aug
16 08:49:42 2010
@@ -11,11 +11,10 @@
ShowtimesFetcher = showtimesScraper.ShowtimesFetcher()
from utilities import *

-_ = sys.modules[ "__main__" ].__language__
+_ = sys.modules[ "__main__" ].__Addon__.getLocalizedString
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
__svn_url__ = sys.modules[ "__main__" ].__svn_url__
-__svn_revision__ = sys.modules[ "__main__" ].__svn_revision__


class GUI( xbmcgui.WindowXMLDialog ):
=======================================
--- /addons/script.apple.movie.trailers/resources/lib/trailers.py Fri Jul
9 12:06:38 2010
+++ /addons/script.apple.movie.trailers/resources/lib/trailers.py Mon Aug
16 08:49:42 2010
@@ -15,10 +15,9 @@
fetcher = cacheurl.HTTP()
BASE_CACHE_PATH = fetcher.cache_dir + os.sep

-_ = sys.modules[ "__main__" ].__language__
+_ = sys.modules[ "__main__" ].__Addon__.getLocalizedString
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
-__svn_revision__ = sys.modules[ "__main__" ].__svn_revision__


class Movie:
=======================================
--- /addons/script.apple.movie.trailers/resources/lib/update.py Fri Jul 9
12:06:38 2010
+++ /addons/script.apple.movie.trailers/resources/lib/update.py Mon Aug 16
08:49:42 2010
@@ -13,10 +13,9 @@

socket.setdefaulttimeout( 10 )

-_ = sys.modules[ "__main__" ].__language__
+_ = sys.modules[ "__main__" ].__Addon__.getLocalizedString
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
-__svn_revision__ = sys.modules[ "__main__" ].__svn_revision__


class Parser( SGMLParser ):
=======================================
--- /addons/script.apple.movie.trailers/resources/lib/utilities.py Fri Jul
9 12:06:38 2010
+++ /addons/script.apple.movie.trailers/resources/lib/utilities.py Mon Aug
16 08:49:42 2010
@@ -11,13 +11,13 @@

DEBUG_MODE = 0

-_ = sys.modules[ "__main__" ].__language__
+_ = sys.modules[ "__main__" ].__Addon__.getLocalizedString
+__Addon__ = sys.modules[ "__main__" ].__Addon__
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__version__ = sys.modules[ "__main__" ].__version__
-__svn_revision__ = sys.modules[ "__main__" ].__svn_revision__

# comapatble versions
-DATABASE_VERSIONS =
( "pre-0.99.7.1", "pre-0.99.7.2", "pre-0.99.7.3", "pre-0.99.7.3a", "pre-0.99.7.3b", "pre-0.99.8",
)
+DATABASE_VERSIONS =
( "pre-0.99.7.1", "pre-0.99.7.2", "pre-0.99.7.3", "pre-0.99.7.3a", "pre-0.99.7.3b", "pre-0.99.8", "2.0.0",
)
SETTINGS_VERSIONS = DATABASE_VERSIONS
# special categories
GENRES = -1
@@ -32,9 +32,9 @@
MULTIPLE_TRAILERS = -12
CUSTOM_SEARCH = -99
# base paths
-BASE_DATA_PATH = os.path.join(
xbmc.translatePath( "special://masterprofile/" ), "addon_data",
os.path.basename( os.getcwd() ) )
-BASE_SETTINGS_PATH = os.path.join(
xbmc.translatePath( "special://profile/" ), "addon_data", os.path.basename(
os.getcwd() ), "settings.txt" )
-BASE_DATABASE_PATH = os.path.join(
xbmc.translatePath( "special://profile/" ), "addon_data", os.path.basename(
os.getcwd() ), "AMT.db" )
+BASE_DATA_PATH = __Addon__.getAddonInfo( "Profile" )
+BASE_SETTINGS_PATH = os.path.join( xbmc.translatePath(
__Addon__.getAddonInfo( "Profile" ) ), "settings.txt" )
+BASE_DATABASE_PATH = os.path.join( xbmc.translatePath(
__Addon__.getAddonInfo( "Profile" ) ), "AMT.db" )
BASE_RESOURCE_PATH = sys.modules[ "__main__" ].BASE_RESOURCE_PATH
# special button codes
SELECT_ITEM = ( 11, 256, 61453, )
@@ -270,5 +270,5 @@
settings_file.close()
return True
except:
- LOG( LOG_ERROR, "%s (rev: %s) %s::%s (%d) [%s]",
__scriptname__, __svn_revision__, self.__class__.__name__, sys.exc_info()[
2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno, sys.exc_info()[
1 ], )
+ LOG( LOG_ERROR, "%s %s::%s (%d) [%s]", __scriptname__,
self.__class__.__name__, sys.exc_info()[ 2 ].tb_frame.f_code.co_name,
sys.exc_info()[ 2 ].tb_lineno, sys.exc_info()[ 1 ], )
return False
=======================================
---
/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/addon.py
Fri Jul 9 12:06:38 2010
+++
/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/addon.py
Mon Aug 16 08:49:42 2010
@@ -19,9 +19,9 @@

if ( __name__ == "__main__" ):
if ( not sys.argv[ 2 ] ):
- from amtAPI import xbmcplugin_categories as plugin
+ from resources.lib import categories as plugin
elif ( "idMovie=" in sys.argv[ 2 ] ):
- from amtAPI import xbmcplugin_player as plugin
+ from resources.lib import player as plugin
else:
- from amtAPI import xbmcplugin_videos as plugin
+ from resources.lib import videos as plugin
plugin.Main()
=======================================
---
/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/addon.xml
Fri Jul 9 12:06:38 2010
+++
/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/addon.xml
Mon Aug 16 08:49:42 2010
@@ -1,18 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.apple.movie.trailers" name="Apple Movie Trailers"
version="1.5.0" provider-name="nuka1195">
+<addon id="plugin.video.apple.movie.trailers" name="Apple Movie Trailers"
version="2.0.0" provider-name="nuka1195">
<requires>
<import addon="xbmc.python" version="1.0"/>
<import addon="script.module.pysqlite" version="2.5.6"/>
- <import addon="script.apple.movie.trailers" version="pre-0.99.8"/>
+ <import addon="script.apple.movie.trailers" version="2.0.0"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
<platform>all</platform>
- <minversion>31632</minversion>
<summary>Watch movie trailers.</summary>
- <description>Watch movie trailers from
http://trailers.apple.com/.</description>
<disclaimer>Requires AMT script and database created.</disclaimer>
+ <description>Watch movie trailers from
http://trailers.apple.com/.</description>
</extension>
</addon>
=======================================
---
/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/icon.png
Fri Jul 9 12:06:38 2010
+++
/addons/script.apple.movie.trailers/resources/plugins/plugin.video.apple.movie.trailers/icon.png
Mon Aug 16 08:49:42 2010
Binary file, no diff available.

Reply all
Reply to author
Forward
0 new messages