From 8aa8c708b9c499b0c10ecd9988de8598aeaafc4f Mon Sep 17 00:00:00 2001 From: miteruzo Date: Sat, 21 Sep 2024 06:06:28 +0900 Subject: [PATCH] =?UTF-8?q?TODO=20=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update_db.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)))