[Enhancement]: Add notifications for Audiobook downloads. Enhance the notify feature. #1471

Open
opened 2026-04-24 23:46:48 +02:00 by adam · 7 comments
Owner

Originally created by @NF8C on GitHub (Oct 19, 2023).

Describe the feature/enhancement

The current notification system is great. I had no trouble setting it up to send notifications through Home Assistant. Here is the basic URL format if anyone needs it. There is a ton of stuff that can be done once a notification is sent to Home Assistant.
json://{IP address}:8123/api/webhook/{webhook ID}

Unfortunately I only see the option for podcasts and test notifications. It would be awesome if we had access to more events. Particularly new books. There was some great talk on the podcast notification request that was already fulfilled.
https://github.com/advplyr/audiobookshelf/issues/996

PS: If anyone gets into this I just wanted to let them know there is a small typo "notificataion" they could correct in the body of the test notification.

Great work everyone!

Originally created by @NF8C on GitHub (Oct 19, 2023). ### Describe the feature/enhancement The current notification system is great. I had no trouble setting it up to send notifications through Home Assistant. Here is the basic URL format if anyone needs it. There is a ton of stuff that can be done once a notification is sent to Home Assistant. json://{IP address}:8123/api/webhook/{webhook ID} Unfortunately I only see the option for podcasts and test notifications. It would be awesome if we had access to more events. Particularly new books. There was some great talk on the podcast notification request that was already fulfilled. https://github.com/advplyr/audiobookshelf/issues/996 PS: If anyone gets into this I just wanted to let them know there is a small typo "notificataion" they could correct in the body of the test notification. Great work everyone!
adam added the enhancement label 2026-04-24 23:46:48 +02:00
Author
Owner

@nichwall commented on GitHub (Oct 19, 2023):

Related FR: https://github.com/advplyr/audiobookshelf/issues/1857

@nichwall commented on GitHub (Oct 19, 2023): Related FR: https://github.com/advplyr/audiobookshelf/issues/1857
Author
Owner

@advplyr commented on GitHub (Oct 19, 2023):

I set up the framework to support adding new notifications but since there wasn't much interest beyond podcast episodes I left it at that. I put down some ideas in that original issue https://github.com/advplyr/audiobookshelf/issues/996#issuecomment-1254108583

For this specific request I did note one of the issues

The problem with this is sometimes you may scan in a hundred new library items and obviously we don't want to send 100 notifications. We will need to send a notification that can say something like "X books have been added to Y library" and the message body would list each new book title (or "X podcasts have been added..").

If we go that route then I don't think we would be able to allow changing the title and body template. It would basically be 2 templates for this notification; one for a single item added and one for multiple items added. That would be complicated to build in the UI and confusing to the user but it may also be confusing as to why they can't edit this template.

@advplyr commented on GitHub (Oct 19, 2023): I set up the framework to support adding new notifications but since there wasn't much interest beyond podcast episodes I left it at that. I put down some ideas in that original issue https://github.com/advplyr/audiobookshelf/issues/996#issuecomment-1254108583 For this specific request I did note one of the issues > The problem with this is sometimes you may scan in a hundred new library items and obviously we don't want to send 100 notifications. We will need to send a notification that can say something like "X books have been added to Y library" and the message body would list each new book title (or "X podcasts have been added.."). > > If we go that route then I don't think we would be able to allow changing the title and body template. It would basically be 2 templates for this notification; one for a single item added and one for multiple items added. That would be complicated to build in the UI and confusing to the user but it may also be confusing as to why they can't edit this template.
Author
Owner

@jcfalcone commented on GitHub (Oct 19, 2023):

It would be nice if the Notification system could send a URL to the Cover art as well; I do most of my alerts though telegram ( I send to a webhook I created ) and it looks nicer with the cover image.

I more or less figured out how to remake the Cover URL inside my webhook but I could receive it in the same way I get a URL to the podcast

