Skip to content

Commit

Permalink
Detect client even if clientType is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Simple-Tracker committed Jul 19, 2024
1 parent 203e75d commit 7e14f7f
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,32 @@ func SetURLFromClient() {
}
}
func DetectClient() bool {
if config.ClientType != "" {
currentClientType = config.ClientType
return true
}

currentClientType = "qBittorrent"
if qB_GetAPIVersion() {
Log("DetectClient", GetLangText("Success-DetectClient"), true, currentClientType)
return true
if config.ClientType == "" || config.ClientType == currentClientType {
if qB_GetAPIVersion() {
Log("DetectClient", GetLangText("Success-DetectClient"), true, currentClientType)
return true
}
}

currentClientType = "Transmission"
if Tr_DetectVersion() {
Log("DetectClient", GetLangText("Success-DetectClient"), true, currentClientType)
return true
if config.ClientType == "" || config.ClientType == currentClientType {
if Tr_DetectVersion() {
Log("DetectClient", GetLangText("Success-DetectClient"), true, currentClientType)
return true
}
}

currentClientType = "BitComet"
if BC_DetectClient() {
Log("DetectClient", GetLangText("Success-DetectClient"), true, currentClientType)
if config.ClientType == "" || config.ClientType == currentClientType {
if BC_DetectClient() {
Log("DetectClient", GetLangText("Success-DetectClient"), true, currentClientType)
return true
}
}

if config.ClientType != "" {
currentClientType = config.ClientType
return true
}

Expand Down

0 comments on commit 7e14f7f

Please sign in to comment.