Bug: Scanner Adds Duplicates of First Track to Track List #32

Closed
opened 2026-04-24 22:56:50 +02:00 by adam · 11 comments
Owner

Originally created by @Budlyte on GitHub (Sep 22, 2021).

Some of the books are saying "Duplicate Track" but it turns out to be the first track was added multiple times to the track list.

image

When I tested fixing this one by removing the year and rescanning, another one popped up with the issue. Removing the year didn't fix it.

Originally created by @Budlyte on GitHub (Sep 22, 2021). Some of the books are saying "Duplicate Track" but it turns out to be the first track was added multiple times to the track list. ![image](https://user-images.githubusercontent.com/4451365/134339437-7a26fc6e-f1d7-4d40-a883-6b39910bf37b.png) When I tested fixing this one by removing the year and rescanning, another one popped up with the issue. Removing the year didn't fix it.
adam closed this issue 2026-04-24 22:56:50 +02:00
Author
Owner

@Budlyte commented on GitHub (Sep 22, 2021):

Looking at more of them, it appears to be adding that first track a number of times equal to the total number of tracks.

@Budlyte commented on GitHub (Sep 22, 2021): Looking at more of them, it appears to be adding that first track a number of times equal to the total number of tracks.
Author
Owner

@advplyr commented on GitHub (Sep 22, 2021):

The scanner uses the OS internal id for files and folders so if they are renamed it doesn't lose track.

Are you running the docker image on Unraid?
Is this happening to any other audiobooks?

@advplyr commented on GitHub (Sep 22, 2021): The scanner uses the OS internal id for files and folders so if they are renamed it doesn't lose track. Are you running the docker image on Unraid? Is this happening to any other audiobooks?
Author
Owner

@Budlyte commented on GitHub (Sep 22, 2021):

Yes, on Unraid.

It happened to about 10. Rescanning this time didn't add any more, so maybe that one that added before had just been lying in wait.

@Budlyte commented on GitHub (Sep 22, 2021): Yes, on Unraid. It happened to about 10. Rescanning this time didn't add any more, so maybe that one that added before had just been lying in wait.
Author
Owner

@advplyr commented on GitHub (Sep 22, 2021):

I'm still not clear on what is happening.
If you delete the audiobook from Audiobookshelf and re-scan, is it adding the correct tracks?
When you rename a file in the audiobook folder it is duplicating the tracks?

@advplyr commented on GitHub (Sep 22, 2021): I'm still not clear on what is happening. If you delete the audiobook from Audiobookshelf and re-scan, is it adding the correct tracks? When you rename a file in the audiobook folder it is duplicating the tracks?
Author
Owner

@Budlyte commented on GitHub (Sep 22, 2021):

I haven't tried deleting & re-adding, I'll give that a go this evening.

I did rename the problem files & rescanned, and the problem came back with those same files.

Your comment about the system using the OS's file IDs and the problem repeatedly being with the files sounds like the issue may be in my OS. Though I have seen weird folders popping up in my library recently, possibly these are softlinks or something getting brought in?

I'll test more tonight.

@Budlyte commented on GitHub (Sep 22, 2021): I haven't tried deleting & re-adding, I'll give that a go this evening. I did rename the problem files & rescanned, and the problem came back with those same files. Your comment about the system using the OS's file IDs and the problem repeatedly being with the files sounds like the issue may be in my OS. Though I have seen weird folders popping up in my library recently, possibly these are softlinks or something getting brought in? I'll test more tonight.
Author
Owner

@advplyr commented on GitHub (Sep 22, 2021):

I could definitely see issues if your files are soft links. Thanks for looking into it.

@advplyr commented on GitHub (Sep 22, 2021): I could definitely see issues if your files are soft links. Thanks for looking into it.
Author
Owner

@Budlyte commented on GitHub (Sep 22, 2021):

I started up another container, audiobookshelf_test, to test it out. I was able to reproduce it with a couple and then of course when I went to get screenshots to help document it, I'm no longer able to reproduce it....

So when I was able to reproduce it, I noticed it is happening with books that are missing tracks. It happened after I went through Manage tracks and updated the track order, basically to ignore that track 1 is missing, and rescanned. Then sometimes that book now has track 2 duplicated in its list as many times as their are tracks.

I thought maybe it was softlinks because of the way the buttons are acting to uncheck tracks, but I cannot find anywhere in the entire library where duplicate tracks exist.

Here's what the buttons do on those duplicate tracks when it happens though. Click a red one makes others change state.
silly buttons

And now my test library actually has fewer errors in it than the original... LOL I guess I'm swapping the container names and path mappings!

@Budlyte commented on GitHub (Sep 22, 2021): I started up another container, audiobookshelf_test, to test it out. I was able to reproduce it with a couple and then of course when I went to get screenshots to help document it, I'm no longer able to reproduce it.... So when I was able to reproduce it, I noticed it is happening with books that are missing tracks. It happened after I went through Manage tracks and updated the track order, basically to ignore that track 1 is missing, and rescanned. Then sometimes that book now has track 2 duplicated in its list as many times as their are tracks. I thought maybe it was softlinks because of the way the buttons are acting to uncheck tracks, but I cannot find anywhere in the entire library where duplicate tracks exist. Here's what the buttons do on those duplicate tracks when it happens though. Click a red one makes others change state. ![silly buttons](https://user-images.githubusercontent.com/4451365/134413361-bdfe2757-c3bb-4cbd-ac99-d23fe9acfe99.gif) And now my test library actually has fewer errors in it than the original... LOL I guess I'm swapping the container names and path mappings!
Author
Owner

@advplyr commented on GitHub (Sep 22, 2021):

When toggling a track to not include it should move to the top of the list. Even if they all have the same track number, it should still move to the top of the list, so that is strange.

trackmanager

Can you look in the developer console for errors? Ctrl+shift+i

@advplyr commented on GitHub (Sep 22, 2021): When toggling a track to not include it should move to the top of the list. Even if they all have the same track number, it should still move to the top of the list, so that is strange. ![trackmanager](https://user-images.githubusercontent.com/67830747/134416199-26857c03-57a5-4ed1-b01d-8eb1b3b63ddc.gif) Can you look in the developer console for errors? Ctrl+shift+i
Author
Owner

@Budlyte commented on GitHub (Sep 22, 2021):

Oh neat! Here it is.

https://drive.google.com/file/d/1rMtAvFOHVtVkubed5Cp0Xl5ArGJWiv5z/view?usp=sharing

@Budlyte commented on GitHub (Sep 22, 2021): Oh neat! Here it is. https://drive.google.com/file/d/1rMtAvFOHVtVkubed5Cp0Xl5ArGJWiv5z/view?usp=sharing
Author
Owner

@advplyr commented on GitHub (Sep 24, 2021):

I'm still lost on this one.
It seems like your files are being issued a new inode value, which is causing the scanner to think it is a new file.
I added an extra check in the scanner to help see what is happening.

If an audio file has the same path as the audio file being scanned, but a different inode value, then it will show this warning:

Logger.warn("[Scanner] Audio file with path already exists with different inode, New: "${file.filename}" (${file.ino}) | Existing: ${audioFileWithMatchingPath.filename} (${audioFileWithMatchingPath.ino})")

If you see this happen again on a scan, let me know if you see that warning in your log.

@advplyr commented on GitHub (Sep 24, 2021): I'm still lost on this one. It seems like your files are being issued a new inode value, which is causing the scanner to think it is a new file. I added an extra check in the scanner to help see what is happening. If an audio file has the same path as the audio file being scanned, but a different inode value, then it will show this warning: `Logger.warn("[Scanner] Audio file with path already exists with different inode, New: "${file.filename}" (${file.ino}) | Existing: ${audioFileWithMatchingPath.filename} (${audioFileWithMatchingPath.ino})")` If you see this happen again on a scan, let me know if you see that warning in your log.
Author
Owner

@advplyr commented on GitHub (Sep 27, 2021):

I came across an issue with the scanner not setting the inode for some files. This may have been the problem you had, but either way I added an extra step check in the scanner that should hopefully catch and resolve the issues you are having.
This is v1.2.5

@advplyr commented on GitHub (Sep 27, 2021): I came across an issue with the scanner not setting the inode for some files. This may have been the problem you had, but either way I added an extra step check in the scanner that should hopefully catch and resolve the issues you are having. This is [v1.2.5](https://github.com/advplyr/audiobookshelf/releases/tag/v1.2.5)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#32