Deprecate scanner.Block & File
This commit is contained in:
@@ -18,7 +18,6 @@ import (
|
||||
"code.google.com/p/go.crypto/bcrypt"
|
||||
"github.com/calmh/syncthing/logger"
|
||||
"github.com/calmh/syncthing/protocol"
|
||||
"github.com/calmh/syncthing/scanner"
|
||||
)
|
||||
|
||||
var l = logger.DefaultLogger
|
||||
@@ -122,11 +121,11 @@ func (r *RepositoryConfiguration) NodeIDs() []protocol.NodeID {
|
||||
return r.nodeIDs
|
||||
}
|
||||
|
||||
func (r RepositoryConfiguration) FileRanker() func(scanner.File) int {
|
||||
func (r RepositoryConfiguration) FileRanker() func(protocol.FileInfo) int {
|
||||
if len(r.SyncOrderPatterns) <= 0 {
|
||||
return nil
|
||||
}
|
||||
return func(f scanner.File) int {
|
||||
return func(f protocol.FileInfo) int {
|
||||
ret := 0
|
||||
for _, v := range r.SyncOrderPatterns {
|
||||
if v.CompiledPattern().MatchString(f.Name) {
|
||||
|
||||
@@ -13,7 +13,6 @@ import (
|
||||
|
||||
"github.com/calmh/syncthing/files"
|
||||
"github.com/calmh/syncthing/protocol"
|
||||
"github.com/calmh/syncthing/scanner"
|
||||
)
|
||||
|
||||
var node1, node2, node3, node4 protocol.NodeID
|
||||
@@ -274,7 +273,7 @@ func TestFileSorter(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
f := []scanner.File{
|
||||
f := []protocol.FileInfo{
|
||||
{Name: "bar.mov"},
|
||||
{Name: "baz.txt"},
|
||||
{Name: "foo.jpg"},
|
||||
@@ -290,7 +289,7 @@ func TestFileSorter(t *testing.T) {
|
||||
|
||||
files.SortBy(rcfg.FileRanker()).Sort(f)
|
||||
|
||||
expected := []scanner.File{
|
||||
expected := []protocol.FileInfo{
|
||||
{Name: "camera-uploads/foo.jpg"},
|
||||
{Name: "camera-uploads/herp.mov"},
|
||||
{Name: "camera-uploads/hurr.pl"},
|
||||
@@ -314,7 +313,7 @@ func TestFileSorter(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func formatFiles(f []scanner.File) string {
|
||||
func formatFiles(f []protocol.FileInfo) string {
|
||||
ret := ""
|
||||
|
||||
for _, v := range f {
|
||||
|
||||
Reference in New Issue
Block a user