Index: ipk/source/mediacenter_mediathek_2_8/usr/lib/enigma2/python/Plugins/Extensions/MultiMediathek/plugin.py
===================================================================
--- ipk/source/mediacenter_mediathek_2_7/usr/lib/enigma2/python/Plugins/Extensions/MultiMediathek/plugin.py	(revision 7056)
+++ ipk/source/mediacenter_mediathek_2_8/usr/lib/enigma2/python/Plugins/Extensions/MultiMediathek/plugin.py	(revision 7145)
@@ -3,5 +3,5 @@
 # Coded by Homey (c) 2011
 #
-# Version: 2.7
+# Version: 2.8.2
 # Support: www.i-have-a-dreambox.com
 #####################################################
@@ -32,5 +32,5 @@
 
 from enigma import ePicLoad, eTimer, getDesktop, eConsoleAppContainer, eBackgroundFileEraser, eServiceReference, iServiceInformation, iPlayableService
-from os import stat as os_stat, listdir as os_listdir, path as os_path, system as os_system
+from os import stat as os_stat, listdir as os_listdir, path as os_path, readlink as os_readlink, system as os_system
 from time import time
 from twisted.web.client import getPage, downloadPage
@@ -58,8 +58,14 @@
 config.plugins.multimediathek.imagecache = ConfigEnableDisable(default=True)
 config.plugins.multimediathek.imagescaling = ConfigSelection(default="1", choices = [("0", _("simple")), ("1", _("better"))])
+config.plugins.multimediathek.imagescaler = ConfigSelection(default="0", choices = [("0", _("decodePic()")), ("1", _("getThumbnail()"))])
 config.plugins.multimediathek.showadultcontent = ConfigYesNo(default=False)
 config.plugins.multimediathek.showsecretcontent = ConfigYesNo(default=False)
-config.plugins.multimediathek.checkforupdate = ConfigYesNo(default=False)
-config.plugins.multimediathek.version = NoSave(ConfigText(default="270"))
+config.plugins.multimediathek.version = NoSave(ConfigText(default="282"))
+
+default = config.plugins.multimediathek.storagepath.value + "/mediathek/movies"
+tmp = config.movielist.videodirs.value
+if default not in tmp:
+	tmp.append(default)
+config.plugins.multimediathek.moviedir = ConfigSelection(default=default, choices=tmp)
 
 #################################
@@ -70,4 +76,5 @@
 	def __init__(self, toolbox, cmdline, filename, filetitle):
 		Job.__init__(self, _("Download Movie"))
+		self.filename = filename
 		self.toolbox = toolbox
 		self.retrycount = 0
@@ -78,5 +85,9 @@
 		self.retrycount += 1
 		self.restart()
-	
+
+	def cancel(self):
+		self.abort()
+		os_system("rm -f %s" % self.filename)
+		
 class downloadTask(Task):
 	ERROR_CORRUPT_FILE, ERROR_RTMP_ReadPacket, ERROR_SEGFAULT, ERROR_SERVER, ERROR_UNKNOWN = range(5)
@@ -246,5 +257,5 @@
 		self.textcolor = "#F7F7F7"
 		self.bgcolor = "#000000"
-		textsize = 20
+		self.textsize = 20
 
 		# Create Thumblist
@@ -266,6 +277,6 @@
 			absY = self.spaceTop + self.spaceY + (posY*(self.spaceY + self.picY))
 			self.positionlist.append((absX, absY))
-			skincontent += "<widget source=\"label" + str(x) + "\" render=\"Label\" position=\"" + str(absX+2) + "," + str(absY+self.picY-textsize-10) + "\" size=\"" + str(self.picX - 10) + ","  + str((textsize*2)+10) + "\" halign=\"center\" font=\"Regular;" + str(textsize) + "\" zPosition=\"4\" transparent=\"1\" foregroundColor=\"" + self.textcolor + "\" />"
-			skincontent += "<widget name=\"thumb" + str(x) + "\" position=\"" + str(absX)+ "," + str(absY+5) + "\" size=\"" + str(self.picX -10) + "," + str(self.picY - (textsize*2)) + "\" zPosition=\"4\" transparent=\"1\" alphatest=\"on\" />"
+			skincontent += "<widget source=\"label" + str(x) + "\" render=\"Label\" position=\"" + str(absX+2) + "," + str(absY+self.picY-self.textsize-10) + "\" size=\"" + str(self.picX - 10) + ","  + str((self.textsize*2)+10) + "\" halign=\"center\" font=\"Regular;" + str(self.textsize) + "\" zPosition=\"4\" transparent=\"1\" foregroundColor=\"" + self.textcolor + "\" />"
+			skincontent += "<widget name=\"thumb" + str(x) + "\" position=\"" + str(absX)+ "," + str(absY+5) + "\" size=\"" + str(self.picX -10) + "," + str(self.picY - (self.textsize*2)) + "\" zPosition=\"4\" transparent=\"1\" alphatest=\"on\" />"
 
 		# Screen, backgroundlabel and MovingPixmap
@@ -315,5 +326,5 @@
 		self.picload = ePicLoad()
 		self.picload.PictureData.get().append(self.showThumbPixmap)
-		self.picload.setPara((self.picX-10, self.picY-(textsize*2), sc[0], sc[1], config.plugins.multimediathek.imagecache.value, int(config.plugins.multimediathek.imagescaling.value), "#00000000"))
+		self.picload.setPara((self.picX-10, self.picY-(self.textsize*2), sc[0], sc[1], config.plugins.multimediathek.imagecache.value, int(config.plugins.multimediathek.imagescaling.value), "#00000000"))
 
 		# Init eBackgroundFileEraser
