utils

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateId = createIdGenerator()

Functions

func CopyFile

func CopyFile(src, dst string) (int64, error)

func FormatTime added in v0.8.0

func FormatTime(t int) string

func GetSingleFile

func GetSingleFile(form *multipart.Form, name string) (*multipart.FileHeader, error)

func HasMusic added in v0.3.0

func HasMusic(entries []fs.DirEntry) bool

func IsMultiDisc added in v0.3.0

func IsMultiDisc(entries []fs.DirEntry) bool

func IsMultiDiscName added in v0.3.0

func IsMultiDiscName(name string) bool

func IsMusicFile added in v0.3.0

func IsMusicFile(p string) bool

func IsValidImageExt added in v0.7.0

func IsValidImageExt(ext string) bool

func IsValidTrackExt

func IsValidTrackExt(ext string) bool

func RunFFmpeg

func RunFFmpeg(verbose bool, args ...string) error

func RunFFprobe

func RunFFprobe(args ...string) ([]byte, error)

func SymlinkReplace added in v0.6.0

func SymlinkReplace(src, dst string) error

func WriteFormFile

func WriteFormFile(file *multipart.FileHeader, dst string) error

Types

type FileResult

type FileResult struct {
	Path   string
	Number int
	Name   string

	Duration int
	Tags     map[string]string
}

func CheckFile

func CheckFile(filepath string) (FileResult, error)

type Info added in v0.9.0

type Info struct {
	Tags     map[string]string
	Duration int
}

func GetInfo added in v0.9.0

func GetInfo(filepath string) (Info, error)

type ProbeResult

type ProbeResult struct {
	Artist      string
	AlbumArtist string
	Title       string
	Album       string
	Track       int
	Disc        int
}

Jump to

Keyboard shortcuts

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