gregoryxie / nicer-rack

MIT License
0 stars 0 forks source link

Plz use branches :( #1

Closed tristan1049 closed 2 years ago

tristan1049 commented 2 years ago

@redhann Might be a couple of bugs in data_handler.py, not sure though, should lmk what you think. If there are, should probably make a branch and PR.

c.execute("""CREATE TABLE IF NOT EXISTS info_db (time_ timestamp, title text, length real, link text, filepath text, thumnbnail text);""") c.execute('''DELETE * FROM ht_db WHERE time_>=?;''',(timestamp)) 1) Is ht_db supposed to be infodb here when deleting using timestamp? 2) Should time>=?; be `time<=?;as we're deleting the older timestamped rows 3) Also I think the c.execute argument should be a tuple, so shouldn't it be(timestamp,)`

Additionally, it might be nice to have a check in insert_data so that we don't insert data if the link already exists in the db.

Last nitpick might be having timestamp as an argument instead of doing it when insert_data is called, though it probably doesn't matter too much.

redhann commented 2 years ago
  1. yes oops
  2. also yes oops
  3. no, it's okay just needs to be a sequence. see https://docs.python.org/3/library/sqlite3.html

I don't want a timestamp argument but I see an argument for tracking the video's last updated info

tristan1049 commented 2 years ago

Looks good, just the two comments on the respective PR. Will close issue since PR is created.