Commit Graph

155 Commits

Author SHA1 Message Date
advplyr
9712bdf5f0 Update:Check if directory already exists before upload #1497 2023-05-27 16:00:34 -05:00
advplyr
b52e240025 Add:Batch re-scan #1754 2023-05-27 14:51:03 -05:00
advplyr
eb7f66c89e Add:Narrators page #860 #1139 2023-04-30 14:11:54 -05:00
advplyr
e4961feffb Update:Remove item metadata path when removing item #1561 2023-04-16 16:23:13 -05:00
advplyr
5a21e63d0b Add:Delete library files, condense item options in more menu #1439 2023-04-13 18:03:39 -05:00
advplyr
718890cfad Add:Download button to download full library item #580 2023-04-09 17:05:35 -05:00
advplyr
25ca950dd0 Update listening sessions per device and show open sessions 2023-04-08 18:01:24 -05:00
advplyr
d7f18bdd8b Remove deprecated user settings 2023-04-03 17:41:03 -05:00
advplyr
05b102722b Remove unused ebook routes 2023-04-03 17:33:02 -05:00
advplyr
034b8956a2 Add:Batch embed metadata and queue system for metadata embedding #700 2023-04-02 16:13:18 -05:00
advplyr
9fdc8df8bc Update:API endpoint for updating book media does not require an id for new series/authors #1540 2023-03-31 17:04:26 -05:00
advplyr
575a162f8b Update:API endpoint for get all users to use minimal payload 2023-03-29 14:56:50 -05:00
advplyr
aef2c52630
Merge pull request #1581 from mfcar/improvePodcastEditing
Improve podcast editing
2023-03-05 12:28:12 -06:00
advplyr
022bf9d0ef Show current episode download on init and download queue page updates 2023-03-05 10:35:34 -06:00
mfcar
72396c5a98
Add Prev/Next buttons on podcast editing 2023-03-04 19:04:55 +00:00
mfcar
34ac972130
Add download queue 2023-02-27 02:56:07 +00:00
advplyr
f9e6655359 Update:API endpoint for syncing multiple local sessions. New API endpoint to get current user. Deprecate /me/sync-local-progress endpoint 2023-02-05 16:52:17 -06:00
advplyr
b957e1a36b Update:API endpoints for library and library item scan updated to POST requests 2023-02-03 17:50:42 -06:00
advplyr
5bde320ac7 Update:Remove X-Powered-By express response headers 2023-02-01 14:34:01 -06:00
Lars Kiesow
08250e266e
Implement X-Accel Redirect
This patch implements [X-Accel](https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/)
redirect headers as an optional way for offloading static file delivery
from Express to Nginx, which is far better optimized for static file
delivery.

This provides a really easy to configure way for getting a huge
performance boost over delivering all files through Audiobookshelf.

How it works
------------

