From 11e132fea20a3c9005970187003b2c951d2520db Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Tue, 18 Dec 2012 14:49:34 -0600
Subject: mythplugins: cherry picked from r7-testing  new mythburn patch

---
 abs/core/mythtv/stable-0.25/git_src/git_hash       |  2 +-
 .../stable-0.25/mythplugins/mythburn.py.patch      | 55 ++++++++++++----------
 2 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/abs/core/mythtv/stable-0.25/git_src/git_hash b/abs/core/mythtv/stable-0.25/git_src/git_hash
index a355c36..43086a0 100644
--- a/abs/core/mythtv/stable-0.25/git_src/git_hash
+++ b/abs/core/mythtv/stable-0.25/git_src/git_hash
@@ -1 +1 @@
-0b6040610e74eb01146f37e0f0630f503f8b6e78
+18c793a2450b03b78ac227d8b0417395530d55d9
diff --git a/abs/core/mythtv/stable-0.25/mythplugins/mythburn.py.patch b/abs/core/mythtv/stable-0.25/mythplugins/mythburn.py.patch
index 7b385b3..380385b 100644
--- a/abs/core/mythtv/stable-0.25/mythplugins/mythburn.py.patch
+++ b/abs/core/mythtv/stable-0.25/mythplugins/mythburn.py.patch
@@ -1,11 +1,11 @@
 --- mythburn.py.orig	2012-12-16 15:23:41.000000000 -0600
-+++ mythburn.py	2012-12-16 15:33:37.000000000 -0600
++++ mythburn.py	2012-12-18 14:23:56.000000000 -0600
 @@ -44,7 +44,7 @@
  
  
  # version of script - change after each update
 -VERSION="0.1.20120304-1"
-+VERSION="0.1.20121210-1"
++VERSION="0.1.20121218-1"
  
  # keep all temporary files for debugging purposes
  # set this to True before a first run through when testing
@@ -62,28 +62,33 @@
  
      video = infoDOM.getElementsByTagName("file")[0].getElementsByTagName("streams")[0].getElementsByTagName("video")[0]
      video_start = float(video.attributes["start_time"].value)
-@@ -1432,9 +1433,18 @@
+@@ -1432,9 +1433,23 @@
  
          data.rating = str(vid.userrating)
  
 -        if doesFileExist(vid.coverfile):
+-            data.coverfile = vid.coverfile
++        data.coverfile = None
+ 
 +        #Check filename for valid path. If valid return nothing.
-+        if doesFileExist(str(vid.coverfile)):
++        if os.path.isfile(str(vid.coverfile)):
 +            write("Coverart is in local directory: %s" % vid.coverfile)
-             data.coverfile = vid.coverfile
--
++            data.coverfile = vid.coverfile
 +        else:
 +            # iterate through storage group directories to get Coverart
 +            for sg in DB.getStorageGroup(groupname='Coverart', hostname=DB.gethostname()):
-+                if doesFileExist(os.path.join(sg.dirname, str(vid.coverfile))):
++                if os.path.isfile(os.path.join(sg.dirname, str(vid.coverfile))):
 +                    write("Coverart is in Storage Groups: %s%s" % (sg.dirname, vid.coverfile))
 +                    data.coverfile = os.path.join(sg.dirname, str(vid.coverfile))
 +                    break
-+                
++                    
++        if data.coverfile == None:
++            write("No Coverart Found")
++               
      elif file.attributes["type"].value=="file":
          data.type =         file.attributes["type"].value
          data.filename =     file.attributes["filename"].value
-@@ -1485,6 +1495,28 @@
+@@ -1485,6 +1500,30 @@
  
  
  #############################################################
@@ -94,25 +99,27 @@
 +    filepath = None
 +
 +    #Check filename for valid path. If valid return nothing.
-+    if doesFileExist(filename):
-+        write("Video is in local video dir: %s" % filename)
++    if os.path.isfile(filename):
++        write("Video is in local video directory: %s" % filename)
 +        return (filepath)
 +    else:
 +        # iterate through storage group directories
 +        for sg in DB.getStorageGroup(groupname='Videos', hostname=DB.gethostname()):
 +            wholepath = os.path.join(sg.dirname, filename)
-+            if doesFileExist(wholepath):
++            if os.path.isfile(wholepath):
 +                write("Video is in Storage Groups: %s" % wholepath)
 +                filepath = "".join(sg.dirname)
 +                return (filepath)
 +                break
