otaku_info_web.utils.manga_updates package¶
Submodules¶
otaku_info_web.utils.manga_updates.MangaUpdate module¶
-
class
otaku_info_web.utils.manga_updates.MangaUpdate.
MangaUpdate
(media_item_id: int, title: str, cover_url: str, latest_release: int, progress: int, score: int, chapter_guess: Optional[int], related_ids: List[Tuple[otaku_info_web.utils.enums.ListService, str]])¶ Bases:
object
Class that encapsulates important data to display for manga updates
-
__init__
(media_item_id: int, title: str, cover_url: str, latest_release: int, progress: int, score: int, chapter_guess: Optional[int], related_ids: List[Tuple[otaku_info_web.utils.enums.ListService, str]])¶ Initializes the MangaUpdate object :param media_item_id: The media item ID :param title: The title of the update :param cover_url: The URL for the media item’s cover :param latest_release: The latest known released chapter :param progress: The user’s current progress :param score: The user’s score for this entry :param chapter_guess: The current chapter guess :param related_ids: Related service IDs
-
-
class
otaku_info_web.utils.manga_updates.MangaUpdate.
RelatedMangaId
(service: otaku_info_web.utils.enums.ListService, service_id: str)¶ Bases:
object
Class that encapslates attributes for a related manga ID
-
__init__
(service: otaku_info_web.utils.enums.ListService, service_id: str)¶ Intializes the RelatedMangaId object :param service: The service of the related manga ID :param service_id: The ID on that service
-
otaku_info_web.utils.manga_updates.generator module¶
-
otaku_info_web.utils.manga_updates.generator.
load_applicable_data
(user: puffotter.flask.db.User.User, service: otaku_info_web.utils.enums.ListService, media_list: str, include_complete: bool) → Tuple[Dict[int, Dict[str, Any]], Dict[int, Dict[str, Any]], Dict[int, Dict[str, Any]], Dict[int, Dict[str, Any]], Dict[int, Dict[str, Any]], Dict[int, int]]¶ Loads the applicable data from the database in an efficient manner. By only loading the data we need and avoiding JOINs, the performance is increased drastically. Since this method is called for every call to a manga/updates page, this should be fast. The return values are mostly database IDs mapped to dictionaries containing the data required for displaying manga updates. A notable exception are the manga chapter guesses, which are simply MediaId IDs mapped to the chapter guess value. :param user: The user requesting the manga updates :param service: The service for which to fetch the updates :param media_list: The media list for which to fetch the updates :param include_complete: Whether or not to include completed series :return: media items, media ids, media user states, media lists,
media list items, manga chapter guesses
-
otaku_info_web.utils.manga_updates.generator.
prepare_manga_updates
(user: puffotter.flask.db.User.User, service: otaku_info_web.utils.enums.ListService, media_list: str, include_complete: bool, min_update_count: int) → List[otaku_info_web.utils.manga_updates.MangaUpdate.MangaUpdate]¶ Prepares easily understandable objects to display for manga updates :param user: The user requesting the manga updates :param service: The service for which to fetch the updates :param media_list: The media list for which to fetch the updates :param include_complete: Whether or not to include completed series :param min_update_count: The minimum amount of new chapters required
for an update to be generated
- Returns
A list of MangaUpdate objects, sorted by score