[Database] Chapters: Uses today if not date is provided

This commit is contained in:
Valéry Febvre
2023-05-16 02:09:50 +02:00
parent ce98365a85
commit d84d22075a

View File

@@ -500,6 +500,10 @@ class Manga:
rank = 0
for chapter_data in chapters:
if not chapter_data.get('date'):
# Used today if not date is provided
chapter_data['date'] = datetime.date.today()
chapter = Chapter.new(chapter_data, rank, id_, db_conn)
if chapter is not None:
rank += 1
@@ -776,6 +780,10 @@ class Manga:
rank += 1
else:
# Add new chapter
if not chapter_data.get('date'):
# Used today if not date is provided
chapter_data['date'] = datetime.date.today()
chapter_data.update(dict(
manga_id=self.id,
rank=rank,