Allow filter optional files by inner path

This commit is contained in:
shortcutme 2019-07-10 03:11:20 +02:00
parent 2819a36469
commit e34a9d452a
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -105,7 +105,7 @@ class UiWebsocketPlugin(object):
# Optional file functions
def actionOptionalFileList(self, to, address=None, orderby="time_downloaded DESC", limit=10, filter="downloaded"):
def actionOptionalFileList(self, to, address=None, orderby="time_downloaded DESC", limit=10, filter="downloaded", filter_inner_path=None):
if not address:
address = self.site.address
@ -139,6 +139,8 @@ class UiWebsocketPlugin(object):
wheres_raw.append("(is_downloaded = 1 OR is_pinned = 1)")
if "pinned" in filter:
wheres["is_pinned"] = 1
if filter_inner_path:
wheres["inner_path__like"] = filter_inner_path
if address == "all":
join = "LEFT JOIN site USING (site_id)"