Fix duplicate file crash (#2)
This commit is contained in:
parent
1de3af330f
commit
2d846f2e2e
2
Makefile
2
Makefile
@ -11,7 +11,7 @@ DIST := \
|
|||||||
mtmediasrv.conf
|
mtmediasrv.conf
|
||||||
|
|
||||||
PROJECT := mtmediasrv
|
PROJECT := mtmediasrv
|
||||||
VERSION = 4
|
VERSION = 5
|
||||||
BUILD = `git describe --tags --always`
|
BUILD = `git describe --tags --always`
|
||||||
|
|
||||||
$(PROJECT): main.go
|
$(PROJECT): main.go
|
||||||
|
4
main.go
4
main.go
@ -180,9 +180,13 @@ func collectMedia(l bool, c bool, e map[string]bool, w string) filepath.WalkFunc
|
|||||||
if l {
|
if l {
|
||||||
err := os.Link(path, of)
|
err := os.Link(path, of)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err != os.ErrExist {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if err != os.ErrExist {
|
||||||
newmedia++
|
newmedia++
|
||||||
|
}
|
||||||
} else if c {
|
} else if c {
|
||||||
in, err := os.Open(path)
|
in, err := os.Open(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user