Skip to content

Commit

Permalink
Fix id parsing when url has params.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfilippov committed May 21, 2023
1 parent ea7b596 commit 7c436ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/VimeoDotNet.Tests/ModelHelpersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public void ShouldCorrectlyParseId()
{
ModelHelpers.ParseModelUriId("/a/b/c/12345").ShouldBe(12345);
ModelHelpers.ParseModelUriId("/a/b/c/12345:xyz").ShouldBe(12345);
ModelHelpers.ParseModelUriId("https://player.vimeo.com/video/815922745?h=a3e90a211f").ShouldBe(815922745);
}
}
}
2 changes: 1 addition & 1 deletion src/VimeoDotNet/Helpers/ModelHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal static class ModelHelpers
return null;
}

var pieces = uri.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
var pieces = uri.Split(new[] {'/', '?'}, StringSplitOptions.RemoveEmptyEntries);

for (int pieceIndex = pieces.Length - 1; pieceIndex >= 0; pieceIndex--)
{
Expand Down

0 comments on commit 7c436ac

Please sign in to comment.