hotfix: adjusted paths (#211)

This commit is contained in:
Graham Steffaniak 2024-09-16 20:30:55 -05:00 committed by GitHub
parent c272eb1e61
commit 2ec0c457cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ func indexingScheduler(intervalMinutes uint32) {
// Define a function to recursively index files and directories // Define a function to recursively index files and directories
func (si *Index) indexFiles(path string) error { func (si *Index) indexFiles(path string) error {
// Check if the current directory has been modified since the last indexing // Check if the current directory has been modified since the last indexing
adjustedPath := si.makeIndexPath(path, false) adjustedPath := si.makeIndexPath(path, true)
dir, err := os.Open(path) dir, err := os.Open(path)
if err != nil { if err != nil {
// Directory must have been deleted, remove it from the index // Directory must have been deleted, remove it from the index
@ -133,7 +133,7 @@ func (si *Index) InsertFiles(path string) {
func (si *Index) InsertDirs(path string) { func (si *Index) InsertDirs(path string) {
for _, f := range si.GetQuickList() { for _, f := range si.GetQuickList() {
if f.IsDir { if f.IsDir {
adjustedPath := si.makeIndexPath(path, false) adjustedPath := si.makeIndexPath(path, true)
if _, exists := si.Directories[adjustedPath]; exists { if _, exists := si.Directories[adjustedPath]; exists {
si.UpdateCount("dirs") si.UpdateCount("dirs")
// Add or update the directory in the map // Add or update the directory in the map