libretime-bot f429339bfc
chore(main): release 4.5.0 (#3164)
🤖 I have created a release *beep* *boop*
---


## [4.5.0](https://github.com/libretime/libretime/compare/4.4.0...4.5.0)
(2025-07-16)


### Features

* **legacy:** add config option for group separator in header auth
([#3181](https://github.com/libretime/libretime/issues/3181))
([f780994](f780994996))
* **playout:** don't clear liquidsoap queue on liquidsoap startup
([#3163](https://github.com/libretime/libretime/issues/3163))
([0b02ebf](0b02ebf1b6))
* rename `airtime-pypo` exchange to `playout`
([#3170](https://github.com/libretime/libretime/issues/3170))
([63ff50b](63ff50b82c))
* use fanout queue type for playout queue
([#3161](https://github.com/libretime/libretime/issues/3161))
([9e55d3b](9e55d3bb6f))


### Bug Fixes

* **playout:** invalid input source disconnect command send to
liquidsoap ([#3166](https://github.com/libretime/libretime/issues/3166))
([908d548](908d54805a))
* **playout:** remove potential deadlock in liquidsoap client
([#3165](https://github.com/libretime/libretime/issues/3165))
([f33518d](f33518d637))
* **playout:** when metadata has a newline playout stops
([#3160](https://github.com/libretime/libretime/issues/3160))
([d7987bb](d7987bb4ef))
* **worker:** catch mutagen `TypeError` when saving metadata
([#3182](https://github.com/libretime/libretime/issues/3182))
([107bacf](107bacf296))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: jo <ljonas@riseup.net>
2025-07-16 20:35:34 +02:00
..
2023-01-16 08:42:23 +02:00
2023-02-26 19:09:51 +02:00
2025-07-16 20:35:34 +02:00

Shared

The libretime_shared package contains reusable functions and classes for the LibreTime project.

Usage

This library assumes that:

  • You will use Click to build a CLI for your app.
  • You will use Pydantic to validate objects in your app.

Configuration

First define a schema for your configuration in order to validate it. A schema is a class that inherit from pydantic.BaseModel. Some existing schemas can be reused such as libretime_shared.config.RabbitMQ or libretime_shared.config.Database.

Load your configuration using a subclass of libretime_shared.config.BaseConfig.

from pydantic import BaseModel

from libretime_shared.config import RabbitMQConfig, BaseConfig

class AnalyzerConfig(BaseModel):
    bpm_enabled: bool = False
    bpm_track_max_length: int

class Config(BaseConfig):
    rabbitmq: RabbitMQConfig
    analyzer: AnalyzerConfig

config = Config("/etc/libretime/config.yml")

Don't instantiate a sub model if it has a required field, otherwise the Config class import will raise a ValidationError.

CLI

Decorate your CLI commands with the shared decorators to add extra flags.

import click
from libretime_shared.cli import cli_logging_options, cli_config_options

from .app import App

@click.group()
def cli():
    pass

@cli.command()
@cli_config_options()
@cli_logging_options()
def run(**kwargs):
    app = App(**kwargs)
    return app.run()