radames commited on
Commit
8e9514a
1 Parent(s): 0708a05

fix trend, defaul none nsfw

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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 = "((likes + downloads)/2) / MYPOWER((JULIANDAY('now') - JULIANDAY(datetime(json_extract(data, '$.lastModified')))) + 2, 1.5) 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
  if style == Style.all:
245
- style_query = "1"
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: