Skip to content

Commit 58b0e7d

Browse files
committed
Only two cases of the Sort enum being converted to a string. Added a call to both uses to convert the enum name to lower case.
This brings it into compliance with the documentation at https://www.reddit.com/dev/api#GET_user_{username}_submitted.
1 parent e79475e commit 58b0e7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

RedditSharp/Things/RedditUser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public Listing<Comment> GetComments(Sort sorting = Sort.New, int limit = 25, Fro
124124
if ((limit < 1) || (limit > MAX_LIMIT))
125125
throw new ArgumentOutOfRangeException("limit", "Valid range: [1," + MAX_LIMIT + "]");
126126
string commentsUrl = string.Format(CommentsUrl, Name);
127-
commentsUrl += string.Format("?sort={0}&limit={1}&t={2}", Enum.GetName(typeof(Sort), sorting), limit, Enum.GetName(typeof(FromTime), fromTime));
127+
commentsUrl += string.Format("?sort={0}&limit={1}&t={2}", Enum.GetName(typeof(Sort), sorting).ToLower(), limit, Enum.GetName(typeof(FromTime), fromTime));
128128

129129
return new Listing<Comment>(Reddit, commentsUrl, WebAgent);
130130
}
@@ -142,7 +142,7 @@ public Listing<Post> GetPosts(Sort sorting = Sort.New, int limit = 25, FromTime
142142
if ((limit < 1) || (limit > 100))
143143
throw new ArgumentOutOfRangeException("limit", "Valid range: [1,100]");
144144
string linksUrl = string.Format(LinksUrl, Name);
145-
linksUrl += string.Format("?sort={0}&limit={1}&t={2}", Enum.GetName(typeof(Sort), sorting), limit, Enum.GetName(typeof(FromTime), fromTime));
145+
linksUrl += string.Format("?sort={0}&limit={1}&t={2}", Enum.GetName(typeof(Sort), sorting).ToLower(), limit, Enum.GetName(typeof(FromTime), fromTime));
146146

147147
return new Listing<Post>(Reddit, linksUrl, WebAgent);
148148
}

0 commit comments

Comments
 (0)