diff --git a/data/interfaces/default/js/tables/playlists_table.js b/data/interfaces/default/js/tables/playlists_table.js index e0d408ab..1942060d 100644 --- a/data/interfaces/default/js/tables/playlists_table.js +++ b/data/interfaces/default/js/tables/playlists_table.js @@ -40,7 +40,7 @@ playlists_table_options = { "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { var type = MEDIA_TYPE_HEADERS[rowData['playlistType']] || ''; - if (rowData['leafCount'] == 1) { + if (rowData['leafCount'] === 1) { type = type.slice(0, -1); } $(td).html(cellData + ' ' + type); diff --git a/plexpy/helpers.py b/plexpy/helpers.py index b632c41a..67b9f1d1 100644 --- a/plexpy/helpers.py +++ b/plexpy/helpers.py @@ -581,7 +581,9 @@ def process_json_kwargs(json_kwargs): return params -def process_datatable_rows(rows, json_data, default_sort, sort_keys=None): +def process_datatable_rows(rows, json_data, default_sort, search_cols=None, sort_keys=None): + if search_cols is None: + search_cols = [] if sort_keys is None: sort_keys = {} @@ -592,7 +594,7 @@ def process_datatable_rows(rows, json_data, default_sort, sort_keys=None): # Search results search_value = json_data['search']['value'].lower() if search_value: - searchable_columns = [d['data'] for d in json_data['columns'] if d['searchable']] + searchable_columns = [d['data'] for d in json_data['columns'] if d['searchable']] + search_cols for row in rows: for k, v in row.items(): if k in sort_keys: diff --git a/plexpy/libraries.py b/plexpy/libraries.py index b211eb17..ac2b1919 100644 --- a/plexpy/libraries.py +++ b/plexpy/libraries.py @@ -201,6 +201,8 @@ def get_collections_list(section_id=None, **kwargs): # Get datatables JSON data json_data = helpers.process_json_kwargs(json_kwargs=kwargs['json_data']) + search_cols = ['title'] + sort_keys = { 'collectionMode': { -1: 'Library Default', @@ -215,7 +217,8 @@ def get_collections_list(section_id=None, **kwargs): } results = helpers.process_datatable_rows( - collections, json_data, default_sort='titleSort', sort_keys=sort_keys) + collections, json_data, default_sort='titleSort', + search_cols=search_cols, sort_keys=sort_keys) data = { 'recordsFiltered': results['filtered_count'],