Commit Graph

274 Commits

Author SHA1 Message Date
jo d8195f0fd8 Fix trailing whitespaces in files 2021-06-04 17:06:05 +02:00
jo c27f020d73 Format code using black 2021-06-04 17:06:05 +02:00
jo 65f7b41487 Fix spelling 2021-06-04 17:04:53 +02:00
jo ac17db97fc Fix missing encoding pragma on python files 2021-06-04 17:04:53 +02:00
Kyle Robbertze 6f6d90fad7 update replaygain values 2021-05-21 16:15:50 +02:00
Lucas Bickel e21abf1bf1 refactor(airtime_analyzer): rename to libretime-analyzer and make entrypoint pythonic 2021-01-04 10:30:27 +00:00
rjhelms 2160daea00 Fix replaygain_analyzer in Python 3.5
'text' argument was added in Python 3.7 as an alias of 'universal_newlines'. Using 'universal_newlines' works on Python 3.5/3.6 and should be forward-compatible.
2020-11-19 14:52:52 -05:00
Zachary Klosko a5023d031a pin PyGObject versions to distro provided packages
this prevents pip trying to build the pypi package and failing.
Fixes: #1107
2020-11-18 17:49:51 +02:00
Zachary Klosko 6540a34a9b Adding back scripts in /docs 2020-05-19 10:16:31 -04:00
Kyle Robbertze e0e4d4c87f Ensure all json loads calls use strings 2020-05-04 13:25:36 +02:00
Kyle Robbertze ca0d01b693 Fix mutagen to compatible versions 2020-04-29 19:06:52 +02:00
Keoni Mahelona a643883d06 Set pika version to ~1.1.0 to prevent api updates from breaking code.
Updated message_listener for new version.
2020-04-29 19:06:52 +02:00
Kyle Robbertze 3a8b1e207f deprecate media_monitor completely 2020-04-29 19:06:52 +02:00
Kyle Robbertze 82042e8c69 fix test failures 2020-04-29 19:06:52 +02:00
Kyle Robbertze 8346e89e99 install successfully using py3 2020-04-29 19:05:35 +02:00
Kyle Robbertze 81ad2fc705 do not be backwards compatible 2020-04-29 19:05:35 +02:00
Kyle Robbertze 9298ea7e05 airtime_analyzer: depend on rgain3 for py3 2020-04-29 19:05:35 +02:00
Kyle Robbertze 632ba9acfe convert print statements to py3 2020-04-29 19:05:35 +02:00
Keoni Mahelona f6f536c749 Set mutagen~=1.43.0 until LibreTime moves to python3 2020-02-19 04:01:11 +00:00
Robb 71d4da185a
Merge pull request #652 from radiorabe/chore/cleanup-analyzer-abc
Cleanup airtime_analyzer/analyzer.py
2018-12-23 11:42:15 -05:00
Lucas Bickel 201d3741d8 🔥 (analyzer) cleanup analyzer.py 2018-12-22 22:19:38 +01:00
Robbt 9e78c110c5 made mutagen version 1.41 or above 2018-12-19 15:50:10 -05:00
Robbt a2573b52d2 fixed bad operator 2018-12-13 08:58:59 -05:00
Robbt f673d92edd modified bitrates to match new mutagen values 2018-12-13 08:53:52 -05:00
vagrant 2ee85f0546 made mp3 bitrate test a range vs. exact number because of variation in results from different mutagen versions 2018-12-04 00:35:24 +00:00
Robbt 6b0e6312af removed the version restriction on mutagen to take advantage of bug fixes 2018-11-28 07:47:54 -05:00
Lucas Bickel f7ceeedb04 (Amazon S3) drop broken S3 support 2018-10-06 12:45:22 +02:00
Lucas Bickel da64166fa5 Fix call with deprecated arg 2018-07-06 12:12:39 +02:00
Lucas Bickel 586314052f Better error message when parsing WAVE file 2017-09-20 19:13:15 +02:00
Robb bd845a016d Merge pull request #253 from radiorabe/feature/refactor-config-structure
Simplify configuration file structure
2017-08-05 20:47:28 -04:00
Robb Ebright 314654dfe4 Enable logging for analyzer and pypo 2017-08-05 17:56:23 -04:00
Lucas Bickel fa2018a2c5 Simplify configuration file structure
This removes most of the legacy upstream config madness by not using
weird config files spread all over the place.

This isn't the solution to other config reading fragility issues, but
it does move the whole config back to the central airtime.conf file.
2017-07-21 13:15:28 +02:00
Robb 3b2a9451eb Merge pull request #169 from radiorabe/feature/use-official-magic
Use file-magic instead of python-magic
2017-04-28 19:56:38 -04:00
Lapotor 0766b91cde Added remind to reload systemctl for Xenail 2017-04-19 20:36:48 +02:00
Lucas Bickel 9ce611130c Use file-magic instead of python-magic
This gets the mime type using file-magic in a most minimal way. Since the python bindings have been available as a distro package for quite a while it is written in a way so it should also run on pre pypi installs of file-magic. This means not being able to use nice things like magic.detect_from_filename due to the fact that they where added rather recently (with recently being 2 years ago).

As the mime type is only used to check for wav files that mutagen can't handle it only reads the mime type and ignores the charset and other attributes that magic can find.

