libretime/analyzer
dependabot[bot] d61fae8cfa
Bump rgain3 from 1.1.0 to 1.1.1 in /analyzer (#1411)
Bumps [rgain3](https://github.com/chaudum/rgain) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/chaudum/rgain/releases)
- [Changelog](https://github.com/chaudum/rgain3/blob/1.1.1/CHANGES.md)
- [Commits](https://github.com/chaudum/rgain/compare/1.1...1.1.1)

---
updated-dependencies:
- dependency-name: rgain3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-17 18:50:43 +02:00
..
airtime_analyzer Move python_apps/airtime_analyzer/ to analyzer/ 2021-10-17 08:02:47 +00:00
install/systemd Move python_apps/airtime_analyzer/ to analyzer/ 2021-10-17 08:02:47 +00:00
tests Better format enforcing (#1391) 2021-10-17 16:24:37 +02:00
tools Move python_apps/airtime_analyzer/ to analyzer/ 2021-10-17 08:02:47 +00:00
Makefile Better format enforcing (#1391) 2021-10-17 16:24:37 +02:00
README.md Move python_apps/airtime_analyzer/ to analyzer/ 2021-10-17 08:02:47 +00:00
packages.ini Move python_apps/airtime_analyzer/ to analyzer/ 2021-10-17 08:02:47 +00:00
setup.py Bump rgain3 from 1.1.0 to 1.1.1 in /analyzer (#1411) 2021-10-17 18:50:43 +02:00

README.md

libretime-analyzer

libretime-analyzer is a daemon that processes LibreTime file uploads as background jobs.

It performs metadata extraction using Mutagen and moves uploads into LibreTime's music library directory (stor/imported).

libretime-analyzer uses process isolation to make it resilient to crashes and runs in a multi-tenant environment with no modifications.

Installation

python setup.py install

You will need to allow the "airtime" RabbitMQ user to access all exchanges and queues within the /airtime vhost:

rabbitmqctl set_permissions -p /airtime airtime .\* .\* .\*

Usage

This program must run as a user with permissions to write to your Airtime music library directory. For standard Airtime installations, run it as the www-data user:

sudo -u www-data libretime-analyzer --daemon

Or during development, add the --debug flag for more verbose output:

sudo -u www-data libretime-analyzer --debug

To print usage instructions, run:

libretime-analyzer --help

This application can be run as a daemon by running:

libretime-analyzer -d

Developers

For development, you want to install libretime-analyzer system-wide but with everything symlinked back to the source directory for convenience. This is super easy to do, just run:

pip install -r requirements-dev.txt
pip install --editable .

To send an test message to libretime-analyzer, you can use the message_sender.php script in the tools directory. For example, run:

php tools/message_sender.php '{ "tmp_file_path" : "foo.mp3", "final_directory" : ".", "callback_url" : "http://airtime.localhost/rest/media/1", "api_key" : "YOUR_API_KEY" }'

php tools/message_sender.php '{"tmp_file_path":"foo.mp3", "import_directory":"/srv/airtime/stor/imported/1","original_filename":"foo.mp3","callback_url": "http://airtime.localhost/rest/media/1", "api_key":"YOUR_API_KEY"}'

Logging

By default, logs are saved to:

/var/log/airtime/airtime_analyzer.log

This application takes care of rotating logs for you.

Unit Tests

To run the unit tests, execute:

nosetests

If you care about seeing console output (stdout), like when you're debugging or developing a test, run:

nosetests -s

To run the unit tests and generate a code coverage report, run:

nosetests --with-coverage --cover-package=airtime_analyzer

Running in a Multi-Tenant Environment

History and Design Motivation