Use default favicons for twitter/subreddit rules
This commit is contained in:
parent
f394d185a1
commit
b65c3b9fb8
1 changed files with 12 additions and 0 deletions
|
|
@ -170,6 +170,18 @@ class FaviconTask(app.Task):
|
||||||
|
|
||||||
collector = FaviconCollector()
|
collector = FaviconCollector()
|
||||||
collector.collect(rules=rules)
|
collector.collect(rules=rules)
|
||||||
|
|
||||||
|
third_party_rules = user.rules.enabled().exclude(
|
||||||
|
type=RuleTypeChoices.feed
|
||||||
|
)
|
||||||
|
|
||||||
|
for rule in third_party_rules:
|
||||||
|
if rule.type == RuleTypeChoices.subreddit:
|
||||||
|
rule.favicon = "https://www.reddit.com/favicon.ico"
|
||||||
|
rule.save()
|
||||||
|
elif rule.type == RuleTypeChoices.twitter_timeline:
|
||||||
|
rule.favicon = "https://abs.twimg.com/favicons/favicon.ico"
|
||||||
|
rule.save()
|
||||||
else:
|
else:
|
||||||
logger.warning(f"Cancelling task due to existing lock")
|
logger.warning(f"Cancelling task due to existing lock")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue