Spaces:
Running
Running
Update short video header: auto_scheduled posts use Tin tóm tắt VNEWS header
Browse files- ai_patch.py +5 -2
ai_patch.py
CHANGED
|
@@ -662,7 +662,8 @@ def _make_short_frame_full(post, img_path, out_path):
|
|
| 662 |
draw.rectangle((0, 720, W, H), fill=(14, 14, 14))
|
| 663 |
margin = 48
|
| 664 |
maxw = W - margin * 2
|
| 665 |
-
|
|
|
|
| 666 |
y = 830
|
| 667 |
for ln in _wrap_text_px(draw, post.get("title", ""), font_title, maxw, 4):
|
| 668 |
draw.text((margin, y), ln, fill=(255, 255, 255), font=font_title)
|
|
@@ -740,7 +741,9 @@ def _make_scene_frame(post, segment, idx, total, img_path, out_path, emotion='ne
|
|
| 740 |
for i in range(total):
|
| 741 |
fill=(92,184,122) if i==idx else (70,70,70)
|
| 742 |
draw.rounded_rectangle((dot_x+i*38,dot_y,dot_x+i*38+24,dot_y+10), radius=5, fill=fill)
|
| 743 |
-
|
|
|
|
|
|
|
| 744 |
draw.rounded_rectangle((48,834,260,880), radius=20, fill=(28,70,45))
|
| 745 |
draw.text((66,842),f'Đoạn {idx+1}/{total}',fill=(235,235,235),font=font_small)
|
| 746 |
y=940; maxw=W-96
|
|
|
|
| 662 |
draw.rectangle((0, 720, W, H), fill=(14, 14, 14))
|
| 663 |
margin = 48
|
| 664 |
maxw = W - margin * 2
|
| 665 |
+
brand = 'Tin tóm tắt VNEWS 7h sáng, 13h trưa, 19h tối' if post.get('kind') == 'auto_scheduled' else 'VNEWS · Tường AI'
|
| 666 |
+
draw.text((margin, 770), brand, fill=(92, 184, 122), font=font_label)
|
| 667 |
y = 830
|
| 668 |
for ln in _wrap_text_px(draw, post.get("title", ""), font_title, maxw, 4):
|
| 669 |
draw.text((margin, y), ln, fill=(255, 255, 255), font=font_title)
|
|
|
|
| 741 |
for i in range(total):
|
| 742 |
fill=(92,184,122) if i==idx else (70,70,70)
|
| 743 |
draw.rounded_rectangle((dot_x+i*38,dot_y,dot_x+i*38+24,dot_y+10), radius=5, fill=fill)
|
| 744 |
+
# Determine brand text: auto_scheduled uses special header, manual uses default
|
| 745 |
+
brand = 'Tin tóm tắt VNEWS 7h sáng, 13h trưa, 19h tối' if post.get('kind') == 'auto_scheduled' else 'VNEWS AI SHORT'
|
| 746 |
+
draw.text((48,780),brand,fill=(110,231,143),font=font_brand)
|
| 747 |
draw.rounded_rectangle((48,834,260,880), radius=20, fill=(28,70,45))
|
| 748 |
draw.text((66,842),f'Đoạn {idx+1}/{total}',fill=(235,235,235),font=font_small)
|
| 749 |
y=940; maxw=W-96
|