Due to the fact that file-magic is not properly unicode safe I'm checking the file based on it's first 2048 bytes as per <http://stackoverflow.com/questions/34836792/python-magic-cant-identify-unicode-filename#comment57418632_34838355>. This is not an issue since wav files need to start with a wav header by definition anyway.

I tested this sucessfully on both CentOS and Debian with files containing Unicode in their names.
2017-04-18 09:49:09 +02:00
Hans-Joachim aa64b8eab8 get rid of SaaS definitions 2017-03-21 22:56:43 +01:00
Lucas Bickel c29285ae48 Vagrant Debian support (and experimental CentOS)
This changes the Vagrant setup to support multiple installations as multiple
boxes. In addition to Ubuntu Vagrant can now be used to install on Debian
as well as on CentOS.

I took the chance to clean up the .deb install a bit and backported analyzer
and celery to SysV proper so it runs there. Some of the distro specfics were
moved to the install script from the python setup scripts to acheive this.

For the CentOS support I added a rather involved OS prepare script. In the
long term this will be added to the preparing-the-server docs we already have.

I had to switch the default port to http-alt (8080). On CentOS 9080 is registered
for ocsp and getting it to work for apache without hacking SELinux is hard. I
think 8080 is the RFC way to go anyhow. If anyone want to override this it
should be rather easy using the --web-port arg and by hacking Vagrantfile.

The PyOpenSSL code has been refactored for all the distros that the Vagrantfile
now supports.

As far as my checks go, I tried this code with all the distros, uploaded a track
and downloaded a unicode and a ssl podcast and was able to listen to them
in each case.

In the experimental CentOS case, the UI is not up to spec since services
need to get scheduled through systemctl and the status overview (ie. on the /?config page)
do not work properly. They need to be as follows:

```
sudo systemctl start airtime-playout
sudo systemctl start airtime-liquidsoap
sudo systemctl start airtime_analyzer.service
sudo systemctl start airtime-celery.service
```
2017-03-12 13:42:22 +01:00
Lucas Bickel 188c127057 Merge branch 'master' into feature/analyzer-on-travis
# Conflicts:
#	.travis.yml
2017-03-04 16:35:11 +01:00
Lucas Bickel 9b3d0c90da mostly run analyzer tests on travis
* [x] regonfigured the build matrix with more php jobs and a separate python job (we can add more python jobs later)
* [x] run tests on travis' trusty beta container (it's closer to what we need anyway)
* [x] install packages needed for analyzer tests in build env
* [x] added docs on how to run nosetests locally
* [x] don't run initctl in analyzer setup so setup can also be used on travis (and add it to the install script directly)
* [x] ignore replaygain checks on travis (it has proven quite impossible to get the needed python-gi module to work in the provided virtualenv)

I tried a lot of solutions to get the replaygain checks to run. I needed to decide that this has gone far enough, maybe someone who is more of a pythonista than me can take a crack at it and get it solved. Even without running those tests on CI/CD there are still plenty others.

This PR only has parts of what are needed for getting python tests running on travis as per #15. I only took a quick shot at anything not analyzer and figured I would not be able to "fix" them without digging a bit deeper (ie. also getting rid of std_err_override).
2017-03-03 20:38:27 +01:00
Lucas Bickel e28ad471f9 Rewrite config from /etc/airtime-saas to plain /etc/airtime
This is the results of sed -i -e 's|/etc/airtime-saas/|/etc/airtime/|' `grep -irl 'airtime-saas' airtime_mvc/ python_apps/` :P

It might need more testing, the airtime-saas part never really made sense, zf1 has environments for that, ie you would create a saas env based on production for instance.

I beleive legacy upstream was using this to share configuration between customers (ie. analyser runs only once and writes to a shared S3 bucket). I assume they mount the airtime-saas folder onto individual customers instances with a global config. Like I said, I don't feel that this makes sense since all it does is make hacking at the configs in airtime-saas a bit easier. A serious SaaS operation should be using something like puppet or ansible to achieve this.
2017-03-03 15:57:41 +01:00
Albert Santoni 965a78c54a Merge branch 'saas-dev' into saas-dev-publishing
Conflicts:
	airtime_mvc/application/controllers/ApiController.php
2015-11-18 12:38:18 -05:00
Albert Santoni c85944785b Comments 2015-10-30 18:09:56 -04:00
Albert Santoni b49bb2e262 Loosen up Mutagen vs. Silan cue out length threshold a bit 2015-10-30 17:54:24 -04:00
Albert Santoni 7be548f30e Fixed the airtime_analyzer unit tests 2015-10-30 17:15:33 -04:00
Albert Santoni fc51e63214 Fix typo in airtime_analyzer setup.py 2015-10-30 17:13:12 -04:00
Albert Santoni 76f202106b Defensive coding against Silan bugs and bump to Mutagen 1.31 2015-10-30 17:12:13 -04:00
Duncan Sommerville a78a0d0cc8 * Fix track number bug in analyzer
* Move library search bar out of header
2015-09-16 17:50:21 -04:00
Albert Santoni 67c5b73db4 airtime_analyzer unit test backwards compatibility with older versions of requests 2015-07-08 10:32:35 -04:00
Duncan Sommerville 4c797cf100 Update installer to work with saas branch 2015-06-23 19:02:55 -04:00
Albert Santoni c7aa6b3e5e airtime_analyzer: use requests >= 2.7.0 2015-05-20 10:36:55 -04:00