Allow prioritization of downloads based on name (fixes #174)

This commit is contained in:
Arthur Axel 'fREW' Schmidt
2014-06-06 22:10:15 -05:00
committed by Jakob Borg
parent df381fd03f
commit 82cfd37263
5 changed files with 188 additions and 8 deletions

View File

@@ -248,7 +248,11 @@ func (m *Model) NeedFilesRepo(repo string) []scanner.File {
m.rmut.RLock()
defer m.rmut.RUnlock()
if rf, ok := m.repoFiles[repo]; ok {
return rf.Need(cid.LocalID)
f := rf.Need(cid.LocalID)
if r := m.repoCfgs[repo].FileRanker(); r != nil {
files.SortBy(r).Sort(f)
}
return f
}
return nil
}