Lint and add length+genre to song info in search
This commit is contained in:
parent
61b4d0e429
commit
aa680dadc2
|
@ -595,7 +595,7 @@ def download(_filters, _id, _desc, _limit, _file_structure):
|
|||
filter_field = information_filter[0].lower()
|
||||
filter_value = information_filter[1].lower()
|
||||
if re.match("^~", filter_value):
|
||||
filter_value = filter_value.replace('~', '')
|
||||
filter_value = filter_value.replace("~", "")
|
||||
if filter_value in song[filter_field].lower():
|
||||
pending_information_filters.append(True)
|
||||
else:
|
||||
|
@ -618,7 +618,7 @@ def download(_filters, _id, _desc, _limit, _file_structure):
|
|||
pending_instrument_filters = list()
|
||||
for instrument_filter in song_instrument_filters:
|
||||
if re.match("^no-", instrument_filter):
|
||||
instrument_filter = instrument_filter.replace('no-', '')
|
||||
instrument_filter = instrument_filter.replace("no-", "")
|
||||
if song["instruments"][instrument_filter] is None:
|
||||
pending_instrument_filters.append(True)
|
||||
else:
|
||||
|
@ -635,7 +635,9 @@ def download(_filters, _id, _desc, _limit, _file_structure):
|
|||
else:
|
||||
instrument_add_to_pending = True
|
||||
|
||||
add_to_pending = all([information_add_to_pending, instrument_add_to_pending])
|
||||
add_to_pending = all(
|
||||
[information_add_to_pending, instrument_add_to_pending]
|
||||
)
|
||||
|
||||
if add_to_pending:
|
||||
pending_songs.append(song)
|
||||
|
@ -749,7 +751,7 @@ def search(_filters):
|
|||
filter_field = information_filter[0].lower()
|
||||
filter_value = information_filter[1].lower()
|
||||
if re.match("^~", filter_value):
|
||||
filter_value = filter_value.replace('~', '')
|
||||
filter_value = filter_value.replace("~", "")
|
||||
if filter_value in song[filter_field].lower():
|
||||
pending_information_filters.append(True)
|
||||
else:
|
||||
|
@ -772,7 +774,7 @@ def search(_filters):
|
|||
pending_instrument_filters = list()
|
||||
for instrument_filter in song_instrument_filters:
|
||||
if re.match("^no-", instrument_filter):
|
||||
instrument_filter = instrument_filter.replace('no-', '')
|
||||
instrument_filter = instrument_filter.replace("no-", "")
|
||||
if song["instruments"][instrument_filter] is None:
|
||||
pending_instrument_filters.append(True)
|
||||
else:
|
||||
|
@ -789,7 +791,9 @@ def search(_filters):
|
|||
else:
|
||||
instrument_add_to_pending = True
|
||||
|
||||
add_to_pending = all([information_add_to_pending, instrument_add_to_pending])
|
||||
add_to_pending = all(
|
||||
[information_add_to_pending, instrument_add_to_pending]
|
||||
)
|
||||
|
||||
if add_to_pending:
|
||||
pending_songs.append(song)
|
||||
|
@ -798,7 +802,7 @@ def search(_filters):
|
|||
click.echo()
|
||||
for entry in pending_songs:
|
||||
click.echo(
|
||||
f"""> Song: "{entry['artist']} - {entry['title']}" from "{entry['album']} ({entry['year']})" by {entry['author']}"""
|
||||
f"""> Song: "{entry['artist']} - {entry['title']}" ({entry['length']}, {entry['genre']}) from "{entry['album']} ({entry['year']})" by {entry['author']}"""
|
||||
)
|
||||
|
||||
instrument_list = list()
|
||||
|
@ -808,9 +812,7 @@ def search(_filters):
|
|||
f""" Instruments: {', '.join(instrument_list)}""",
|
||||
)
|
||||
|
||||
click.echo(
|
||||
f""" Available downloads:"""
|
||||
)
|
||||
click.echo(""" Available downloads:""")
|
||||
for link in entry["dl_links"]:
|
||||
click.echo(f""" * {link['description']}""")
|
||||
click.echo()
|
||||
|
|
Loading…
Reference in New Issue