Opened 15 years ago

Closed 15 years ago

#2393 closed defect (fixed)

MythArchive does not export sometimes, due to hascutlist / list index out of range.

Reported by: bsg104@… Owned by: paulh
Priority: minor Milestone: unknown
Component: mytharchive Version: 0.20.1
Severity: medium Keywords: hascutlist list index range
Cc: Ticket locked: no

Description

Line 2875 of mythburn.py:

if file.attributes["usecutlist"].value == "1" and getText(infoDOM.getElementsByTagName("hascutlist")[0]) == "yes":

Causes python to die with an list index out of range error.

Pseudo-traceback:

All in mythburn.py
Line: 3392, in ?
   processJob(job)
Line: 3178, in processJob
   processFile(node,folder)
Line: 2875, in processFile
   if file.attributes["usecutlist"].value == "1" and getText(infoDOM.getElementsByTagName("hascutlist")[0]) == "yes":
IndexError: list index out of range  

I think that it is because this:

details = file.getElementsByTagName("details")
if details.length > 0:

(Which is around line 752?)

causes the code not to run the node = infoDOM.createElement("hascutlist") sections, as this is in an elif block. So by writing a details section, the hascutlist is missed out of the generated info.xml files.

I'm not sure how to fix this, as I dont know python, however, I copied the section from the elif, and cut out all the duplicated code, leaving the "hascutlist" creation and a few other bits, and now the script is actually running.

I think that there should be an if around the content I copied

if file.attributes["type"].value=="recording":

But I dont really know, and I only export recordings, so I leave that up to you! :)

There is almost definitely a much cleaner solution. *Shrugs*

I hope this helps.

Benjie.

Change History (2)

comment:1 Changed 15 years ago by bsg104@…

Note further that this only happens when you change the recordings details through MythArchive?. If you leave the details as they were, recording occurs fine. I also think that when you edit the details, sometimes the cutlist is lost (from the exported files, not the original), but I am not so sure on this.

Regards,

Benjie.

comment:2 Changed 15 years ago by paulh

Resolution: fixed
Status: newclosed

(In [11214]) Make sure we get the chanid, starttime and hascutlist information from the DB for recordings when the script has been passed amended file details in the job file. Fixes #2393.

Note: See TracTickets for help on using tickets.