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:
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user