mirror of
https://codeberg.org/tacerus/teddit.git
synced 2025-01-09 12:52:32 +01:00
don't fetch sidebar for multireddit urls
This commit is contained in:
parent
8336a3d424
commit
5e33387e5b
@ -2,6 +2,7 @@ module.exports = function() {
|
|||||||
this.processSubredditSidebar = (subreddit, redis, fetch, RedditAPI) => {
|
this.processSubredditSidebar = (subreddit, redis, fetch, RedditAPI) => {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
(async () => {
|
(async () => {
|
||||||
|
if(subreddit && !subreddit.includes('+')) {
|
||||||
let key = `${subreddit}:sidebar`
|
let key = `${subreddit}:sidebar`
|
||||||
redis.get(key, (error, json) => {
|
redis.get(key, (error, json) => {
|
||||||
if(error) {
|
if(error) {
|
||||||
@ -58,6 +59,9 @@ module.exports = function() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
resolve(null)
|
||||||
|
}
|
||||||
})()
|
})()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user