Consolidate album search selectors
This commit is contained in:
@ -1,24 +0,0 @@
|
||||
# pylint: disable=missing-module-docstring, missing-function-docstring
|
||||
|
||||
from argparse import ArgumentParser
|
||||
|
||||
from spotify_actions.echo import echo_album
|
||||
from spotify_actions.search import search_albums
|
||||
from spotify_actions.util import read_credentials
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("-c", "--credentials", required=True)
|
||||
parser.add_argument("search_string")
|
||||
|
||||
cmdline = parser.parse_args()
|
||||
|
||||
client = read_credentials(cmdline.config)
|
||||
|
||||
albums = search_albums(client, cmdline.search_string)
|
||||
echo_album(albums)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -5,8 +5,8 @@ from datetime import date, timedelta
|
||||
|
||||
from spotify_actions.echo import echo_album
|
||||
from spotify_actions.join import join_albums
|
||||
from spotify_actions.search import search_albums_label
|
||||
from spotify_actions.temporal import album_released_after
|
||||
from spotify_actions.search import search_albums
|
||||
from spotify_actions.temporal import temporal_released_after
|
||||
from spotify_actions.util import read_credentials
|
||||
|
||||
|
||||
@ -22,9 +22,9 @@ def main() -> None:
|
||||
|
||||
client = read_credentials(cmdline.credentials)
|
||||
|
||||
label_albums = [search_albums_label(client, l) for l in cmdline.label]
|
||||
label_albums = [search_albums(client, label=l) for l in cmdline.label]
|
||||
albums = join_albums(*label_albums)
|
||||
albums_recent = album_released_after(albums, today - four_weeks)
|
||||
albums_recent = temporal_released_after(albums, today - four_weeks)
|
||||
echo_album(albums_recent)
|
||||
|
||||
|
Reference in New Issue
Block a user