@@ -321,5 +332,5 @@
 
 		# Check if plugin-update is available
-		if self.feedtitle == "Startseite" and config.plugins.multimediathek.checkforupdate.value:
+		if self.feedtitle == "Startseite":
 			self.onLayoutFinish.append(self.checkforupdate)
 
@@ -339,9 +350,14 @@
 		# Check if cache folder is on a mountable device and not inside flash-memory
 		tmppath = config.plugins.multimediathek.storagepath.value
-		while not os_path.ismount(tmppath):
-			tmppath = os_path.dirname(tmppath)
-			if tmppath == "/":
-				self["pageinfo"].setText(_("Error: Can not create cache-folders inside flash memory. Check your Cache-Folder Settings!"))
-				return False
+		if tmppath != "/tmp" and tmppath != "/media/ba":
+			if os_path.islink(tmppath):
+				tmppath = os_readlink(tmppath)
+			loopcount = 0
+			while not os_path.ismount(tmppath):
+				loopcount += 1
+				tmppath = os_path.dirname(tmppath)
+				if tmppath == "/" or tmppath == "" or loopcount > 50:
+					self["pageinfo"].setText(_("Error: Can not create cache-folders inside flash memory. Check your Cache-Folder Settings!"))
+					return False
 
 		# Create Cache Folders ...
@@ -399,5 +415,5 @@
 			getpageurl = unquote(tmpurls[1])
 			self.postpageurl = unquote(tmpurls[0])
-			getPage(getpageurl).addCallback(self.ForwardExternalPage).addErrback(self.getxmlfeedError)
+			getPage(getpageurl, agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)").addCallback(self.ForwardExternalPage).addErrback(self.getxmlfeedError)
 		else:
 			getPage(feedurl).addCallback(self.gotxmlfeed).addErrback(self.getxmlfeedError)
@@ -409,6 +425,8 @@
 	def getxmlfeedError(self, error=""):
 		self["pageinfo"].setText("Error downloading XML Feed!\n\n" + str(error))
-
+		print error
+		
 	def gotxmlfeed(self, page=""):
+		print page
 		self["pageinfo"].setText("Parsing XML Feeds ...")
 		xml = parseString(page)
@@ -502,6 +520,10 @@
 
 	def gotThumbnail(self, data=""):
-		self.picload.startDecode(self.thumbfile)
-
+		if config.plugins.multimediathek.imagescaler.value == "0":
+			self.picload.startDecode(self.thumbfile)
+		elif self.picload.getThumbnail(self.thumbfile) == 1:
+			if self.thumbcount+1 < len(self.Thumbnaillist):
+				self.getThumbnail()
+		
 	def showThumbPixmap(self, picInfo=None):
 		ptr = self.picload.getData()
@@ -698,5 +720,5 @@
 		config.mediaplayer.save()
 
-		self.moviefolder = config.plugins.multimediathek.storagepath.value+"/mediathek/movies"
+		self.moviefolder = config.plugins.multimediathek.moviedir.value
 		self.imagefolder = config.plugins.multimediathek.storagepath.value+"/mediathek/images"
 
@@ -744,5 +766,5 @@
 				getpageurl = unquote(tmpurls[1])
 				self.postpageurl = unquote(tmpurls[0])
-				getPage(getpageurl).addCallback(self.ForwardExternalPage).addErrback(self.error)
+				getPage(getpageurl, agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)").addCallback(self.ForwardExternalPage).addErrback(self.error)
 			else:
 				getPage(self.url).addCallback(self.GotMovieInfo).addErrback(self.error)
@@ -790,5 +812,5 @@
 				getpageurl = tmpurls[1]
 				self.postpageurl = tmpurls[0]
-				getPage(getpageurl).addCallback(self.ForwardExternalMovieList).addErrback(self.error)
+				getPage(getpageurl, agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)").addCallback(self.ForwardExternalMovieList).addErrback(self.error)
 			else:
 				getPage(self.movieinfo[1]).addCallback(self.GotMovieList).addErrback(self.error)
@@ -860,5 +882,5 @@
 				getpageurl = tmpurls[1]
 				self.postpageurl = tmpurls[0]
-				getPage(getpageurl).addCallback(self.ForwardExternalMovieList).addErrback(self.error)
+				getPage(getpageurl, agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)").addCallback(self.ForwardExternalMovieList).addErrback(self.error)
 				return
 			
@@ -1331,8 +1353,9 @@
 		self.cfglist.append(getConfigListEntry(_("Thumbnail Caching:"), config.plugins.multimediathek.imagecache))
 		self.cfglist.append(getConfigListEntry(_("Thumbnail Scaling Mode:"), config.plugins.multimediathek.imagescaling))
+		self.cfglist.append(getConfigListEntry(_("Thumbnail Scaler:"), config.plugins.multimediathek.imagescaler))
 		self.cfglist.append(getConfigListEntry(_("Show Adult Content:"), config.plugins.multimediathek.showadultcontent))
 		#self.cfglist.append(getConfigListEntry(_("Show Secret Content:"), config.plugins.multimediathek.showsecretcontent))
+		self.cfglist.append(getConfigListEntry(_("Download Directory:"), config.plugins.multimediathek.moviedir))
 		self.cfglist.append(getConfigListEntry(_("Cache Folder:"), config.plugins.multimediathek.storagepath))
-		self.cfglist.append(getConfigListEntry(_("Check for updates:"), config.plugins.multimediathek.checkforupdate))
 		ConfigListScreen.__init__(self, self.cfglist, session)
 
