Ticket #9389: mythplugins-9389-fix_mytharchive_generateProjectXCutlist.patch
File mythplugins-9389-fix_mytharchive_generateProjectXCutlist.patch, 1.3 KB (added by , 13 years ago) |
---|
-
mythplugins/mytharchive/mythburn/scripts/mythburn.
old new 2014 2014 db.close() 2015 2015 del db 2016 2016 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() 2018 2032 2019 2033 cutlist_f=open(os.path.join(folder, "cutlist_x.txt"), 'w') 2020 2034 cutlist_f.write("CollectionPanel.CutMode=2\n") 2021 2035 2036 if firstcut == firstedit: 2037 cutlist_f.write("0\n") 2038 2022 2039 # iterate through resultset 2023 2040 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")2027 2041 if result[i][0] != "" and result[i][0] <> 0: 2028 2042 cutlist_f.write("%d\n" % result[i]) 2029 2043