-+
++    
++    if filepath == None:
++        write("Video is not in local video directory or Storage Groups")
 +
 +#############################################################
  # Pre-process a single video/recording file
  
  def preProcessFile(file, folder, count):
-@@ -1501,7 +1533,7 @@
+@@ -1501,7 +1540,7 @@
      if file.attributes["type"].value == "recording":
          mediafile = file.attributes["filename"].value
      elif file.attributes["type"].value == "video":
@@ -121,7 +128,7 @@
      elif file.attributes["type"].value == "file":
          mediafile = file.attributes["filename"].value
      else:
-@@ -1661,6 +1693,37 @@
+@@ -1661,6 +1700,37 @@
          fatalError("Failed while running mytharchivehelper to get stream information.\n"
                     "Result: %d, Command was %s" % (result, command))
  
@@ -159,7 +166,7 @@
      # print out the streaminfo.xml file to the log
      infoDOM = xml.dom.minidom.parse(xmlFilename)
      write(xmlFilename + ":-\n" + infoDOM.toprettyxml("    ", ""), False)
-@@ -1707,7 +1770,7 @@
+@@ -1707,7 +1777,7 @@
          write("Using cutlist: %s" % cutlist_s)
  
      if (localfile != ""):
@@ -168,7 +175,7 @@
          if usecutlist == True:
              command = "mythtranscode --mpeg2 --honorcutlist %s --infile %s --outfile %s" % (cutlist_s, quoteCmdArg(localfile), quoteCmdArg(destination))
          else:
-@@ -1973,7 +2036,7 @@
+@@ -1973,7 +2043,7 @@
  #############################################################
  # Re-encodes a file to mpeg2
  
@@ -177,7 +184,7 @@
      """Encodes an unknown video source file eg. AVI to MPEG2 video and AC3 audio, use mythffmpeg"""
  
      profileNode = findEncodingProfile(profile)
-@@ -1998,7 +2061,36 @@
+@@ -1998,7 +2068,36 @@
              value = quoteCmdArg(destvideofile)
          if value == "%aspect":
              value = aspectratio
@@ -214,7 +221,7 @@
          # only re-encode the audio if it is not already in AC3 format
          if audio1[AUDIO_CODEC] == "AC3":
              if name == "-acodec":
-@@ -2094,10 +2186,6 @@
+@@ -2094,10 +2193,6 @@
      outaudiosamplerate = 48000
      outaudiocodec = "ac3"
      deinterlace = 0
@@ -225,7 +232,7 @@
      qmin = 5
      qmax = 31
      qdiff = 31
-@@ -2121,14 +2209,6 @@
+@@ -2121,14 +2216,6 @@
              outvideores = value
          if name == "-deinterlace":
              deinterlace = 1
@@ -240,7 +247,7 @@
          if name == "-qmin":
             qmin = value
          if name == "-qmax":
-@@ -4409,7 +4489,7 @@
+@@ -4409,7 +4496,7 @@
      elif file.attributes["type"].value=="recording":
          mediafile = file.attributes["filename"].value
      elif file.attributes["type"].value=="video":
@@ -249,7 +256,7 @@
      elif file.attributes["type"].value=="file":
          mediafile=file.attributes["filename"].value
      else:
-@@ -4547,7 +4627,7 @@
+@@ -4547,7 +4634,7 @@
  
              #do the re-encode 
              encodeVideoToMPEG2(mediafile, os.path.join(folder, "newfile2.mpg"), video,
@@ -258,7 +265,7 @@
              mediafile = os.path.join(folder, 'newfile2.mpg')
  
              #remove the old mediafile that was run through mythtranscode
-@@ -4621,7 +4701,7 @@
+@@ -4621,7 +4708,7 @@
      elif file.attributes["type"].value=="recording":
          mediafile = file.attributes["filename"].value
      elif file.attributes["type"].value=="video":
@@ -267,7 +274,7 @@
      elif file.attributes["type"].value=="file":
          mediafile=file.attributes["filename"].value
      else:
-@@ -4701,7 +4781,7 @@
+@@ -4701,7 +4788,7 @@
  
              #do the re-encode 
              encodeVideoToMPEG2(mediafile, os.path.join(folder, "newfile2.mpg"), video,
-- 
cgit v0.12