-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli):complete subcommands for anilist command
- Loading branch information
Benex254
committed
Jun 30, 2024
1 parent
520bfcb
commit 2aa02d6
Showing
9 changed files
with
79 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
import click | ||
|
||
from ....libs.anilist.anilist import AniList | ||
from ...interfaces.anilist_interfaces import select_anime | ||
from ...utils.tools import QueryDict | ||
|
||
|
||
@click.command() | ||
def popular(): | ||
print("popular") | ||
@click.pass_obj | ||
def popular(config): | ||
anime_data = AniList.get_most_popular() | ||
if anime_data[0]: | ||
anilist_config = QueryDict() | ||
anilist_config.data = anime_data[1] | ||
select_anime(config, anilist_config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
import click | ||
|
||
from ....libs.anilist.anilist import AniList | ||
from ...interfaces.anilist_interfaces import select_anime | ||
from ...utils.tools import QueryDict | ||
|
||
|
||
@click.command() | ||
def recent(): | ||
print("recent") | ||
@click.pass_obj | ||
def recent(config): | ||
anime_data = AniList.get_most_recently_updated() | ||
if anime_data[0]: | ||
anilist_config = QueryDict() | ||
anilist_config.data = anime_data[1] | ||
select_anime(config, anilist_config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import click | ||
|
||
from ....libs.anilist.anilist import AniList | ||
from ...interfaces.anilist_interfaces import select_anime | ||
from ...utils.tools import QueryDict | ||
|
||
|
||
@click.command() | ||
@click.pass_obj | ||
def scores(config): | ||
anime_data = AniList.get_most_scored() | ||
if anime_data[0]: | ||
anilist_config = QueryDict() | ||
anilist_config.data = anime_data[1] | ||
select_anime(config, anilist_config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import click | ||
|
||
from ....libs.anilist.anilist import AniList | ||
from .utils import get_search_result | ||
from ...interfaces.anilist_interfaces import select_anime | ||
from ...utils.tools import QueryDict | ||
|
||
|
||
@click.command() | ||
@click.option("--title", prompt="Enter anime title") | ||
def search(title): | ||
@click.pass_obj | ||
def search(config, title): | ||
success, search_results = AniList.search(title) | ||
if search_results and success: | ||
get_search_result(search_results) | ||
if success: | ||
anilist_config = QueryDict() | ||
anilist_config.data = search_results | ||
select_anime(config, anilist_config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import click | ||
|
||
from ....libs.anilist.anilist import AniList | ||
from .utils import get_search_result | ||
from ...interfaces.anilist_interfaces import select_anime | ||
from ...utils.tools import QueryDict | ||
|
||
|
||
@click.command() | ||
def trending(): | ||
success, trending = AniList.get_trending() | ||
if trending and success: | ||
get_search_result(trending) | ||
@click.pass_obj | ||
def trending(config): | ||
success, data = AniList.get_trending() | ||
if success: | ||
anilist_config = QueryDict() | ||
anilist_config.data = data | ||
select_anime(config, anilist_config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
import click | ||
|
||
from ....libs.anilist.anilist import AniList | ||
from ...interfaces.anilist_interfaces import select_anime | ||
from ...utils.tools import QueryDict | ||
|
||
|
||
@click.command() | ||
def upcoming(): | ||
print("upcoming") | ||
@click.pass_obj | ||
def upcoming(config): | ||
success, data = AniList.get_upcoming_anime() | ||
if success: | ||
anilist_config = QueryDict() | ||
anilist_config.data = data | ||
select_anime(config, anilist_config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters