rename file
This commit is contained in:
parent
4539147208
commit
32c7e8a01b
@ -100,7 +100,7 @@ func processVideo(fileNameOrig string) {
|
|||||||
fmt.Printf("Processing %s video-", fileNameOrig)
|
fmt.Printf("Processing %s video-", fileNameOrig)
|
||||||
|
|
||||||
// match the file extension
|
// match the file extension
|
||||||
r, _ := regexp.Compile(`\.[a-zA-Z0-9]+$`)
|
r := regexp.MustCompile(`\.[a-zA-Z0-9]+$`)
|
||||||
fileName := r.ReplaceAllString(fileNameOrig, "")
|
fileName := r.ReplaceAllString(fileNameOrig, "")
|
||||||
|
|
||||||
// match the year and cut year from name
|
// match the year and cut year from name
|
||||||
@ -172,7 +172,7 @@ func addVideo(videoName string, fileName string, year int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func matchYear(fileName string) (int, string) {
|
func matchYear(fileName string) (int, string) {
|
||||||
r, _ := regexp.Compile(`\([0-9]{4}?\)`)
|
r := regexp.MustCompile(`\([0-9]{4}?\)`)
|
||||||
years := r.FindAllString(fileName, -1)
|
years := r.FindAllString(fileName, -1)
|
||||||
if len(years) == 0 {
|
if len(years) == 0 {
|
||||||
return -1, fileName
|
return -1, fileName
|
Loading…
Reference in New Issue
Block a user