mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
29 lines
495 B
Go
29 lines
495 B
Go
package version
|
|
|
|
import (
|
|
"log"
|
|
"runtime/debug"
|
|
// "github.com/anacrolix/torrent"
|
|
)
|
|
|
|
const Version = "MatriX.125.XO"
|
|
|
|
func GetTorrentVersion() string {
|
|
// _ = torrent.NewDefaultClientConfig()
|
|
bi, ok := debug.ReadBuildInfo()
|
|
if !ok {
|
|
log.Printf("Failed to read build info")
|
|
return ""
|
|
}
|
|
for _, dep := range bi.Deps {
|
|
if dep.Path == "github.com/anacrolix/torrent" {
|
|
if dep.Replace != nil {
|
|
return dep.Replace.Version
|
|
} else {
|
|
return dep.Version
|
|
}
|
|
}
|
|
}
|
|
return ""
|
|
}
|