Fall back to using Spotipy
Would rather have async I/O, but there are too many issues with the data model of other APIs.
This commit is contained in:
@ -3,30 +3,23 @@ Find an album using the `spotify_actions` API and echo its contents.
|
||||
"""
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from asyncio import get_event_loop
|
||||
from logging import DEBUG, basicConfig
|
||||
|
||||
from spotify_actions.echo import echo_album
|
||||
from spotify_actions.search import search_album
|
||||
from spotify_actions.util import read_credentials
|
||||
|
||||
|
||||
def main(): # pylint: disable=missing-function-docstring
|
||||
basicConfig(level=DEBUG)
|
||||
|
||||
def main() -> None: # pylint: disable=missing-function-docstring
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("-f", "--config", required=True)
|
||||
parser.add_argument("search_string")
|
||||
|
||||
cmdline = parser.parse_args()
|
||||
|
||||
client = read_credentials(cmdline.config, get_event_loop())
|
||||
client = read_credentials(cmdline.config)
|
||||
|
||||
albums = search_album(client, cmdline.search_string)
|
||||
echo_albums = echo_album(albums)
|
||||
|
||||
client.loop.run_until_complete(echo_albums)
|
||||
client.loop.run_until_complete(client.close())
|
||||
echo_album(albums)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user