Name the folder in error messages
This commit is contained in:
parent
95e15c95f2
commit
9dd6f848bd
@ -25,12 +25,12 @@ type nativeModel struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m nativeModel) Index(deviceID DeviceID, folder string, files []FileInfo, flags uint32, options []Option) {
|
func (m nativeModel) Index(deviceID DeviceID, folder string, files []FileInfo, flags uint32, options []Option) {
|
||||||
fixupFiles(files)
|
fixupFiles(folder, files)
|
||||||
m.next.Index(deviceID, folder, files, flags, options)
|
m.next.Index(deviceID, folder, files, flags, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m nativeModel) IndexUpdate(deviceID DeviceID, folder string, files []FileInfo, flags uint32, options []Option) {
|
func (m nativeModel) IndexUpdate(deviceID DeviceID, folder string, files []FileInfo, flags uint32, options []Option) {
|
||||||
fixupFiles(files)
|
fixupFiles(folder, files)
|
||||||
m.next.IndexUpdate(deviceID, folder, files, flags, options)
|
m.next.IndexUpdate(deviceID, folder, files, flags, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ func (m nativeModel) Close(deviceID DeviceID, err error) {
|
|||||||
m.next.Close(deviceID, err)
|
m.next.Close(deviceID, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func fixupFiles(files []FileInfo) {
|
func fixupFiles(folder string, files []FileInfo) {
|
||||||
for i, f := range files {
|
for i, f := range files {
|
||||||
if strings.ContainsAny(f.Name, disallowedCharacters) {
|
if strings.ContainsAny(f.Name, disallowedCharacters) {
|
||||||
if f.IsDeleted() {
|
if f.IsDeleted() {
|
||||||
@ -56,7 +56,7 @@ func fixupFiles(files []FileInfo) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
files[i].Flags |= FlagInvalid
|
files[i].Flags |= FlagInvalid
|
||||||
l.Warnf("File name %q contains invalid characters; marked as invalid.", f.Name)
|
l.Warnf("File name %q (folder %q) contains invalid characters; marked as invalid.", f.Name, folder)
|
||||||
}
|
}
|
||||||
files[i].Name = filepath.FromSlash(files[i].Name)
|
files[i].Name = filepath.FromSlash(files[i].Name)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user