otaku_info.wrappers package

Submodules

otaku_info.wrappers.UpdateWrapper module

class otaku_info.wrappers.UpdateWrapper.UpdateWrapper(media_user_state: otaku_info.db.MediaUserState.MediaUserState)

Bases: object

Class that encapsulates important data to display for manga updates

__init__(media_user_state: otaku_info.db.MediaUserState.MediaUserState)

Initializes the MangaUpdate object :param media_user_state: The media user state contains everything we

need. For performance reasons, it’s assumed that all relations have been loaded already.

calculate_latest() int
Returns

The latest release number

calculate_progress() int
Returns

The user’s current progress

classmethod from_db(user: jerrycan.db.User.User, list_name: str, service: otaku_info.enums.ListService, media_type: otaku_info.enums.MediaType, media_subtype: Optional[otaku_info.enums.MediaSubType], minimum_diff: int, include_complete: bool)

Generates UpdateWrapper objects based on a couple of parameters and the current database contents :param user: The user for whom to load the updates :param list_name: The list name for which to load the updates :param service: The service for which to load the updates :param media_type: The media type for which to load the updates :param media_subtype: If specified, limits the results to a specific

media subtype (example: Light novels)

Parameters
  • minimum_diff – Specifies a minimum diff value

  • include_complete – Specifies whether completed items should be included

Returns

A list of UpdateWrapper objects

classmethod from_media_lists(media_lists: List[otaku_info.db.MediaList.MediaList], media_subtype: Optional[otaku_info.enums.MediaSubType], minimum_diff: int, include_complete: bool) List[otaku_info.wrappers.UpdateWrapper.UpdateWrapper]

Generates UpdateWrapper objects based on media lists To avoid huge performance problems, the relations should be fully loaded beforehand, preferably in a single query. Results can be filtered using the additional parameters :param media_lists: The media lists containing the items to wrap :param media_subtype: If specified, limits the results to a specific

media subtype (example: Light novels)

Parameters
  • minimum_diff – Specifies a minimum diff value

  • include_complete – Specifies whether completed items should be included

Returns

A list of UpdateWrapper objects

Module contents