3BugsYouTube livestream embeds do not embed correctly if used with share link ( https://youtube.com/live/ ) (#5120) Bug Open: Needs triage embeds5h agoby Nsgr ThreadView full discussion Comment by JiraliteJiraliteMod 1 vote 5h ago 2 replies What is that before and after supposed to represent? Before and after what? Permalink Comment by NsgrNsgr OP1 vote 4h ago edited 1 reply Before and after the fix I posted in the comments, sorry for not clarifying. Permalink Comment by NsgrNsgr OP1 vote 1h ago Thinking about the code repetitions, a for loop should actually be a better solution: for prefix in ["/shorts/", "/v/", "/live/"] { if path.starts_with(prefix) { return path .strip_prefix(prefix)? .split('/') .next() .map(|s| s.to_owned()); } } Please let me know if I should / can PR this! :) Permalink
Comment by JiraliteJiraliteMod 1 vote 5h ago 2 replies What is that before and after supposed to represent? Before and after what? Permalink Comment by NsgrNsgr OP1 vote 4h ago edited 1 reply Before and after the fix I posted in the comments, sorry for not clarifying. Permalink Comment by NsgrNsgr OP1 vote 1h ago Thinking about the code repetitions, a for loop should actually be a better solution: for prefix in ["/shorts/", "/v/", "/live/"] { if path.starts_with(prefix) { return path .strip_prefix(prefix)? .split('/') .next() .map(|s| s.to_owned()); } } Please let me know if I should / can PR this! :) Permalink
Comment by NsgrNsgr OP1 vote 4h ago edited 1 reply Before and after the fix I posted in the comments, sorry for not clarifying. Permalink Comment by NsgrNsgr OP1 vote 1h ago Thinking about the code repetitions, a for loop should actually be a better solution: for prefix in ["/shorts/", "/v/", "/live/"] { if path.starts_with(prefix) { return path .strip_prefix(prefix)? .split('/') .next() .map(|s| s.to_owned()); } } Please let me know if I should / can PR this! :) Permalink
Comment by NsgrNsgr OP1 vote 1h ago Thinking about the code repetitions, a for loop should actually be a better solution: for prefix in ["/shorts/", "/v/", "/live/"] { if path.starts_with(prefix) { return path .strip_prefix(prefix)? .split('/') .next() .map(|s| s.to_owned()); } } Please let me know if I should / can PR this! :) Permalink
Thread
Comment by Jiralite
Comment by Nsgr
Comment by Nsgr