From 4235333374368518b30096be848145ce2dd91a5e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 08:54:04 +0000 Subject: [PATCH 1/4] Initial plan From 8c903bf262cded67c1793903d622c100df0819f2 Mon Sep 17 00:00:00 2001 From: ABED JAMAL Date: Fri, 17 Apr 2026 02:48:35 +0300 Subject: [PATCH 2/4] Update tv_server.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- broadcast-ai/tv_server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/broadcast-ai/tv_server.py b/broadcast-ai/tv_server.py index 7e33fe9..2585270 100644 --- a/broadcast-ai/tv_server.py +++ b/broadcast-ai/tv_server.py @@ -410,8 +410,9 @@ def api_generate(): path = generate_voice(text, style=style, output_name=output_name) duration = round(time.time() - t0, 1) return jsonify({"path": path, "duration": duration, "style": style}) - except Exception as exc: - return jsonify({"error": str(exc)}), 500 + except Exception: + log.exception("Unhandled error during /api/generate request") + return jsonify({"error": "Internal server error"}), 500 # --------------------------------------------------------------------------- From 02a58bafa0c7f0583bfc33b024df1b27dad4d95e Mon Sep 17 00:00:00 2001 From: ABED JAMAL Date: Fri, 17 Apr 2026 02:48:43 +0300 Subject: [PATCH 3/4] Update setup.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- broadcast-ai/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/broadcast-ai/setup.sh b/broadcast-ai/setup.sh index e914d32..2670bed 100755 --- a/broadcast-ai/setup.sh +++ b/broadcast-ai/setup.sh @@ -55,7 +55,7 @@ echo " [OK] Python packages installed" python3 -c "import TTS; print(' [OK] TTS', TTS.__version__)" 2>/dev/null || echo " [!!] TTS import failed" python3 -c "import torch; print(' [OK] PyTorch', torch.__version__)" 2>/dev/null || echo " [!!] PyTorch import failed" python3 -c "import flask; print(' [OK] Flask', flask.__version__)" 2>/dev/null || echo " [!!] Flask import failed" -python3 -c "import feedparser; print(' [OK] feedparser')" 2>/dev/null || echo " [!!] feedparser import failed" +python3 -c "import atoma; print(' [OK] atoma')" 2>/dev/null || echo " [!!] atoma import failed" # --- Directory structure ----------------------------------------------------- echo "" From 45df5c58a0e4703b0c8925d198f77209d35ddc8b Mon Sep 17 00:00:00 2001 From: ABED JAMAL Date: Fri, 17 Apr 2026 02:49:15 +0300 Subject: [PATCH 4/4] Update tv_server.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- broadcast-ai/tv_server.py | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/broadcast-ai/tv_server.py b/broadcast-ai/tv_server.py index 2585270..c3285ac 100644 --- a/broadcast-ai/tv_server.py +++ b/broadcast-ai/tv_server.py @@ -220,14 +220,36 @@ def podcasts_page(): el.innerHTML='

لا توجد حلقات بعد. شغّل podcast_generator.py لإنشاء حلقات.

'; return; } - let html=''; + el.replaceChildren(); data.episodes.forEach((ep,i)=>{ - html+=`
- حلقة ${i+1}${ep.name} - -
`; + const item=document.createElement('div'); + item.style.marginBottom='1rem'; + item.style.paddingBottom='1rem'; + item.style.borderBottom='1px solid #222'; + + const title=document.createElement('strong'); + title.textContent=`حلقة ${i+1}`; + item.appendChild(title); + item.appendChild(document.createTextNode(' — ')); + + const name=document.createElement('span'); + name.className='status'; + name.textContent=ep.name; + item.appendChild(name); + + const audio=document.createElement('audio'); + audio.controls=true; + audio.style.width='100%'; + audio.style.marginTop='0.5rem'; + + const source=document.createElement('source'); + source.src=`/api/episode/${encodeURIComponent(ep.name)}`; + source.type='audio/wav'; + audio.appendChild(source); + + item.appendChild(audio); + el.appendChild(item); }); - el.innerHTML=html; }).catch(()=>{document.getElementById('episodes').innerHTML='

خطأ في التحميل

';}); """)