[Bug]: scan issue #2790

Closed
opened 2026-04-25 00:10:41 +02:00 by adam · 9 comments
Owner

Originally created by @iliasch-dev on GitHub (May 20, 2025).

What happened?

I have a script that creates mp3 files and attaches an embedded image to each one. It then copies the mp3 file to the library path of audiobookshelf. Most of the times the file is scanned correctly and the correct thumbnail is displayed on audiobookshelf. Sometimes however the file is added but with a past video thumbnail (the title is correct). I have to manually delete the file from the library and re-scan in order for audiobookshelf to detect the correct thumbnail. I have a jellyfin installation which scans the same directory and it doesn't appear to be having this issue so i'm guessing it's not my script.

What did you expect to happen?

100% success of scanning the files with the correct embedded image

Steps to reproduce the issue

  1. copy an mp3 with embedded image in library path
  2. let audiobookshelf scan the directory based on directory changes
  3. sometimes it associates the imported file with the a past mp3 thumbnail not the correct one.

Audiobookshelf version

v.2.21.0

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Firefox

Logs


Additional Notes

No response

Originally created by @iliasch-dev on GitHub (May 20, 2025). ### What happened? I have a script that creates mp3 files and attaches an embedded image to each one. It then copies the mp3 file to the library path of audiobookshelf. Most of the times the file is scanned correctly and the correct thumbnail is displayed on audiobookshelf. Sometimes however the file is added but with a past video thumbnail (the title is correct). I have to manually delete the file from the library and re-scan in order for audiobookshelf to detect the correct thumbnail. I have a jellyfin installation which scans the same directory and it doesn't appear to be having this issue so i'm guessing it's not my script. ### What did you expect to happen? 100% success of scanning the files with the correct embedded image ### Steps to reproduce the issue 1. copy an mp3 with embedded image in library path 2. let audiobookshelf scan the directory based on directory changes 3. sometimes it associates the imported file with the a past mp3 thumbnail not the correct one. ### Audiobookshelf version v.2.21.0 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? Firefox ### Logs ```shell ``` ### Additional Notes _No response_
adam added the bugwaitingunable to reproduce labels 2026-04-25 00:10:41 +02:00
adam closed this issue 2026-04-25 00:10:41 +02:00
Author
Owner

@advplyr commented on GitHub (May 20, 2025):

I'm not sure what you mean by "past mp3 thumbnail"

@advplyr commented on GitHub (May 20, 2025): I'm not sure what you mean by "past mp3 thumbnail"
Author
Owner

@iliasch-dev commented on GitHub (May 20, 2025):

the embedded thumbnail of a previously scanned mp3 file

@iliasch-dev commented on GitHub (May 20, 2025): the embedded thumbnail of a previously scanned mp3 file
Author
Owner

@nichwall commented on GitHub (May 20, 2025):

Is the previous image still present in the file metadata? Are there multiple covers in the mp3 and the old cover is first?

@nichwall commented on GitHub (May 20, 2025): Is the previous image still present in the file metadata? Are there multiple covers in the mp3 and the old cover is first?
Author
Owner

@iliasch-dev commented on GitHub (May 21, 2025):

it happened again and I tried to analyze the relevant file with ffmpeg -i , this is the output . I think that there is only one image embedded (cover) which jellyfin scanned correctly. Audiobookshelf associated the file with an old image from a different and older mp3 file which i'm not sure where it found it. Looks like a caching issue but then again i don't know.

Input #0, mp3, from '@JoyStickgr_LIVE🔴 _ Σάλος με Bungie&Marathon, Druckmann σε διπλό Project, E3 Tribute! _ Gaming Καφενές.mp3':
  Metadata:
    album           : LIVE🔴 _ Σάλος με Bungie&Marathon, Druckmann σε διπλό Project, E3 Tribute! _ Gaming Καφενές
    title           : LIVE🔴 _ Σάλος με Bungie&Marathon, Druckmann σε διπλό Project, E3 Tribute! _ Gaming Καφενές
    artist          : @JoyStickgr
    encoder         : Lavf58.76.100
  Duration: 03:37:34.61, start: 0.023021, bitrate: 192 kb/s
  Stream #0:0: Audio: mp3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      encoder         : Lavc58.13
  Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      comment         : Cover (front)
@iliasch-dev commented on GitHub (May 21, 2025): it happened again and I tried to analyze the relevant file with ffmpeg -i , this is the output . I think that there is only one image embedded (cover) which jellyfin scanned correctly. Audiobookshelf associated the file with an old image from a different and older mp3 file which i'm not sure where it found it. Looks like a caching issue but then again i don't know. ``` Input #0, mp3, from '@JoyStickgr_LIVE🔴 _ Σάλος με Bungie&Marathon, Druckmann σε διπλό Project, E3 Tribute! _ Gaming Καφενές.mp3': Metadata: album : LIVE🔴 _ Σάλος με Bungie&Marathon, Druckmann σε διπλό Project, E3 Tribute! _ Gaming Καφενές title : LIVE🔴 _ Σάλος με Bungie&Marathon, Druckmann σε διπλό Project, E3 Tribute! _ Gaming Καφενές artist : @JoyStickgr encoder : Lavf58.76.100 Duration: 03:37:34.61, start: 0.023021, bitrate: 192 kb/s Stream #0:0: Audio: mp3, 48000 Hz, stereo, fltp, 192 kb/s Metadata: encoder : Lavc58.13 Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc (attached pic) Metadata: comment : Cover (front) ```
Author
Owner

