fix: torrent file path resolve (#173)

This commit is contained in:
Levi authored and GitHub committed 2023-08-01 18:56:39 +08:00
1 parent a75bfd6118
commit bf2ccdb5a7
5 files changed
+13 -16

No files matched your search

+3 -6
View File
@@ -10,12 +10,9 @@ const FileSchema = "FILE"
func ParseSchema(url string) string {
index := strings.Index(url, ":")
if index == -1 {
// check is file path
if IsExistsFile(url) {
return FileSchema
}
return ""
// if no schema or windows path like C:\a.txt, return FILE
if index == -1 || index == 1 {
return FileSchema
}
schema := url[:index]
if schema == "data" {