Skip to content

Commit

Permalink
Exclude lists with no numerical ids from lists response
Browse files Browse the repository at this point in the history
  • Loading branch information
sim0n00ps committed Jun 21, 2023
1 parent bb58932 commit 13d9be3
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions OF DL/Helpers/APIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ public async Task<Dictionary<string, int>> GetLists(string endpoint)
{
foreach (UserList.List l in userList.list)
{
if(l.id != "following")
if (IsStringOnlyDigits(l.id))
{
lists.Add(l.name, Convert.ToInt32(l.id));
}
lists.Add(l.name, Convert.ToInt32(l.id));
}
}
if (userList.hasMore.Value)
{
Expand Down Expand Up @@ -1484,5 +1484,16 @@ public async Task<string> GetDecryptionKey(Dictionary<string, string> drmHeaders
}
return null;
}
}
public static bool IsStringOnlyDigits(string input)
{
foreach (char c in input)
{
if (!char.IsDigit(c))
{
return false;
}
}
return true;
}
}
}

0 comments on commit 13d9be3

Please sign in to comment.