Support group by in newsfeed follows

This commit is contained in:
shortcutme 2016-08-20 10:39:15 +02:00
parent 3049e489fb
commit 0f51826d9d
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import time
import re
from Plugin import PluginManager
from Db import DbQuery
@ -34,8 +35,7 @@ class UiWebsocketPlugin(object):
db_query = DbQuery(query_part)
where = " WHERE %s > strftime('%%s', 'now', '-3 day')" % db_query.fields.get("date_added", "date_added")
if "WHERE" in query_part:
query_part = query_part.replace("WHERE ", where+" AND (")
query_part += ") "
query_part = re.sub("WHERE (.*?)(?=$| GROUP BY)", where+" AND (\\1)", query_part)
else:
query_part += where
query_parts[i] = query_part