Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions data/templates/C411.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,24 @@

[h3]🔊 Langue(s)[/h3]

{% for line in audio_lines %}
{{ line }}

[table][tr][th]#[/th][th]Langue[/th][th]Canaux[/th][th]Codec[/th][/tr]

{% for line in audio_lines_dict %}
[tr][td]{{ loop.index }}[/td][td]{{ line.language }}[/td][td]{{ line.channels }}[/td][td]{{ line.format }} ({{ line.bitrate|round(2) }} KB/s)[/td][/tr]
{% endfor %}
[/table]

{% if subtitle_lines %}

[h3]💬 Sous-titre(s)[/h3]
[table][tr][th]#[/th][th]Langue[/th][th]Format[/th][th]Type[/th][/tr]
{% for line in subtitle_lines_dict %}
[tr][td]{{ loop.index }}[/td][td]{{ line.language }}[/td][td]{{ line.format }}[/td][td]{{ line.type

{% for line in subtitle_lines %}
{{ line }}
}}[/td][/tr]
{% endfor %}
[/table]
{% endif %}

[b][color=#3d85c6]Team :[/color][/b] [i]{{ tag }}[/i]
Expand Down
21 changes: 21 additions & 0 deletions src/trackers/FRENCH.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@ async def get_translation_fr(meta: dict[str, Any]) -> tuple[str, str]:
tmdb_id = int(meta["tmdb_id"])
category = str(meta["category"])
tmdb_title, tmdb_overview = await get_tmdb_translations(tmdb_id, category, "fr")
# fallback in case the translated title is empty
if tmdb_title == '':
tmdb_title = meta.get("title","")

meta["frtitle"] = french_title or tmdb_title
meta["froverview"] = tmdb_overview

Expand Down Expand Up @@ -549,6 +553,7 @@ async def get_desc_full(meta: dict[str, Any], tracker) -> str:

# pre‑compute the lines that were previously appended to ``desc_parts``
audio_lines: list[str] = []
audio_lines_dict = []
for obj in audio_tracks:
if isinstance(obj, dict):
bitrate = obj.get('BitRate')
Expand All @@ -563,15 +568,23 @@ async def get_desc_full(meta: dict[str, Any], tracker) -> str:
flags.append("Commentary")
if " ad" in str(obj.get('Title')).lower():
flags.append("Audio Description")
line_dict = {}
line_dict['language'] = obj['Language']
line_dict['format'] = obj['Format']
line_dict['channels'] = obj['Channels']
line_dict['bitrate'] = kbps


line = f"{obj['Language']} / {obj['Format']} / {obj['Channels']}ch / {kbps:.2f}KB/s"
if flags:
line += " / " + " / ".join(flags)
audio_lines.append(line)
audio_lines_dict.append(line_dict)
else:
audio_lines.append(f"*{obj}*")

subtitle_lines: list[str] = []
subtitle_lines_dict = []
if subtitle_tracks:
for obj in subtitle_tracks:
if isinstance(obj, dict):
Expand All @@ -583,7 +596,13 @@ async def get_desc_full(meta: dict[str, Any], tracker) -> str:
line = f"{obj['Language']} / {obj['Format']}"
if flags:
line += " / " + " / ".join(flags)
line_dict = {}
line_dict['language'] = obj['Language']
line_dict['format'] = obj['Format']
line_dict['type'] = ", ".join(flags)
subtitle_lines.append(line)
subtitle_lines_dict.append(line_dict)

else:
subtitle_lines.append(f"*{obj}*")

Expand All @@ -608,7 +627,9 @@ async def get_desc_full(meta: dict[str, Any], tracker) -> str:
'mal_id': meta.get('mal_id', ''),
'description': description,
'audio_lines': audio_lines,
'audio_lines_dict': audio_lines_dict,
'subtitle_lines': subtitle_lines,
'subtitle_lines_dict': subtitle_lines_dict,
'source': source,
'service_longname': service_longname,
'type': type,
Expand Down