Ticket #9389: mythplugins-9389-fix_mytharchive_generateProjectXCutlist.patch

File mythplugins-9389-fix_mytharchive_generateProjectXCutlist.patch, 1.3 KB (added by sphery, 8 years ago)

Patch created using generateProjectXCutlist from cutlisttrans.txt

  • mythplugins/mytharchive/mythburn/scripts/mythburn.

    old new  
    20142014        db.close()
    20152015        del db
    20162016        del cursor
    2017         return False
     2017        return False   
     2018
     2019    sqlstatement  = """SELECT mark FROM recordedmarkup
     2020                    WHERE chanid = '%s' AND starttime = '%s'
     2021                    AND type 1 ORDER BY mark LIMIT 1 """ % (chanid, starttime)
     2022
     2023    cursor.execute(sqlstatement)
     2024    firstcut = cursor.fetchall()   
     2025
     2026    sqlstatement  = """SELECT mark FROM recordedmarkup
     2027                    WHERE chanid = '%s' AND starttime = '%s'
     2028                    AND type IN (0,1) ORDER BY mark LIMIT 1 """ % (chanid, starttime)
     2029
     2030    cursor.execute(sqlstatement)
     2031    firstedit = cursor.fetchall()
    20182032
    20192033    cutlist_f=open(os.path.join(folder, "cutlist_x.txt"), 'w')
    20202034    cutlist_f.write("CollectionPanel.CutMode=2\n")
    20212035
     2036    if firstcut == firstedit:
     2037         cutlist_f.write("0\n")
     2038
    20222039    # iterate through resultset
    20232040    for i in range(len(result)):
    2024         if i == 0:
    2025             if result[i][0] <> 0  and result[i][0] != "":
    2026                 cutlist_f.write("0\n")
    20272041        if result[i][0] != "" and result[i][0] <> 0:
    20282042            cutlist_f.write("%d\n" % result[i])
    20292043