You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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; }
The text was updated successfully, but these errors were encountered:
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; }
The text was updated successfully, but these errors were encountered: