Skip to content

Commit

Permalink
bugfix for m1v with movies and shows
Browse files Browse the repository at this point in the history
  • Loading branch information
DonDavici committed Mar 8, 2015
1 parent 0c4bcd0 commit f8bf379
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/DP_View.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
from DPH_ScreenHelper import DPH_ScreenHelper, DPH_MultiColorFunctions, DPH_Screen, DPH_Filter
from DP_ViewFactory import getNoneDirectoryElements, getDefaultDirectoryElementsList, getGuiElements

from __common__ import printl2 as printl, loadPicture, durationToTime, getLiveTv, encodeThat, getOeVersion, checkXmlFile, getXmlContent
from __common__ import printl2 as printl, loadPicture, durationToTime, getLiveTv, encodeThat, getOeVersion, checkXmlFile, getXmlContent, getSkinResolution
from __plugin__ import Plugin
from __init__ import _ # _ is translation

Expand Down Expand Up @@ -181,6 +181,8 @@ def __init__(self, viewClass, libraryName, loadLibraryFnc, viewParams):

self.setListViewElementsCount()

self.skinResulution = getSkinResolution()

self.usePicCache = config.plugins.dreamplex.usePicCache.value

self.noneDirectoryElementsList = getNoneDirectoryElements()
Expand Down Expand Up @@ -1969,21 +1971,24 @@ def handlePictures(self):
printl("self.loadedStillPictureLib: " + str(self.loadedStillPictureLib), self, "D")

#first we need to remove the file extension
myFileWoExtension = self.whatBackdrop
myFileWoExtension = self.whatBackdrop[:-4]

# now add the m1v file extension
self.whatBackdrop = myFileWoExtension + ".m1v"
backdropMovie = myFileWoExtension + ".m1v"

if self.skinResulution == "FHD":
new_backdrop_postfix = "_backdrop_1920x1080_v2"
else:
new_backdrop_postfix = "_backdrop_1280x720_v2"

# we used this code earlier. but this leads to no m1v usage in shows
# todo after tests remove this
# backdrop = config.plugins.dreamplex.mediafolderpath.value + str(self.image_prefix) + "_" + str(self.details["ratingKey"]) + "_backdrop_1280x720_v2.m1v"
printl("backdrop: " + str(self.whatBackdrop), self, "D")
backdropMovie = backdropMovie.replace(self.backdrop_postfix[:-4], new_backdrop_postfix)
printl("backdropMovie: " + str(backdropMovie), self, "D")

# check if the backdrop m1v exists
if os.access(self.whatBackdrop, os.F_OK):
if os.access(backdropMovie, os.F_OK):
printl("yes", self, "D")
self["miniTv"].show()
self["stillPicture"].setStillPicture(self.whatBackdrop)
self["stillPicture"].setStillPicture(backdropMovie)
self["backdrop"].hide()
self.usedStillPicture = True
else:
Expand Down

0 comments on commit f8bf379

Please sign in to comment.