Skip to content

Commit

Permalink
Fixed #1083
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie.Rees authored and Jamie.Rees committed Feb 9, 2017
1 parent 972f1ce commit 0145c11
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Ombi.UI/Modules/RequestsModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,18 @@ private async Task<string> GetRootPath(int pathId, SonarrSettings sonarrSettings
return r.path;
}

// Return default path
return rootFoldersResult.FirstOrDefault(x => x.id.Equals(int.Parse(sonarrSettings.RootPath)))?.path ?? string.Empty;
int outRoot;
var defaultPath = int.TryParse(sonarrSettings.RootPath, out outRoot);

if (defaultPath)
{
// Return default path
return rootFoldersResult.FirstOrDefault(x => x.id.Equals(outRoot)?.path ?? string.Empty;
}
else
{
return rootFoldersResult.FirstOrDefault()?.path ?? string.Empty;
}
}

private async Task<Response> GetAlbumRequests()
Expand Down

0 comments on commit 0145c11

Please sign in to comment.