changed float to int to fix a bug

This commit is contained in:
Moe Fwacky
2021-02-22 00:41:40 -08:00
committed by GitHub
parent d179b8100f
commit cab85e22f1

View File

@@ -131,7 +131,7 @@ for channel_dir in channel_dirs:
rndsql = "SELECT * FROM shows WHERE (customSectionName NOT LIKE 'playlist' AND duration BETWEEN 6000 and 999000) ORDER BY RANDOM() LIMIT 1"
table.execute(rndsql)
the_show = table.fetchone()
entryList['duration'] = str("1,"+str(int(the_show[4]) / 60000))
entryList['duration'] = str("1,"+str(int(the_show[4] / 60000)))
entryList['title'] = the_show[3]
entryList['startTime'] = "00:00:00"
entryList['dayOfWeek'] = "everyday"
@@ -173,7 +173,7 @@ for channel_dir in channel_dirs:
rndsql = "SELECT * FROM shows WHERE (customSectionName NOT LIKE 'playlist' AND duration BETWEEN ? and ?) ORDER BY RANDOM() LIMIT 1"
table.execute(rndsql, ("60000", str(maxMS)))
the_show = table.fetchone()
entryList['duration'] = str("1,"+str(int(the_show[4]) / 60000))
entryList['duration'] = str("1,"+str(int(the_show[4] / 60000)))
entryList['endTime'] = datetime.datetime.fromtimestamp(float(entryList['startTimeUnix']) + the_show[4]/1000).strftime("%H:%M:%S")
entryList['title'] = the_show[3]
entryList['overlapMax'] = round(float(entryList['duration'].split(',')[1]) * 0.5)