picarcore

package
v0.0.0-...-350b867 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JPG = ".jpg"
	MOV = ".mov"
	MP4 = ".mp4"
)

Variables

View Source
var (
	// FINISH 表示任务已经结束
	FINISH = struct{}{}
)

Functions

func Run

func Run(config Config)

Types

type Config

type Config struct {
	ParseVideo   bool
	RenameOnly   bool
	Prefix       string
	PhotoFolders []string
}

type MediaFile

type MediaFile struct {
	Dir         string // 当前位置(目录)
	NewFilename string // 新文件名
	ArchFolder  string // 归档目录
	// contains filtered or unexported fields
}

MediaFile 表示一个照片/视频文件

func NewMediaFile

func NewMediaFile(path string) *MediaFile

NewMediaFile 创建一个 MediaFile 结构

func (*MediaFile) SetNewFilename

func (p *MediaFile) SetNewFilename(prefix string, counter int, isVideoFile bool) error

SetNewFilename 设置新的文件名

type Task

type Task struct {
	// contains filtered or unexported fields
}

Task 表示一个重命名任务

func CreateTask

func CreateTask(prefix string, renameOnly bool, videos bool, path string) *Task

CreateTask 创建一个新任务

func (*Task) Execute

func (t *Task) Execute() error

Execute 执行任务

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL