narugo1992 commited on
Commit
462a91c
1 Parent(s): 23bd022

dev(narugo): save it

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -72,16 +72,16 @@ def query(chr_name):
72
  html = markdown.markdown(sf.getvalue())
73
 
74
  # get tags on all sites
75
- tags_columns = ['Site', 'Tag', 'Posts']
76
  tags_data = []
77
- tags_data.append(('Pixiv (ALL)', get_pixiv_keywords(ch), get_pixiv_posts(ch)[0]))
78
- tags_data.append(('Pixiv (R18)', get_pixiv_keywords(ch, includes=['R-18']), get_pixiv_posts(ch)[1]))
79
  for site in list_available_sites():
80
  tag_retval = get_site_tag(ch, site, with_posts=True, sure_only=True)
81
  if tag_retval is not None:
82
  tag_name, tag_cnt = tag_retval
83
- tags_data.append((site, tag_name, tag_cnt))
84
- tags_data = sorted(tags_data, key=lambda x: (-x[2], x[1]))
85
  tags_df = pd.DataFrame(columns=tags_columns, data=tags_data)
86
 
87
  return info_df, skin_urls, html, tags_df
 
72
  html = markdown.markdown(sf.getvalue())
73
 
74
  # get tags on all sites
75
+ tags_columns = ['Site', 'Posts', 'Tag']
76
  tags_data = []
77
+ tags_data.append(('Pixiv (ALL)', get_pixiv_posts(ch)[0], get_pixiv_keywords(ch)))
78
+ tags_data.append(('Pixiv (R18)', get_pixiv_posts(ch)[1], get_pixiv_keywords(ch, includes=['R-18'])))
79
  for site in list_available_sites():
80
  tag_retval = get_site_tag(ch, site, with_posts=True, sure_only=True)
81
  if tag_retval is not None:
82
  tag_name, tag_cnt = tag_retval
83
+ tags_data.append((site, tag_cnt, tag_name))
84
+ tags_data = sorted(tags_data, key=lambda x: (-x[1], x[0]))
85
  tags_df = pd.DataFrame(columns=tags_columns, data=tags_data)
86
 
87
  return info_df, skin_urls, html, tags_df