Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
fix trend, defaul none nsfw
Browse files
app.py
CHANGED
@@ -236,13 +236,14 @@ class Style(str, Enum):
|
|
236 |
def get_page(page: int = 1, sort: Sort = Sort.trending, style: Style = Style.all):
|
237 |
page = page if page > 0 else 1
|
238 |
if sort == Sort.trending:
|
239 |
-
sort_query = "
|
240 |
elif sort == Sort.recent:
|
241 |
sort_query = "datetime(json_extract(data, '$.lastModified')) DESC"
|
242 |
elif sort == Sort.likes:
|
243 |
sort_query = "likes DESC"
|
|
|
244 |
if style == Style.all:
|
245 |
-
style_query = "
|
246 |
elif style == Style.anime:
|
247 |
style_query = "json_extract(data, '$.class.anime') > 0.1 AND isNFSW = false"
|
248 |
elif style == Style.s3D:
|
|
|
236 |
def get_page(page: int = 1, sort: Sort = Sort.trending, style: Style = Style.all):
|
237 |
page = page if page > 0 else 1
|
238 |
if sort == Sort.trending:
|
239 |
+
sort_query = "likes / MYPOWER((JULIANDAY('now') - JULIANDAY(datetime(json_extract(data, '$.lastModified')))) + 2, 2) DESC"
|
240 |
elif sort == Sort.recent:
|
241 |
sort_query = "datetime(json_extract(data, '$.lastModified')) DESC"
|
242 |
elif sort == Sort.likes:
|
243 |
sort_query = "likes DESC"
|
244 |
+
|
245 |
if style == Style.all:
|
246 |
+
style_query = "isNFSW = false"
|
247 |
elif style == Style.anime:
|
248 |
style_query = "json_extract(data, '$.class.anime') > 0.1 AND isNFSW = false"
|
249 |
elif style == Style.s3D:
|