2021-07-03 19:29:50 -04:00
|
|
|
"""
|
|
|
|
Find an album using the `spotify_actions` API and echo its contents.
|
|
|
|
"""
|
|
|
|
|
|
|
|
from argparse import ArgumentParser
|
|
|
|
|
|
|
|
from spotify_actions.echo import echo_album
|
2021-07-03 23:04:21 -04:00
|
|
|
from spotify_actions.search import search_albums
|
2021-07-03 19:29:50 -04:00
|
|
|
from spotify_actions.util import read_credentials
|
|
|
|
|
|
|
|
|
2021-07-03 22:46:30 -04:00
|
|
|
def main() -> None: # pylint: disable=missing-function-docstring
|
2021-07-03 19:29:50 -04:00
|
|
|
parser = ArgumentParser()
|
|
|
|
parser.add_argument("-f", "--config", required=True)
|
|
|
|
parser.add_argument("search_string")
|
|
|
|
|
|
|
|
cmdline = parser.parse_args()
|
|
|
|
|
2021-07-03 22:46:30 -04:00
|
|
|
client = read_credentials(cmdline.config)
|
2021-07-03 19:29:50 -04:00
|
|
|
|
2021-07-03 23:04:21 -04:00
|
|
|
albums = search_albums(client, cmdline.search_string)
|
2021-07-03 22:46:30 -04:00
|
|
|
echo_album(albums)
|
2021-07-03 19:29:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|