The way this works is basically that Audiobookshelf gets an HTTP request
for delivering a static file (let's say an audiobook). It will first
check the user is authorized and then convert the API path to a local
file path.

Now, instead of reading and delivering the file, Audiobookshelf will
return just the HTTP header with an additional `X-Accel-Redirect`
pointing to the file location on the file syste.

This header is picked up by Nginx which will then deliver the file.

Configuration
-------------

The configuration for this is very simple. You need to run Nginx as
reverse proxy and it must have access to your Audiobookshelf data
folder.

You then configure Audiobookshelf to use X-Accel by setting
`USE_X_ACCEL=/protected`. The path is the internal redirect path used by
Nginx.

In the Nginx configuration you then configure this location and map it
to the storage area to serve like this:

```
location /protected/ {
  internal;
  alias /;
}
```

That's all.

Impact
------

I just did a very simple performance test, downloading a 1170620819
bytes large audiobook file from another machine on the same network
like this, using `time -p` to measure how log the process took:

```sh
URL='https://url to audiobook…'

for i in `seq 1 50`
do
  echo "$i"
  curl -s -o /dev/null "${URL}"
done
```

This sequential test with 50 iterations and without x-accel resulted in:

```
real 413.42
user 197.11
sys 82.04
```

That is an average download speed of about 1080 MBit/s.

With X-Accel enabled, serving the files through Nginx, the same test
yielded the following results:

```
real 200.37
user 86.95
sys 29.79
```

That is an average download speed of about 2229 MBit/s, more than
doubling the previous speed.

I have also run the same test with 4 parallel processes and 25 downloads
each. Without x-accel, that test resulted in:

```
real 364.89
user 273.09
sys 112.75
```

That is an average speed of about 2448 MBit/s.

With X-Accel enabled, the parallel test also shows a significant
speedup:

```
real 167.19
user 195.62
sys 78.61
```

That is an average speed of about 5342 MBit/s.

While doing that, I also peaked at the system load which was a bit lower
when using X-Accel. Even though the system was delivering far more data.
But I just looked at the `load1` values and did not build a proper test
for that. That means, I cant provide any definitive data.

Supported Media
---------------

The current implementation works for audio files and book covers. There
are other media files which would benefit from this mechanism like feed
covers or author pictures.

But that's something for a future developer ;-)
2023-01-23 00:02:27 +01:00
advplyr
2cd9079692 Add MusicBrainz provider 2023-01-07 13:05:33 -06:00
advplyr
49c581ed35 Add:Podcast option to quick match all unmatched episodes 2023-01-04 18:13:46 -06:00
advplyr
d6da161b13 Music albums grouping and page 2023-01-02 18:02:04 -06:00
advplyr
44363f05ac Start of new epub reader 2023-01-01 18:09:00 -06:00
advplyr
70ba2f7850 Add:RSS feed for series & cleanup empty series from db #1265 2022-12-31 16:58:19 -06:00
advplyr
c6763dee2d Remove invalid RSS feeds on init and remove feeds when associated entity is removed 2022-12-31 14:08:34 -06:00
advplyr
061695f922 Add:API endpoint for opening RSS feed for collection #606 #1265 2022-12-26 17:48:39 -06:00
advplyr
e803dcd325 Update:RSS feed API routes 2022-12-26 16:58:36 -06:00
Paul Nettleton
2cba83f1dd Server socket event fixes 2022-12-22 16:26:11 -06:00
advplyr
4971787482 Add:Manage genres #1163 2022-12-18 14:52:53 -06:00
advplyr
4d93e39fa9 Add:Item metadata utils config page for managing tags #1163 2022-12-18 14:17:52 -06:00
advplyr
5165f11460 Add:Create playlist from a collection #1226 2022-12-17 17:31:19 -06:00
advplyr
49a69193d8 Comments where user settings needs to be removed 2022-12-17 14:52:10 -06:00
advplyr
e307ded192 Remove item from playlist when removing item, update PlaylistController socket events to emit to playlist userId 2022-11-27 14:49:21 -06:00
advplyr
7e171576e0 Update:Add libraries playlists API endpoint, add lazy playlists card 2022-11-26 17:24:46 -06:00
advplyr
f9b87b94bf Add:Playlist API endpoints 2022-11-26 15:14:45 -06:00
advplyr
180293ebc1 Update:Cleanup socket usage & add func for emitting events to admin users 2022-11-24 16:35:26 -06:00
advplyr
e2af33e136 Update:Refactor socket connection management into SocketAuthority 2022-11-24 15:53:58 -06:00
advplyr
64a8a046c1 Update:Backups API endpoints, add get all backups route, update socket init event payload 2022-11-24 13:14:29 -06:00
advplyr
e3ba739db5 Update:Encode & embed metadata API endpoints, separate cache & search endpoints into controllers 2022-11-19 13:28:06 -06:00
advplyr
3316394f5c Add:Button on series books page to re-add series to continue listening #1159 2022-11-15 17:20:57 -06:00
advplyr
fdf67e17a0 Add:API endpoint to get users online and open listening sessions #1125 2022-11-10 17:42:20 -06:00
advplyr
c254dc5144 Add:Button for testing scan probes in audiobook tracks table 2022-10-02 15:24:32 -05:00
advplyr
142205f060 Add:Purge items cache button and api endpoint 2022-10-02 14:46:48 -05:00
advplyr
02d997897c Add:Cancel m4b merge button #1008 2022-10-02 14:31:04 -05:00
advplyr
39979ff8a3 Add:Tasks widget in appbar for merging m4bs & remove old m4b merge routes 2022-10-02 14:16:17 -05:00
advplyr
98e79f144c Add:Remove item from continue listening shelf #919 2022-09-28 17:45:39 -05:00
advplyr
ac30a971c5 Fix:Clean user data on server start removing invalid media progress items 2022-09-28 17:12:27 -05:00
advplyr
9ee6eaade9 Add:Hide series from home page option #919 2022-09-27 17:48:45 -05:00
advplyr
f36a5eae6d Update:Audiobook merge to set metadata with tone and replace m4b in library item #594 2022-09-26 18:07:31 -05:00
advplyr
162a1b7971 Add:Purge media progress button & api endpoint for items that no longer exist #921 2022-09-25 17:11:39 -05:00
advplyr
97da73baf3 Update:Experimental metadata embed tool to use tone 2022-09-25 15:56:06 -05:00
advplyr
a35b35c062
Merge pull request #1005 from Undergrid/multi_select_quick_match
Multi select quick match
2022-09-24 17:46:51 -05:00
advplyr
0ef2a2e4b6 Update:Notifications onTest for testing and parse title/body template #996 2022-09-24 16:15:16 -05:00
advplyr
37a3fdb606 Notifications UI update and delete endpoint 2022-09-23 18:10:03 -05:00
Nick Thomson
731cf8e4ed Fix whitespace issues 2022-09-23 19:37:30 +01:00
Nick Thomson
dbb62069ef Implementation of batch quick match API and related options dialog 2022-09-23 17:51:34 +01:00
advplyr
b08ad8785e Notification create/update events UI 2022-09-22 18:12:48 -05:00
advplyr
ff04eb8d5e Add:Notification settings, notification manager trigger #996 2022-09-21 18:01:10 -05:00
advplyr
f6b6c0a41e Add:API endpoint for podcasts to get most recent unfinished episodes for all podcasts in the library 2022-09-16 16:59:16 -05:00
advplyr
8ec4bd4279 Fix:User permissions for collection API routes and UI #951 2022-08-31 15:46:10 -05:00
advplyr
2304f37cbe Add:Schedule periodic library scans #655 2022-08-17 18:44:21 -05:00
advplyr
9f200ece99 Add:API endpoint to get continue listening items across all libraries for android auto 2022-08-14 10:24:41 -05:00
advplyr
0c5db214d1 Add:Delete playback session button and api route 2022-08-13 12:24:19 -05:00
advplyr
fddf850a41 Add:Cron validation api endpoint 2022-08-01 18:06:22 -05:00
advplyr
516c5c3308 Add:Podcast episode match tab and find episode by title api route 2022-07-31 13:12:37 -05:00
advplyr
377ae7ab19 Update /matchall api endpoint to GET 2022-07-30 15:52:13 -05:00
advplyr
976427b0b3 Fix:Set correct mime type for m4b file static requests 2022-07-24 13:32:05 -05:00
advplyr
415e0a7b5a Remove dependency date-and-time 2022-07-06 19:18:27 -05:00
advplyr
d0af1c3c9a Remove fs-extra dependency 2022-07-05 19:53:01 -05:00
advplyr
5cd343cb01 Add:All listening sessions config page 2022-06-04 12:44:42 -05:00
advplyr
bf928692d5 Update:API route for getting playback session and getting media progress 2022-06-03 18:59:42 -05:00
advplyr
514893646a Add:OPML Upload for bulk adding podcasts #588 2022-05-29 11:46:45 -05:00
advplyr
54663f0f01 Fix:Listening stats on users page and user listening-sessions api endpoint 2022-05-26 15:10:12 -05:00
advplyr
5187d0e55f Add:Option to hard delete podcast episode from file system #488 2022-05-24 18:38:25 -05:00
advplyr
3e98b6f749 Update:Remove manual sorting of podcast episodes and default to sort by published at 2022-05-23 19:28:00 -05:00
advplyr
6cfe583535 Fix:Static router for downloading single file library items #627 2022-05-23 18:31:11 -05:00
advplyr
2a235b8324 Add:RSS feeds for audiobooks #606 2022-05-19 18:51:58 -05:00
advplyr
cc1181b301 Add:Chapter editor, lookup chapters via audnexus, chapters table on audiobook landing page #435 2022-05-10 17:03:41 -05:00
advplyr
2e070227ab Update:Give full permissions to admin users except updating root or viewing root api token #137 2022-05-03 19:16:16 -05:00
advplyr
678dceefed Add:Experimental generate podcast RSS feed #553 2022-05-02 16:42:30 -05:00
advplyr
8b38dda229 Add:experimental generate podcast feed for testing 2022-05-02 14:41:59 -05:00
advplyr
84c12a6e7e Add:Experimental embed metadata in audio files #141 2022-05-01 18:33:46 -05:00
advplyr
b19442e440 Remove old home page personalized API route 2022-04-30 11:36:05 -05:00
advplyr
2e28c9b06d Add: button on issues page to remove all library items with issues #476 2022-04-24 18:25:33 -05:00
advplyr
e3ae3f7e6a Update personalized api endpoint to new optimal function that only loops through library items once 2022-04-24 16:56:30 -05:00
advplyr
034d858f18 Change new podcast modal to remove episode download list #494, Fix error when importing many episodes (set max size to 5MB) #493, show podcast episodes downloading and in queue on podcast landing page 2022-04-23 19:41:06 -05:00
advplyr
ebc9e1a888 Fix batch mark as finished and clear selection #490 2022-04-23 17:17:05 -05:00
advplyr
ad3fbe7abf Add back in m4b merge downloader in experimental #478 2022-04-21 18:52:28 -05:00
advplyr
ef88972b25 Fix total listening time stats check for strings, remove from experimental since listening sessions are created for all playbacks 2022-04-20 18:16:27 -05:00
advplyr
35f3b5863f Add library match all back updated to support v2 models 2022-04-20 18:05:09 -05:00
advplyr
2a386ca2a9 Add sync local media progress routes for offline mobile playback session support 2022-04-09 17:56:51 -05:00
advplyr
c0ff28ffff Add recent series and authors bookshelf rows on home 2022-03-27 16:16:08 -05:00
advplyr
3f8e685d64 Podcasts add get episode feed and download, add edit podcast episode modal 2022-03-27 15:37:04 -05:00
advplyr
0dd219f303 Add podcast episode auto download new episodes cron 2022-03-26 19:58:59 -05:00
advplyr
12027b9a76 Podcast episode player fixes, episode table ui updates 2022-03-26 18:23:33 -05:00
advplyr
0e665e2091 Add playing podcast episodes, episode progress, podcast page, podcast home page shelves 2022-03-26 17:41:26 -05:00
advplyr
3150822117 New data model removing media entity for books 2022-03-26 11:59:34 -05:00
advplyr
e1e6b46456 Create podcast manager and re-organize managers 2022-03-20 16:41:06 -05:00
advplyr
27f1bd90f9 Add:Restrict user permissions by tag 2022-03-20 06:29:08 -05:00