Skip to content

Commit

Permalink
Add option to recursively retrieve mod dependencies (#4)
Browse files Browse the repository at this point in the history
* Add recursive option to Routes#GetModDependencies
* Move optional parameter higher up for compatibility.
---------
Co-authored-by: DarkEyeDragon <darkeyedragon@gmail.com>
  • Loading branch information
DarkEyeDragon authored Apr 12, 2023
1 parent ebd5427 commit 533d4a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Modio/Clients/DependenciesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ internal DependenciesClient(IConnection connection, uint game, uint mod) : base(
/// <summary>
/// Get all dependencies the mod has selected.
/// </summary>
public async Task<IReadOnlyList<Dependency>> Get()
public async Task<IReadOnlyList<Dependency>> Get(bool recursive = false)
{
var route = Routes.GetModDependencies(GameId, ModId);
var route = Routes.GetModDependencies(GameId, ModId, recursive);
var search = new SearchClient<Dependency>(Connection, route, null);
return await search.ToList();
}
Expand Down
4 changes: 2 additions & 2 deletions Modio/Http/Routes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ public static (HttpMethod, Uri) DeleteModMetadata(uint game, uint mod)
#endregion

#region Dependencies
public static (HttpMethod, Uri) GetModDependencies(uint game, uint mod)
public static (HttpMethod, Uri) GetModDependencies(uint game, uint mod, bool recursive)
{
var uri = "games/{0}/mods/{1}/dependencies".FormatUri(game, mod);
var uri = "games/{0}/mods/{1}/dependencies?recursive={2}".FormatUri(game, mod, recursive);
return (HttpMethod.Get, uri);
}

Expand Down

0 comments on commit 533d4a5

Please sign in to comment.