@advplyr commented on GitHub (May 21, 2025):

Abs must be scanning in the audio file before you change the image. You can look through the logs to see when that happens. Check the libraries that you have set up and make sure that the audio file is not in any library folder before you move it.

@advplyr commented on GitHub (May 21, 2025): Abs must be scanning in the audio file before you change the image. You can look through the logs to see when that happens. Check the libraries that you have set up and make sure that the audio file is not in any library folder before you move it.
Author
Owner

@iliasch-dev commented on GitHub (May 21, 2025):

I create the mp3 and assign the image to it in directory A (/tmp) then I copy it to directory B (audiobook lib path) in order to avoid this issue.

@iliasch-dev commented on GitHub (May 21, 2025): I create the mp3 and assign the image to it in directory A (/tmp) then I copy it to directory B (audiobook lib path) in order to avoid this issue.
Author
Owner

@nichwall commented on GitHub (May 21, 2025):

I have a script that creates mp3 files and attaches an embedded image to each one. It then copies the mp3 file to the library path of audiobookshelf.

How are you embedding the image? You said it was a script, what command are you running?

the embedded thumbnail of a previously scanned mp3 file

When you say "a previously scanned image", do you mean scanned by Audiobookshelf before, or scanned by something else?

Audiobookshelf associated the file with an old image from a different and older mp3 file which i'm not sure where it found it. Looks like a caching issue but then again i don't know.

Is this other mp3 file still in audiobookshelf?

@nichwall commented on GitHub (May 21, 2025): > I have a script that creates mp3 files and attaches an embedded image to each one. It then copies the mp3 file to the library path of audiobookshelf. How are you embedding the image? You said it was a script, what command are you running? > the embedded thumbnail of a previously scanned mp3 file When you say "a previously scanned image", do you mean scanned by Audiobookshelf before, or scanned by something else? > Audiobookshelf associated the file with an old image from a different and older mp3 file which i'm not sure where it found it. Looks like a caching issue but then again i don't know. Is this other mp3 file still in audiobookshelf?
Author
Owner

@iliasch-dev commented on GitHub (May 22, 2025):

How are you embedding the image? You said it was a script, what command are you running?

using eyed3 python lib

When you say "a previously scanned image", do you mean scanned by Audiobookshelf before, or scanned by something else?

it's a previously scanned file by audiobookshelf

Is this other mp3 file still in audiobookshelf?

it used to be along with other older files but I have them removed from the ABS lib directory after 5 days (cronjob that rm the files from the directory), I then go to "ISSUES" menu and remove them completely manually since ABS won't find the associated files.

The general idea is (a,b,c performed by python script)

a. scrap youtube videos to mp3s in /tmp
b. embed an image to them in /tmp
c. copy the final file to the ABS directory
d. ABS scans the file and puts it in library with the correct image (most of the times)
e. rm files older than 5 days (cronjob runs every night at 02:00)
f. manually clean the removed files from "ISSUES" menu (ABS displays files it cannot find with a "!" which you can then remove from lib yourself, would be nice if it did it automatically though )

@iliasch-dev commented on GitHub (May 22, 2025): > How are you embedding the image? You said it was a script, what command are you running? using eyed3 python lib > When you say "a previously scanned image", do you mean scanned by Audiobookshelf before, or scanned by something else? it's a previously scanned file by audiobookshelf > Is this other mp3 file still in audiobookshelf? it used to be along with other older files but I have them removed from the ABS lib directory after 5 days (cronjob that rm the files from the directory), I then go to "ISSUES" menu and remove them completely manually since ABS won't find the associated files. The general idea is (a,b,c performed by python script) a. scrap youtube videos to mp3s in /tmp b. embed an image to them in /tmp c. copy the final file to the ABS directory d. ABS scans the file and puts it in library with the correct image (most of the times) e. rm files older than 5 days (cronjob runs every night at 02:00) f. manually clean the removed files from "ISSUES" menu (ABS displays files it cannot find with a "!" which you can then remove from lib yourself, would be nice if it did it automatically though )
Author
Owner

@iliasch-dev commented on GitHub (May 22, 2025):

you may close it , I found the issue, forgot to change the path in the config file of my script to the /tmp directory (server side) so the mp3 remained in the ABS lib path while still being processed. Impressed however how jellyfin managed to work around it, maybe it keeps refreshing the metadata for each file.

@iliasch-dev commented on GitHub (May 22, 2025): you may close it , I found the issue, forgot to change the path in the config file of my script to the /tmp directory (server side) so the mp3 remained in the ABS lib path while still being processed. Impressed however how jellyfin managed to work around it, maybe it keeps refreshing the metadata for each file.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2790