UpdateManga
This module contains functions to update manga details such as status, progress, and privacy settings. It also includes functions to handle the updating process, including creating a dictionary of variables for updating, updating the status and progress of the manga, and sending the update request to the Anilist API.
Get_Chapters_Updated
¶
Get the number of chapters updated.
This function returns the global variable chapters_updated which keeps track of the number of chapters updated.
RETURNS | DESCRIPTION |
---|---|
int
|
The number of chapters updated.
TYPE:
|
Source code in AnilistMangaUpdater/API/UpdateManga.py
Set_Chapters_Updated
¶
Set the number of chapters updated to zero.
This function sets the global variable chapters_updated to zero. It's typically used to reset the count of chapters updated.
Source code in AnilistMangaUpdater/API/UpdateManga.py
Update_Manga
¶
Update_Manga(manga: object, app: object, chapter_anilist: int, manga_status: Union[int, str, None]) -> Optional[bool]
Updates the manga in the user's list.
This function gets the user ID if it's not already set, updates the status of the manga, updates the variables for the manga, and updates the progress of the manga.
PARAMETER | DESCRIPTION |
---|---|
manga |
The manga to update.
TYPE:
|
app |
The application instance.
TYPE:
|
chapter_anilist |
The current progress of the manga in the user's list.
TYPE:
|
manga_status |
The current status of the manga in the user's list.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Optional[bool]
|
None |
Source code in AnilistMangaUpdater/API/UpdateManga.py
update_manga_progress
¶
update_manga_progress(manga: object, app: object, variables_list: list, chapter_anilist: int) -> Optional[bool]
Updates the progress of the given manga.
This function sends a mutation request to the Anilist API to update the progress of the manga. It iterates over the list of variables, sends the request for each set of variables, and checks the response. If the response is successful and the last read is greater than the chapter from Anilist, updates the chapter progress and prints a message. If the response is not successful, it prints an error message and returns.
PARAMETER | DESCRIPTION |
---|---|
manga |
The manga object whose progress is to be updated. The manga object should have 'name',
TYPE:
|
app |
The application instance.
TYPE:
|
variables_list |
A list of dictionaries, each containing the variables for the mutation request.
TYPE:
|
chapter_anilist |
The current chapter of the manga from Anilist.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Optional[bool]
|
None |
Source code in AnilistMangaUpdater/API/UpdateManga.py
update_manga_variables
¶
update_manga_variables(manga_id: int, progress: Optional[Union[int, None]] = None, status: Optional[Union[str, None]] = None, private: Optional[Union[bool, None]] = None) -> dict
Creates a dictionary of variables for updating a manga.
PARAMETER | DESCRIPTION |
---|---|
manga_id |
The ID of the manga to update.
TYPE:
|
progress |
The progress of the manga. Default is None.
TYPE:
|
status |
The status of the manga. Default is None.
TYPE:
|
private |
The privacy setting of the manga. Default is None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict
|
A dictionary of variables for updating a manga, excluding any parameters that are None.
TYPE:
|
Source code in AnilistMangaUpdater/API/UpdateManga.py
update_status
¶
Updates the status of the given manga.
PARAMETER | DESCRIPTION |
---|---|
manga |
The manga object whose status is to be updated. The manga object should
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
The updated status of the manga.
TYPE:
|
Source code in AnilistMangaUpdater/API/UpdateManga.py
update_variables
¶
update_variables(manga: object, chapter_anilist: Union[str, int, None], manga_status: Union[str, int, None]) -> list[dict]
Updates the variables for the given manga.
PARAMETER | DESCRIPTION |
---|---|
manga |
The manga object whose variables are to be updated. The manga object should
TYPE:
|
chapter_anilist |
The current chapter of the manga from Anilist.
TYPE:
|
manga_status |
The current status of the manga in the user's list.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list
|
A list of dictionaries, each containing the variables for the mutation request.
TYPE:
|