Merge remote-tracking branch 'read-config/remove-duplicate-read-status-without-filter' into Develop

This commit is contained in:
Ozzieisaacs 2020-05-01 17:19:13 +02:00
commit b95f6563cc
2 changed files with 13 additions and 9 deletions

View File

@ -860,16 +860,20 @@ def get_search_results(term):
)).order_by(db.Books.sort).all() )).order_by(db.Books.sort).all()
def get_cc_columns(): def get_cc_columns(filter_config_custom_read=False):
tmpcc = db.session.query(db.Custom_Columns).filter(db.Custom_Columns.datatype.notin_(db.cc_exceptions)).all() tmpcc = db.session.query(db.Custom_Columns).filter(db.Custom_Columns.datatype.notin_(db.cc_exceptions)).all()
if config.config_columns_to_ignore:
cc = [] cc = []
for col in tmpcc: r = None
if config.config_columns_to_ignore:
r = re.compile(config.config_columns_to_ignore) r = re.compile(config.config_columns_to_ignore)
if not r.match(col.name):
for col in tmpcc:
if filter_config_custom_read and config.config_read_column and config.config_read_column == col.id:
continue
if r and r.match(col.label):
continue
cc.append(col) cc.append(col)
else:
cc = tmpcc
return cc return cc

View File

@ -1593,7 +1593,7 @@ def show_book(book_id):
except UnknownLocaleError: except UnknownLocaleError:
entries.languages[index].language_name = _( entries.languages[index].language_name = _(
isoLanguages.get(part3=entries.languages[index].lang_code).name) isoLanguages.get(part3=entries.languages[index].lang_code).name)
cc = get_cc_columns() cc = get_cc_columns(filter_config_custom_read=True)
book_in_shelfs = [] book_in_shelfs = []
shelfs = ub.session.query(ub.BookShelf).filter(ub.BookShelf.book_id == book_id).all() shelfs = ub.session.query(ub.BookShelf).filter(ub.BookShelf.book_id == book_id).all()
for entry in shelfs: for entry in shelfs: