Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in ParseModelUriId #77

Closed
BrahmanandaK opened this issue Feb 8, 2017 · 1 comment
Closed

Error in ParseModelUriId #77

BrahmanandaK opened this issue Feb 8, 2017 · 1 comment
Assignees
Labels

Comments

@BrahmanandaK
Copy link

BrahmanandaK commented Feb 8, 2017

When private link share options is selected, uploaded uri is in the form of /videos/222222222:ac55f55555.
ParseModelUriId method fail try to convert "222222222:ac55f55555" into int. change method to check ":" and convert only substring 222222222.

Solution:

public static long? ParseModelUriId(string uri) { if (string.IsNullOrEmpty(uri)) { return null; } string[] pieces = uri.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); long userId = 0; string id = pieces[pieces.Length - 1]; int pos = id.IndexOf(':'); if(pos > 0) { id = id.Substring(0, pos); } if (long.TryParse(id, out userId)) { return userId; } return null; }

@mfilippov mfilippov added the bug label Feb 16, 2017
@mfilippov mfilippov self-assigned this Feb 16, 2017
mfilippov added a commit that referenced this issue Sep 29, 2017
mfilippov added a commit that referenced this issue Sep 29, 2017
@mfilippov
Copy link
Owner

Fixed in 0.9.0.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants