diff --git a/update_db.py b/update_db.py index 0551daa..168be1e 100644 --- a/update_db.py +++ b/update_db.py @@ -29,7 +29,11 @@ def update_video_table ( video_dao, api_data: list[dict], ) -> None: - videos = video_dao.fetch_all () + # TODO: 書くこと + + video_dao.upsert_all (videos) + + video_dao.delete_nonexistent_data (video_id_list) # TODO: 書くこと @@ -42,7 +46,7 @@ def fetch_comments ( action_track_id = ( ''.join (random.choice (string.ascii_letters + string.digits) - for _ in range (10)) + for _ in range (10)) + '_' + str (random.randrange (10 ** 12, 10 ** 13)))