mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Can you test and verify
This commit is contained in:
parent
33458c1bdb
commit
a660a1c44b
1 changed files with 22 additions and 30 deletions
|
@ -1987,24 +1987,14 @@ class WebInterface(object):
|
||||||
def getLog(self, start=0, length=100, **kwargs):
|
def getLog(self, start=0, length=100, **kwargs):
|
||||||
start = int(start)
|
start = int(start)
|
||||||
length = int(length)
|
length = int(length)
|
||||||
search_value = ""
|
|
||||||
search_regex = ""
|
|
||||||
order_column = 0
|
|
||||||
order_dir = "desc"
|
|
||||||
|
|
||||||
if 'order[0][dir]' in kwargs:
|
|
||||||
order_dir = kwargs.get('order[0][dir]', "desc")
|
order_dir = kwargs.get('order[0][dir]', "desc")
|
||||||
|
|
||||||
if 'order[0][column]' in kwargs:
|
|
||||||
order_column = kwargs.get('order[0][column]', "0")
|
order_column = kwargs.get('order[0][column]', "0")
|
||||||
|
|
||||||
if 'search[value]' in kwargs:
|
|
||||||
search_value = kwargs.get('search[value]', "")
|
search_value = kwargs.get('search[value]', "")
|
||||||
|
search_regex = kwargs.get('search[regex]', "") # Remove?
|
||||||
if 'search[regex]' in kwargs:
|
sortcolumn = 0
|
||||||
search_regex = kwargs.get('search[regex]', "")
|
|
||||||
|
|
||||||
filt = []
|
filt = []
|
||||||
|
filtered = []
|
||||||
fa = filt.append
|
fa = filt.append
|
||||||
with open(os.path.join(plexpy.CONFIG.LOG_DIR, logger.FILENAME)) as f:
|
with open(os.path.join(plexpy.CONFIG.LOG_DIR, logger.FILENAME)) as f:
|
||||||
for l in f.readlines():
|
for l in f.readlines():
|
||||||
|
@ -2021,18 +2011,20 @@ class WebInterface(object):
|
||||||
filt[tl][2] += '<br>' + l
|
filt[tl][2] += '<br>' + l
|
||||||
continue
|
continue
|
||||||
|
|
||||||
filtered = []
|
|
||||||
if search_value == '':
|
if search_value == '':
|
||||||
filtered = filt
|
filtered = filt
|
||||||
else:
|
else:
|
||||||
filtered = [row for row in filt for column in row if search_value.lower() in column.lower()]
|
filtered = [row for row in filt for column in row if search_value.lower() in column.lower()]
|
||||||
|
|
||||||
sortcolumn = 0
|
|
||||||
if order_column == '1':
|
if order_column == '1':
|
||||||
sortcolumn = 2
|
sortcolumn = 2
|
||||||
elif order_column == '2':
|
elif order_column == '2':
|
||||||
sortcolumn = 1
|
sortcolumn = 1
|
||||||
filtered.sort(key=lambda x: x[sortcolumn], reverse=order_dir == "desc")
|
|
||||||
|
filtered.sort(key=lambda x: x[sortcolumn])
|
||||||
|
|
||||||
|
if order_dir == 'desc':
|
||||||
|
filtered = filtered[::-1]
|
||||||
|
|
||||||
rows = filtered[start:(start + length)]
|
rows = filtered[start:(start + length)]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue