Logging errors during import
This commit is contained in:
@@ -6,7 +6,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"fmt"
|
||||||
|
"github.com/astaxie/beego"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ItunesScanner struct{}
|
type ItunesScanner struct{}
|
||||||
@@ -47,9 +49,13 @@ func (s *ItunesScanner) LoadFolder(path string) []Track {
|
|||||||
return mediaFiles[0:i]
|
return mediaFiles[0:i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func unescape(s string) string {
|
func unescape(str string) string {
|
||||||
s, _ = url.QueryUnescape(s)
|
s := strings.Replace(str, "&", "&", -1)
|
||||||
return strings.Replace(s, "&", "&", -1)
|
s, err := url.QueryUnescape(s)
|
||||||
|
if err != nil {
|
||||||
|
beego.Warn("Error importing string", str, ":", err)
|
||||||
|
}
|
||||||
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ Scanner = (*ItunesScanner)(nil)
|
var _ Scanner = (*ItunesScanner)(nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user