From 552046484564ff34cc6f4f964ae648ff9086a8ba Mon Sep 17 00:00:00 2001 From: mb Date: Thu, 30 Nov 2023 10:53:01 +0100 Subject: [PATCH] adding the APPLICATION_HOSTNAME to .env + settings.py for now, adding parsing function to list audio files in podcast view, changing order of buttons in nav --- octomode.py | 11 +++++++---- settings.py | 1 + templates/base.html | 6 +++--- templates/podcast.rss | 15 +++++++++++++-- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/octomode.py b/octomode.py index 2817081..e46140e 100755 --- a/octomode.py +++ b/octomode.py @@ -131,8 +131,7 @@ def get_app_hostname(): # app_url = urlparse(request.base_url).netloc # app_hostname = app_protocol + app_url - # app_hostname = "http://localhost:5555" # hardcoded for now - app_hostname = "https://circulations.constantvzw.org" # hardcoded for now + app_hostname = APP.config['APPLICATION_HOSTNAME'] return app_hostname @@ -246,9 +245,13 @@ def pagedjs(name): def rss(name): # TO GENERATE THE PODCAST RSS FEED md_pad_content = get_pad_content(name, ext='.md') - rss = "RSS FEED TO BE INSERTED HERE" + audio = [] + for line in md_pad_content.splitlines(): + # if any(ext in line for ext in [".mp3", ".ogg"]): + if ".mp3" in line: + audio.append(line) - return render_template('podcast.rss', name=name.strip(), rss=rss) + return render_template('podcast.rss', name=name.strip(), rss=rss, audio=audio) # ////////////////// diff --git a/settings.py b/settings.py index 3382679..c166473 100644 --- a/settings.py +++ b/settings.py @@ -5,6 +5,7 @@ from dotenv import load_dotenv load_dotenv() # Bind them to Python variables +APPLICATION_HOSTNAME = os.environ.get('OCTOMODE_APPLICATION_HOSTNAME', 'http://localhost:5555') APPLICATION_ROOT = os.environ.get('OCTOMODE_APPLICATION_ROOT', '/') PORTNUMBER = int(os.environ.get('OCTOMODE_PORTNUMBER', 5001)) PAD_URL = os.environ.get('OCTOMODE_PAD_URL', 'https://pad.vvvvvvaria.org') diff --git a/templates/base.html b/templates/base.html index 3aefd7b..e478344 100644 --- a/templates/base.html +++ b/templates/base.html @@ -36,12 +36,12 @@ window.addEventListener('load', function () { 🔗 - - 🔗 - 🔗 + + 🔗 + `; document.body.insertBefore(nav, document.body.firstChild); diff --git a/templates/podcast.rss b/templates/podcast.rss index 9176d66..c0f7e65 100644 --- a/templates/podcast.rss +++ b/templates/podcast.rss @@ -1,3 +1,14 @@ -RSS FEED FOR: {{ name }} +PODCAST RSS FEED FOR: {{ name }} -{{ rss }} +

+ +audio found: + +

+ +{% for link in audio %} + + +

+ +{% endfor %}