From 16ee9e43911cd735caf0e4d0e7c6ae2a82be3056 Mon Sep 17 00:00:00 2001
From: Lawrence Rust <lvr@softsystem.co.uk>
Date: Fri, 25 May 2012 18:55:34 +0200
Subject: [PATCH] Mytharchive: Catch StopIteration exception in mythburn.py
If a DVD is created from a single mpeg video then mythburn.py attempts
to transcode the file to eliminate any errors. However, runMythtranscode
calls DB.searchRecorded, to obtain any cutlist, with an invalid chanid
and starttime which results in a StopIteration exception.
This patch catches the exception and returns an empty cutlist.
Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
---
.../mytharchive/mythburn/scripts/mythburn.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/mythplugins/mytharchive/mythburn/scripts/mythburn.py b/mythplugins/mytharchive/mythburn/scripts/mythburn.py
index fdde4e2..b8e1db3 100755
a
|
b
|
cpuCount = 1 |
190 | 190 | |
191 | 191 | DB = MythTV.MythDB() |
192 | 192 | MVID = MythTV.MythVideo(db=DB) |
| 193 | Video = MythTV.Video() |
193 | 194 | |
194 | 195 | configHostname = DB.gethostname() |
195 | 196 | |
… |
… |
def getVideoSize(xmlFilename): |
1695 | 1696 | def runMythtranscode(chanid, starttime, destination, usecutlist, localfile): |
1696 | 1697 | """Use mythtranscode to cut commercials and/or clean up an mpeg2 file""" |
1697 | 1698 | |
1698 | | rec = DB.searchRecorded(chanid=chanid, starttime=starttime).next() |
1699 | | cutlist = rec.markup.getcutlist() |
| 1699 | try: |
| 1700 | rec = DB.searchRecorded(chanid=chanid, starttime=starttime).next() |
| 1701 | cutlist = rec.markup.getcutlist() |
| 1702 | except StopIteration: |
| 1703 | cutlist = [] |
1700 | 1704 | |
1701 | 1705 | cutlist_s = "" |
1702 | 1706 | if usecutlist and len(cutlist): |