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
|
|
|
|
from spotify_actions.search import search_album
|
|
|
|
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
|
|
|
|
|
|
|
albums = search_album(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()
|