added nsfw tags
This commit is contained in:
@@ -109,6 +109,7 @@ class BaseContent(object):
|
|||||||
data['url'] = ('selfpost' if is_selfpost(sub.url) else sub.url)
|
data['url'] = ('selfpost' if is_selfpost(sub.url) else sub.url)
|
||||||
data['likes'] = sub.likes
|
data['likes'] = sub.likes
|
||||||
data['gold'] = sub.gilded > 0
|
data['gold'] = sub.gilded > 0
|
||||||
|
data['nsfw'] = sub.over_18
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|||||||
@@ -266,4 +266,8 @@ class SubmissionPage(BasePage):
|
|||||||
text, attr = GOLD, (curses.A_BOLD | Color.YELLOW)
|
text, attr = GOLD, (curses.A_BOLD | Color.YELLOW)
|
||||||
win.addnstr(text, n_cols - win.getyx()[1], attr)
|
win.addnstr(text, n_cols - win.getyx()[1], attr)
|
||||||
|
|
||||||
|
if data['nsfw']:
|
||||||
|
text, attr = 'NSFW', (curses.A_BOLD | Color.RED)
|
||||||
|
win.addnstr(text, n_cols - win.getyx()[1], attr)
|
||||||
|
|
||||||
win.border()
|
win.border()
|
||||||
@@ -195,6 +195,10 @@ class SubredditPage(BasePage):
|
|||||||
text, attr = GOLD, (curses.A_BOLD | Color.YELLOW)
|
text, attr = GOLD, (curses.A_BOLD | Color.YELLOW)
|
||||||
win.addnstr(text, n_cols - win.getyx()[1], attr)
|
win.addnstr(text, n_cols - win.getyx()[1], attr)
|
||||||
|
|
||||||
|
if data['nsfw']:
|
||||||
|
text, attr = 'NSFW', (curses.A_BOLD | Color.RED)
|
||||||
|
win.addnstr(text, n_cols - win.getyx()[1], attr)
|
||||||
|
|
||||||
row = n_title + offset + 2
|
row = n_title + offset + 2
|
||||||
if row in valid_rows:
|
if row in valid_rows:
|
||||||
text = clean(u'{author}'.format(**data))
|
text = clean(u'{author}'.format(**data))
|
||||||
|
|||||||
Reference in New Issue
Block a user