[PR #485] [MERGED] Update folder update logic to use new media path name #3360

Closed
opened 2026-04-25 00:15:21 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/485
Author: @selfhost-alt
Created: 4/23/2022
Status: Merged
Merged: 4/23/2022
Merged by: @advplyr

Base: masterHead: fix-scan-error


📝 Commits (1)

  • d88b20a Update folder update logic to use new media path name

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 server/scanner/Scanner.js (+1 -1)

📄 Description

I noticed the following exception from the scanner:

/server/njodb/index.js:103
        throw error;
        ^

TypeError: Cannot read properties of undefined (reading 'startsWith')
    at /server/scanner/Scanner.js:521:98
    at Array.find (<anonymous>)
    at Scanner.scanFolderUpdates (/server/scanner/Scanner.js:521:51)
    at Scanner.scanFilesChanged (/server/scanner/Scanner.js:501:42)
    at Server.filesChanged (/server/Server.js:266:24)
    at FolderWatcher.emit (node:events:526:28)
    at Timeout._onTimeout (/server/Watcher.js:194:12)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)

This was after fixing the folder nesting of some audiobook files:

/audiobooks/B A Paris/                            
/audiobooks/B A Paris/Behind Closed Doors.mp3     
/audiobooks/B A Paris/Breakdown.mp3               
/audiobooks/B A Paris/Bring Me Back.mp3           
/audiobooks/B A Paris/Dilemma.mp3                 

Turned into (nesting MP3 files into book folders):

/audiobooks/B A Paris/                                                         
/audiobooks/B A Paris/Behind Closed Doors                                      
/audiobooks/B A Paris/Behind Closed Doors/Behind Closed Doors.mp3              
/audiobooks/B A Paris/Breakdown                                                
/audiobooks/B A Paris/Breakdown/Breakdown.mp3                                  
/audiobooks/B A Paris/Bring Me Back                                            
/audiobooks/B A Paris/Bring Me Back/Bring Me Back.mp3                          
/audiobooks/B A Paris/Dilemma                                                  
/audiobooks/B A Paris/Dilemma/Dilemma.mp3                                      

Based on the exception and the related code, it seems like there was perhaps a lingering reference to the old fullPath property name which has been migrated to path.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/485 **Author:** [@selfhost-alt](https://github.com/selfhost-alt) **Created:** 4/23/2022 **Status:** ✅ Merged **Merged:** 4/23/2022 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `fix-scan-error` --- ### 📝 Commits (1) - [`d88b20a`](https://github.com/advplyr/audiobookshelf/commit/d88b20addd145a8ba0fd11043930ad72820b8a6b) Update folder update logic to use new media path name ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/scanner/Scanner.js` (+1 -1) </details> ### 📄 Description I noticed the following exception from the scanner: ``` /server/njodb/index.js:103 throw error; ^ TypeError: Cannot read properties of undefined (reading 'startsWith') at /server/scanner/Scanner.js:521:98 at Array.find (<anonymous>) at Scanner.scanFolderUpdates (/server/scanner/Scanner.js:521:51) at Scanner.scanFilesChanged (/server/scanner/Scanner.js:501:42) at Server.filesChanged (/server/Server.js:266:24) at FolderWatcher.emit (node:events:526:28) at Timeout._onTimeout (/server/Watcher.js:194:12) at listOnTimeout (node:internal/timers:559:17) at processTimers (node:internal/timers:502:7) ``` This was after fixing the folder nesting of some audiobook files: ``` /audiobooks/B A Paris/ /audiobooks/B A Paris/Behind Closed Doors.mp3 /audiobooks/B A Paris/Breakdown.mp3 /audiobooks/B A Paris/Bring Me Back.mp3 /audiobooks/B A Paris/Dilemma.mp3 ``` Turned into (nesting MP3 files into book folders): ``` /audiobooks/B A Paris/ /audiobooks/B A Paris/Behind Closed Doors /audiobooks/B A Paris/Behind Closed Doors/Behind Closed Doors.mp3 /audiobooks/B A Paris/Breakdown /audiobooks/B A Paris/Breakdown/Breakdown.mp3 /audiobooks/B A Paris/Bring Me Back /audiobooks/B A Paris/Bring Me Back/Bring Me Back.mp3 /audiobooks/B A Paris/Dilemma /audiobooks/B A Paris/Dilemma/Dilemma.mp3 ``` Based on the exception and the related code, it seems like there was perhaps a lingering reference to the old `fullPath` property name which has been [migrated](https://github.com/advplyr/audiobookshelf/blob/5d12cc3f2348f1067e86e0fe042abe1bca7b2408/server/utils/dbMigration.js#L171) to `path`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:15:21 +02:00
adam closed this issue 2026-04-25 00:15:21 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3360