Browse Source

MyPy のエラー対応

feature/query
みてるぞ 1 month ago
parent
commit
d226b443d7
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      update_db.py

+ 2
- 4
update_db.py View File

@@ -91,13 +91,11 @@ def update_tables (
) -> None: ) -> None:
video_ids: list[int] = [] video_ids: list[int] = []
for datum in api_data: for datum in api_data:
tag_names = datum['tags'].split ()
tag_names: list[str] = datum['tags'].split ()
video = VideoDto (code = datum['contentId'], video = VideoDto (code = datum['contentId'],
title = datum['title'], title = datum['title'],
description = datum['description'],
description = datum['description'] or '',
uploaded_at = datetime.fromisoformat (datum['startTime'])) uploaded_at = datetime.fromisoformat (datum['startTime']))
if video.description is None:
video.description = ''
video_dao.upsert (video, False) video_dao.upsert (video, False)
if video.id_ is not None: if video.id_ is not None:
video_ids.append (video.id_) video_ids.append (video.id_)


Loading…
Cancel
Save