content.py: name of the subreddit shown on selfpost 'url'
all flairs now have brackets
This commit is contained in:
@@ -131,9 +131,12 @@ class BaseContent(object):
|
|||||||
data['flair'] = flair
|
data['flair'] = flair
|
||||||
data['url_full'] = sub.url
|
data['url_full'] = sub.url
|
||||||
|
|
||||||
|
if flair is not None and flair[0] != '[':
|
||||||
|
data['flair'] = '[{}]'.format(flair.strip())
|
||||||
|
|
||||||
if data['permalink'].split('/r/')[-1] == data['url_full'].split('/r/')[-1]:
|
if data['permalink'].split('/r/')[-1] == data['url_full'].split('/r/')[-1]:
|
||||||
data['url_type'] = 'selfpost'
|
data['url_type'] = 'selfpost'
|
||||||
data['url'] = 'selfpost'
|
data['url'] = 'self.{}'.format(data['subreddit'])
|
||||||
|
|
||||||
elif reddit_link.match(data['url_full']):
|
elif reddit_link.match(data['url_full']):
|
||||||
data['url_type'] = 'x-post'
|
data['url_type'] = 'x-post'
|
||||||
|
|||||||
Reference in New Issue
Block a user