mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-04-01 09:30:34 +02:00
refactor: preserve extension ID case in DownloadByStrategy, only lowercase built-in providers
This commit is contained in:
@@ -412,15 +412,21 @@ func DownloadByStrategy(requestJSON string) (string, error) {
|
||||
return errorResponse("Invalid request: " + err.Error())
|
||||
}
|
||||
|
||||
service := strings.TrimSpace(strings.ToLower(req.Service))
|
||||
req.Service = service
|
||||
normalizedBytes, err := json.Marshal(req)
|
||||
serviceRaw := strings.TrimSpace(req.Service)
|
||||
serviceNormalized := strings.ToLower(serviceRaw)
|
||||
|
||||
normalizedReq := req
|
||||
if serviceNormalized == "youtube" || isBuiltInProvider(serviceNormalized) {
|
||||
normalizedReq.Service = serviceNormalized
|
||||
}
|
||||
|
||||
normalizedBytes, err := json.Marshal(normalizedReq)
|
||||
if err != nil {
|
||||
return errorResponse("Invalid request: " + err.Error())
|
||||
}
|
||||
normalizedJSON := string(normalizedBytes)
|
||||
|
||||
if service == "youtube" {
|
||||
if serviceNormalized == "youtube" {
|
||||
return DownloadFromYouTube(normalizedJSON)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user