Someone
public text v1 · immutable if logtype == 'M':
songid = 0
while songid == 0:
sql = "SELECT id FROM songs WHERE filename = ?"
self.cur.execute(sql, [job.message])
if self.cur.rowcount < 1:
sql = 'INSERT INTO songs (filename) VALUES (?)'
self.cur.execute(sql, [job.message])
self.con.commit()
else:
songid = self.cur.fetchone()
sql = "INSERT INTO playlist (date, song) VALUES (?, ?)"
args = (job.getTimestamp("%Y-%m-%d %H:%M:%S"), songid)
self.cur.execute(sql, args)
self.con.commit()