File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ def __init__(
6666 async def subreddit_articles (
6767 self ,
6868 subreddit : str ,
69- sort : ArticlesSortType | None = ArticlesSortType . HOT ,
69+ sort : ArticlesSortType | None = None ,
7070 time : ArticlesSortTime | None = None ,
7171 limit : int | None = None ,
7272 ) -> list [Article ]:
@@ -84,7 +84,8 @@ async def subreddit_articles(
8484 list[Article]: list of loaded articles from the given subreddit
8585 """
8686 self ._logger .info (f"Loading subreddit articles [{ subreddit } ] [{ sort } ] [{ time } ] [{ limit } ]" )
87- url = self ._SUBREDDIT_ARTICLES_URL .format (subreddit = subreddit , sort = sort .name .lower ())
87+ sort = sort or ArticlesSortType .HOT
88+ url = self ._SUBREDDIT_ARTICLES_URL .format (subreddit = subreddit , sort = sort .value )
8889 params = self ._prepare_params (limit = limit , time = time )
8990 return await self ._get_articles (url , params )
9091
You can’t perform that action at this time.
0 commit comments