splitting up search to search and filters.

This commit is contained in:
Blacktwin 2018-12-21 21:17:08 -05:00
parent 99eee6fdfb
commit 6fcf430152

View File

@ -133,7 +133,7 @@ def actions():
def selectors(): def selectors():
"""Playlist selections and titles """Predefined Playlist selections and titles
""" """
selections = {'historyToday':'Aired Today {month}-{day} in History', selections = {'historyToday':'Aired Today {month}-{day} in History',
'historyWeek': 'Aired This Week ({week}) in History', 'historyWeek': 'Aired This Week ({week}) in History',
@ -141,19 +141,28 @@ def selectors():
'popularTv': 'Most Popular TV Shows ({days} days)', 'popularTv': 'Most Popular TV Shows ({days} days)',
'popularMovies': 'Most Popular Movies ({days} days)', 'popularMovies': 'Most Popular Movies ({days} days)',
'keyword':'{keyword} Playlist', 'keyword':'{keyword} Playlist',
'genre': '{title} Playlist', 'random': '{count} Random Playlist'
'random': '{count} Random Playlist', }
'studio': 'Studio: {title} Playlist',
'network': 'Network: {title} Playlist',
'labels': 'Labels: {title} Playlist',
'collections': 'Collections: {title} Playlist',
'country': 'Country: {title} Playlist',
'writer': 'Writer: {title} Playlist',
'director': 'Director: {title} Playlist',
'actor': 'Actor: {title} Playlist'}
return selections return selections
def filters():
"""Predefined Playlist filters and titles
"""
filters = {'genre': '{title} Playlist',
'studio': 'Studio: {title} Playlist',
'network': 'Network: {title} Playlist',
'labels': 'Labels: {title} Playlist',
'collections': 'Collections: {title} Playlist',
'country': 'Country: {title} Playlist',
'writer': 'Writer: {title} Playlist',
'director': 'Director: {title} Playlist',
'actor': 'Actor: {title} Playlist'
}
return filters
def get_home_stats(time_range, stats_count): def get_home_stats(time_range, stats_count):
# Get the homepage watch statistics. # Get the homepage watch statistics.
payload = {'apikey': TAUTULLI_APIKEY, payload = {'apikey': TAUTULLI_APIKEY,
@ -508,9 +517,11 @@ if __name__ == "__main__":
help='Limit the amount items to be added to a playlist.') help='Limit the amount items to be added to a playlist.')
# todo-me custom naming for playlists --name? # todo-me custom naming for playlists --name?
# todo-me custom limits to playlist --limit? # todo-me custom limits to playlist --limit?
parser.add_argument('--search', action='append', type=lambda kv: kv.split("="), parser.add_argument('--filter', action='append', type=lambda kv: kv.split("="),
help='Search filter for finding keywords in title, summary or ' help='Search filtered metadata fields (genre, actors, director, studio, etc.')
'filter types (genre, actors, director, studio, etc.') parser.add_argument('--search', type=lambda kv: kv.split("="),
help='Search non-filtered metadata fields for keywords '
'in title, summary, etc.')
opts = parser.parse_args() opts = parser.parse_args()