feat: multiple down proxy urls (close #793)

This commit is contained in:
Xhofe
2022-03-20 16:53:30 +08:00
parent 9b23d0ab29
commit 77ffb93cbe
5 changed files with 8 additions and 5 deletions

View File

@ -121,7 +121,7 @@ func GetDrivers() map[string][]Item {
{
Name: "down_proxy_url",
Label: "down_proxy_url",
Type: TypeString,
Type: TypeText,
},
{
Name: "extract_folder",

View File

@ -21,6 +21,7 @@ const (
TypeSelect = "select"
TypeBool = "bool"
TypeNumber = "number"
TypeText = "text"
)
const (

View File

@ -73,8 +73,8 @@ func (driver GoogleDrive) FormatFile(file *File, account *model.Account) *model.
f.Type = utils.GetFileType(filepath.Ext(file.Name))
}
if file.ThumbnailLink != "" {
if account.DownProxyUrl != "" {
f.Thumbnail = fmt.Sprintf("%s/%s", account.DownProxyUrl, file.ThumbnailLink)
if account.APIProxyUrl != "" {
f.Thumbnail = fmt.Sprintf("%s/%s", account.APIProxyUrl, file.ThumbnailLink)
} else {
f.Thumbnail = file.ThumbnailLink
}