Don't strip off too many periods from bulk uploaded filenames#1162
Conversation
`\.[^.]*$` means: - match a literal period, then - match any number of non-period characters, then - match the end of the string This prevents the regex from stripping the `.10hz.mp4` off of `video.10hz.mp4`, for example.
There was a problem hiding this comment.
Thanks for fixing that.
Could be a separate PR but I noticed when Roddy sent that link about the weird truncation of longer filenames given the space we provided.
Could increase truncate-length on the <v-file-input> to like 75 or more given the space that is provided.
https://vuetifyjs.com/en/api/v-file-input/#props-truncate-length
Let's do that in a separate PR. For reference, we're talking about #1159. |
|
I forgot to mention it, but technically this regex (and the one it replaces) would strip off a lone period from the end of a filename (e.g., Let me know what you think and we can always make that change in a future PR. |
* Use a less greedy regex to strip off file suffixes `\.[^.]*$` means: - match a literal period, then - match any number of non-period characters, then - match the end of the string This prevents the regex from stripping the `.10hz.mp4` off of `video.10hz.mp4`, for example. * Refactor the file suffix regex into a constant
This PR updates the regex that is used to strip off filename suffixes when multiple files are being bulk uploaded. The existing regex was too greedy and would strip off everything after the first period in the name; the new one does so only for the last one.
Closes #838.