fixed toml template and made sorting options actually apply to the comments
pull/915/head
anthony lloyd 3 years ago
parent f67b6e802d
commit 3b1ae5d47d

@ -13,7 +13,6 @@ max_comment_length = { optional = false, example = 500, explanation = "max numb
post_lang = { optional = true, example = "es-cr", explanation = "The language you would like to translate to.", default = "" } post_lang = { optional = true, example = "es-cr", explanation = "The language you would like to translate to.", default = "" }
sort = { optional = true, example = "hot ,top, relevance, new", explanation = "method of sorting threads", default = "top", options = ["hot", "top", "relevance", "new"] } sort = { optional = true, example = "hot ,top, relevance, new", explanation = "method of sorting threads", default = "top", options = ["hot", "top", "relevance", "new"] }
sort_time = { optional = true, example = "day, hour, week, month, year, all", explanation = "time range to gather threads from", default = "all", options = ["day", "hour", "week", "month", "year", "all"] } sort_time = { optional = true, example = "day, hour, week, month, year, all", explanation = "time range to gather threads from", default = "all", options = ["day", "hour", "week", "month", "year", "all"] }
random = { optional = true, example = "True", explanation = "If set to no, it will ask you a thread link to extract the thread, if yes it will randomize it.", default = false, options = [true, false], type = "bool" }
[settings] [settings]
allow_nsfw = { optional = false, example = "false", explanation = "Whether to allow NSFW content, True or False", default = false, options = [true, false], type = "bool" } allow_nsfw = { optional = false, example = "false", explanation = "Whether to allow NSFW content, True or False", default = false, options = [true, false], type = "bool" }

@ -70,10 +70,19 @@ def get_subreddit_threads(POST_ID: str):
comment_type = settings.config["reddit"]["thread"]["sort"] comment_type = settings.config["reddit"]["thread"]["sort"]
try:
if str(comment_type) == "top": if str(comment_type) == "top":
threads = subreddit.top(limit=25) threads = subreddit.top(limit=25)
else: elif str(comment_type) == "new":
threads = subreddit.new(limit=25)
elif str(comment_type) == "hot":
threads = subreddit.hot(limit=25) threads = subreddit.hot(limit=25)
elif str(comment_type) == "relevance":
threads = subreddit.relevance(limit=25)
else:
threads = subreddit.top(limit=25)
except AttributeError:
threads = subreddit.top(limit=25)
submission = get_subreddit_undone(threads, subreddit) submission = get_subreddit_undone(threads, subreddit)
submission = check_done(submission) # double-checking submission = check_done(submission) # double-checking

Loading…
Cancel
Save