media format detection

This commit is contained in:
meeb
2020-12-08 16:19:19 +11:00
parent d958f426d7
commit d7345c92c3
7 changed files with 292 additions and 83 deletions

View File

@@ -33,6 +33,10 @@
<td class="hide-on-small-only">Desired format</td>
<td><span class="hide-on-med-and-up">Desired format<br></span><strong>{{ media.source.format_summary }}</strong></td>
</tr>
<tr title="Fallback setting on the source">
<td class="hide-on-small-only">Fallback</td>
<td><span class="hide-on-med-and-up">Fallback<br></span><strong>{{ media.source.get_fallback_display }}</strong></td>
</tr>
<tr title="Has the media been downloaded">
<td class="hide-on-small-only">Downloaded</td>
<td><span class="hide-on-med-and-up">Downloaded<br></span><strong>{% if media.downloaded %}<i class="fas fa-check"></i>{% else %}<i class="fas fa-times"></i>{% endif %}</strong></td>
@@ -48,11 +52,11 @@
</td>
</tr>
<tr title="Best available format for source requirements">
<td class="hide-on-small-only">Best match</td>
<td><span class="hide-on-med-and-up">Best match<br></span><strong>
audio: {{ media.get_best_audio_format }}<br>
video: {{ media.get_best_video_format }}<br>
combo: {{ media.get_best_combined_format }}
<td class="hide-on-small-only">Matched formats</td>
<td><span class="hide-on-med-and-up">Matched formats<br></span>
Combined: <strong>{% if combined_format %}{{ combined_format }} {% if combined_exact %}(exact match){% else %}(fallback){% endif %}{% else %}No match{% endif %}</strong><br>
Audio: <strong>{% if audio_format %}{{ audio_format }} {% if audio_exact %}(exact match){% else %}(fallback){% endif %}{% else %}No match{% endif %}</strong><br>
Video: <strong>{% if video_format %}{{ video_format }} {% if video_exact %}(exact match){% else %}(fallback){% endif %}{% else %}No match{% endif %}
</strong></td>
</tr>
</table>