feat(offline-download): allow using offline download tools in any storage (#7716)

* Feat(offline-download): allow using thunder offline download tool in any storage

* Feat(offline-download): allow using 115 offline download tool in any storage

* Feat(offline-download): allow using pikpak offline download tool in any storage

* style(offline-download): unify offline download tool names

* feat(offline-download): show available offline download tools only

* Fix(offline-download): update unmodified tool names.

---------

Co-authored-by: Andy Hsu <i@nn.ci>
This commit is contained in:
Jealous
2025-01-10 21:24:44 +08:00
committed by GitHub
parent e04114d102
commit b60da9732f
14 changed files with 484 additions and 210 deletions

View File

@ -3,6 +3,7 @@ package tool
import (
"fmt"
"github.com/alist-org/alist/v3/internal/model"
"sort"
)
var (
@ -25,8 +26,11 @@ func (t ToolsManager) Add(tool Tool) {
func (t ToolsManager) Names() []string {
names := make([]string, 0, len(t))
for name := range t {
names = append(names, name)
if tool, err := t.Get(name); err == nil && tool.IsReady() {
names = append(names, name)
}
}
sort.Strings(names)
return names
}