A simple automatic organizer written in bash script for openaudible libraries. The organizer watches the openaudible library and mirrors files by hardlinking them into an organized library.
There are two ways to use the script. As a docker container or use of the script directly. The recommended way is using docker.
$ docker run -v "/mnt/media-data:/media" ghcr.io/joker9944/openaudible-organizer:latest /media/openaudible /media/Audiobooks
$ docker run --rm ghcr.io/joker9944/openaudible-organizer:latest --help
usage: openaudible-organizer [options] openaudible_library_dir organised_library_dir
-h|--help Displays this help
-c|--copy Copy files insted of hardlinking
-v|--verbose Displays verbose output
-nc|--no-colour Disables colour output
-cr|--cron Run silently unless we encounter an error
By default the organizer works by hardlinking files.
This imposes a few requirements, namely:
- The filesystem must support hardlinks
- The link source and target must be on the same filesystem
If your setup does not meet this requirements there is the option to copy files instead of linking.
$ docker run -v "/mnt/media-data:/media" ghcr.io/joker9944/openaudible-organizer:latest --copy /media/openaudible /media/Audiobooks
This project has been done a few times now in different languages. But all existing solutions either just copy the files which doubles the size of the library or require some manual steps each time the library should be organized. I disliked both downsides so I cooked up a solution which solves these issues.
Inspirations and related projects
- bash-script-template Template for this project
- openaudible-audiobookshelf-watcher Similar project writen in TypeScript
- openaudible-create-author-directories Similar project writen in PowerShell
- OpenAudible Book Organizer Similar project writen in C#