diff --git a/app/filters.py b/app/filters.py index ac8c13f..f1ec19e 100644 --- a/app/filters.py +++ b/app/filters.py @@ -3,6 +3,7 @@ import re from markupsafe import Markup from app.classes import AudioProfile +from app import app filters = {} @@ -50,6 +51,17 @@ def audioprofile(text: str, path: str) -> Markup: f"Sample Rate: {audio_profile.sample_rate} Hz
" f"Channels: {audio_profile.channels}
" f"Quality Score: {audio_profile.compute_quality_score()}" - f"" + ) return Markup(audio_profile_html) + + +@template_filter('jellyfin_link') +def jellyfin_link(jellyfin_id: str) -> Markup: + + jellyfin_server_url = app.config.get('JELLYFIN_SERVER_URL') + if not jellyfin_server_url: + return Markup(f"JELLYFIN_SERVER_URL not configured") + + link = f"{jellyfin_server_url}/web/#/details?id={jellyfin_id}" + return Markup(f'{jellyfin_id}') \ No newline at end of file