Logging errors during import

This commit is contained in:
Deluan 2016-03-03 00:07:10 -05:00
parent 3ab09c4b2c
commit e9a46b77ff
1 changed files with 10 additions and 4 deletions

View File

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