@jcfalcone commented on GitHub (Oct 19, 2023): It would be nice if the Notification system could send a URL to the Cover art as well; I do most of my alerts though telegram ( I send to a webhook I created ) and it looks nicer with the cover image. I more or less figured out how to remake the Cover URL inside my webhook but I could receive it in the same way I get a URL to the podcast
Author
Owner

@advplyr commented on GitHub (Oct 19, 2023):

@jcfalcone There is a feature request open for this https://github.com/advplyr/audiobookshelf/issues/1812. The only hesitation I have on this is we would have to open up a URL accessible without authentication.

With this particular request of sending a notification for newly added books the issue is how to handle 100 books added at the same time.

@advplyr commented on GitHub (Oct 19, 2023): @jcfalcone There is a feature request open for this https://github.com/advplyr/audiobookshelf/issues/1812. The only hesitation I have on this is we would have to open up a URL accessible without authentication. With this particular request of sending a notification for newly added books the issue is how to handle 100 books added at the same time.
Author
Owner

@NF8C commented on GitHub (Oct 20, 2023):

Could you add some more variables to the test notification? Let me play around with it and I'll propose some default templates. Once I have a nice looking default template we can iterate. Give me one variable with the basic details of the last 5 or 10 books, when they were added, and a variable with how many books were added in the last scan. I've been testing and the form is basic jinja/yaml just like what I use in Home Assistant. I can do a lot with a jinja template.

@NF8C commented on GitHub (Oct 20, 2023): Could you add some more variables to the test notification? Let me play around with it and I'll propose some default templates. Once I have a nice looking default template we can iterate. Give me one variable with the basic details of the last 5 or 10 books, when they were added, and a variable with how many books were added in the last scan. I've been testing and the form is basic jinja/yaml just like what I use in Home Assistant. I can do a lot with a jinja template.
Author
Owner

@emigrating commented on GitHub (Oct 24, 2023):

With this particular request of sending a notification for newly added books the issue is how to handle 100 books added at the same time.

I'd say, just add a pause/stop/disable notifications for X minutes option. If this isn't toggle isn't hi before starting a large import you'll just have to live with the mass of notifications and you're likely to remember next time around.

I also want more variables accessible, for both current types of notifications. Image URL for sure, but also direct url to whatever's just added. Plan on having a look at the notification system but still haven't got my dev environment setup via the container using my code server :/

@emigrating commented on GitHub (Oct 24, 2023): > With this particular request of sending a notification for newly added books the issue is how to handle 100 books added at the same time. I'd say, just add a pause/stop/disable notifications for X minutes option. If this isn't toggle isn't hi before starting a large import you'll just have to live with the mass of notifications and you're likely to remember next time around. I also want more variables accessible, for both current types of notifications. Image URL for sure, but also direct url to whatever's just added. Plan on having a look at the notification system but still haven't got my dev environment setup via the container using my code server :/
Author
Owner

@jcfalcone commented on GitHub (Oct 24, 2023):

@jcfalcone There is a feature request open for this #1812. The only hesitation I have on this is we would have to open up a URL accessible without authentication.

Yeah, I end up remaking the URL inside my API and used a token to access the image; but would be more convenient if we could receive the image, maybe a base64 encoded if you don't want to give direct access.

With this particular request of sending a notification for newly added books the issue is how to handle 100 books added at the same time.

I would go with @emigrating suggestion; split the index process in two loops so you can group; or 2 different alerts, one for indexing and another one for auto downloads.

In the end, the 100 alerts case will only happen a couple of times in most cases and doesn't worth the extra workload.

@jcfalcone commented on GitHub (Oct 24, 2023): > @jcfalcone There is a feature request open for this #1812. The only hesitation I have on this is we would have to open up a URL accessible without authentication. Yeah, I end up remaking the URL inside my API and used a token to access the image; but would be more convenient if we could receive the image, maybe a base64 encoded if you don't want to give direct access. > With this particular request of sending a notification for newly added books the issue is how to handle 100 books added at the same time. I would go with @emigrating suggestion; split the index process in two loops so you can group; or 2 different alerts, one for indexing and another one for auto downloads. In the end, the 100 alerts case will only happen a couple of times in most cases and doesn't worth the extra workload.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1471