media-picker/main.go

33 lines
656 B
Go
Raw Normal View History

2024-05-10 20:31:42 +08:00
package main
import (
"OdMediaPicker/core"
2024-12-26 21:05:14 +08:00
"OdMediaPicker/vars"
2024-05-10 20:31:42 +08:00
_ "embed"
"fmt"
_ "image/gif" // 导入gif支持
_ "image/jpeg" // 导入jpeg支持
_ "image/png" // 导入png支持
2024-12-26 21:05:14 +08:00
"os"
2024-05-10 20:31:42 +08:00
"time"
)
func main() {
2024-12-26 21:05:14 +08:00
rootDir, err := os.Getwd()
if err != nil {
fmt.Println("=== 获取当前路径异常", err)
return
}
2024-05-10 20:31:42 +08:00
scanner := core.FileScanner{}
2024-12-26 21:05:14 +08:00
scanner.DoScan(rootDir)
scanner.DoFilter()
2024-12-26 21:00:57 +08:00
// 整理图片并分组
2024-12-26 21:05:14 +08:00
if len(vars.GlobalImagePathList) > 0 {
core.DoHandleImage(rootDir)
}
2024-12-26 21:00:57 +08:00
// 挑选文件数大于N的文件夹并转移
scanner.DoPickerDir(rootDir, 10)
fmt.Println("=== 3s后自动退出")
time.Sleep(time.Second * 3)
2024-05-10 20:31:42 +08:00
}