BlueHuskyStudios / BlueHuskyStudios/DeadassSimpleMediaPlayer
`stringToInt` returns `nil` for values like "Vol. 3"
- Dominant language
- Swift
- Stars
- 0
- Forks
- 3
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 9
Description
```swift
/(?:\d|[., '])+/
```
matches one-or-more of (digit **or** separator), so a run consisting *only* of separators is a valid match. `firstMatch` on `"Vol. 3"` finds `". "` (from "Vol."), which filters down to an empty string, and `Int("")` is `nil`.
Any track-number tag where a separator appears before the first digit parses as "no track number." Requiring at least one digit in the match (e.g. anchoring on `\d`) would fix it.
Contributor guide
Research direction
Search the project for stringToInt and the shown regular expression, then reproduce the failure with the track-number value "Vol. 3". Verify that values with separators before digits parse their number correctly and that values containing no digits still behave as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100