We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42280b4 commit 22fbf30Copy full SHA for 22fbf30
1 file changed
yogurt/src/commonMain/kotlin/org/ntqqrev/yogurt/util/ResourceUtils.kt
@@ -24,7 +24,13 @@ private val httpClient = createPlatformHttpClient()
24
suspend fun resolveUri(uri: String): MediaSource = withContext(Dispatchers.IO) {
25
when {
26
uri.startsWith("file://") -> withFs {
27
- val filePath = Path(uri.removePrefix("file://").decodeURLPart())
+ val pathStr = uri.removePrefix("file://").decodeURLPart()
28
+ val normalizedPath = if (pathStr.startsWith("/") && pathStr.length > 2 && pathStr[1].isLetter() && pathStr[2] == ':') {
29
+ pathStr.substring(1)
30
+ } else {
31
+ pathStr
32
+ }
33
+ val filePath = Path(normalizedPath)
34
if (!exists(filePath)) {
35
throw IOException("File not found: $filePath")
36
}
0 commit comments