mirror of https://github.com/Xhofe/alist
				
				
				
			chore: fix drivers not import
							parent
							
								
									0df3473337
								
							
						
					
					
						commit
						5b40254e3b
					
				| 
						 | 
				
			
			@ -2,12 +2,13 @@ package cmd
 | 
			
		|||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
 | 
			
		||||
	"github.com/alist-org/alist/v3/cmd/flags"
 | 
			
		||||
	_ "github.com/alist-org/alist/v3/drivers"
 | 
			
		||||
	"github.com/alist-org/alist/v3/internal/conf"
 | 
			
		||||
	"github.com/alist-org/alist/v3/server"
 | 
			
		||||
	"github.com/gin-gonic/gin"
 | 
			
		||||
	log "github.com/sirupsen/logrus"
 | 
			
		||||
 | 
			
		||||
	"github.com/spf13/cobra"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,9 +6,9 @@ package cmd
 | 
			
		|||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"github.com/alist-org/alist/v3/internal/conf"
 | 
			
		||||
	"os"
 | 
			
		||||
 | 
			
		||||
	"github.com/alist-org/alist/v3/internal/conf"
 | 
			
		||||
	"github.com/spf13/cobra"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,7 +17,7 @@ func init() {
 | 
			
		|||
		TimestampFormat:           "2006-01-02 15:04:05",
 | 
			
		||||
		FullTimestamp:             true,
 | 
			
		||||
	})
 | 
			
		||||
	logrus.SetLevel(logrus.DebugLevel)
 | 
			
		||||
	// logrus.SetLevel(logrus.DebugLevel)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func Log() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,13 +1,13 @@
 | 
			
		|||
package operations
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/alist-org/alist/v3/internal/conf"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/alist-org/alist/v3/internal/conf"
 | 
			
		||||
 | 
			
		||||
	"github.com/alist-org/alist/v3/internal/driver"
 | 
			
		||||
	"github.com/pkg/errors"
 | 
			
		||||
	log "github.com/sirupsen/logrus"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type New func() driver.Driver
 | 
			
		||||
| 
						 | 
				
			
			@ -16,7 +16,7 @@ var driverNewMap = map[string]New{}
 | 
			
		|||
var driverItemsMap = map[string]driver.Items{}
 | 
			
		||||
 | 
			
		||||
func RegisterDriver(config driver.Config, driver New) {
 | 
			
		||||
	log.Infof("register driver: [%s]", config.Name)
 | 
			
		||||
	// log.Infof("register driver: [%s]", config.Name)
 | 
			
		||||
	registerDriverItems(config, driver().GetAddition())
 | 
			
		||||
	driverNewMap[config.Name] = driver
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ func GetDriverItemsMap() map[string]driver.Items {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
func registerDriverItems(config driver.Config, addition driver.Additional) {
 | 
			
		||||
	log.Debugf("addition of %s: %+v", config.Name, addition)
 | 
			
		||||
	// log.Debugf("addition of %s: %+v", config.Name, addition)
 | 
			
		||||
	tAddition := reflect.TypeOf(addition)
 | 
			
		||||
	mainItems := getMainItems(config)
 | 
			
		||||
	additionalItems := getAdditionalItems(tAddition, config.DefaultRoot)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue