Skip to content

Commit

Permalink
[ APROVED ] [ BUG FIX ] Change Manganato manga created date to 24H fo…
Browse files Browse the repository at this point in the history
…rmat

Merge pull request #67 from NokutokaMomiji/master
Fixed bugs in repositories/manganato.py
  • Loading branch information
AlexandreSenpai committed Mar 8, 2024
2 parents ff04b7a + ba05454 commit a17b0b5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions enma/infra/adapters/repositories/manganato.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ def __create_title(self,
main_title: str,
alternative: str) -> Title:
logger.debug(f'Building manga title main: {main_title} and alternative: {alternative}')

has_many_alternatives = alternative.find(';') != -1 or alternative.find(',') != -1

if not has_many_alternatives:
jp = alternative
return Title(english=main_title.strip(),
japanese=jp.strip(),
other=main_title.strip())

jp, cn, *_ = alternative.split(';') if alternative.find(';') != -1 else alternative.split(',')
return Title(english=main_title.strip(),
japanese=jp.strip(),
Expand Down Expand Up @@ -149,8 +158,8 @@ def get(self,
authors=[Author(name=author)] if author is not None else None,
genres=[Genre(name=genre_name) for genre_name in genres],
id=identifier,
created_at=datetime.strptime(updated_at, "%b %d,%Y - %I:%M %p") if updated_at else None,
updated_at=datetime.strptime(updated_at, "%b %d,%Y - %I:%M %p") if updated_at else None,
created_at=datetime.strptime(updated_at, "%b %d,%Y - %H:%M %p") if updated_at else None,
updated_at=datetime.strptime(updated_at, "%b %d,%Y - %H:%M %p") if updated_at else None,
thumbnail=Image(uri=cover), # type: ignore
cover=Image(uri=cover), # type: ignore
chapters=chapters) # type: ignore
Expand Down

0 comments on commit a17b0b5

Please sign in to comment.