Display download options even when video only has one format

This commit is contained in:
Pierre Rudloff 2019-11-07 23:42:48 +01:00
parent d0add4955d
commit adba68edbc

View file

@ -20,11 +20,11 @@
<br/> <br/>
<form action="{path_for name="download"}"> <form action="{path_for name="download"}">
<input type="hidden" name="url" value="{$video->webpage_url}" /> <input type="hidden" name="url" value="{$video->webpage_url}" />
{if $config->uglyUrls}
<input type="hidden" name="page" value="download" />
{/if}
{if isset($video->formats) && count($video->formats) > 1} {if isset($video->formats) && count($video->formats) > 1}
<h3><label for="format">{t}Available formats:{/t}</label></h3> <h3><label for="format">{t}Available formats:{/t}</label></h3>
{if $config->uglyUrls}
<input type="hidden" name="page" value="download" />
{/if}
<select name="format" id="format" class="formats monospace"> <select name="format" id="format" class="formats monospace">
<optgroup label="{t}Generic formats{/t}"> <optgroup label="{t}Generic formats{/t}">
{foreach $config->genericFormats as $format => $name} {foreach $config->genericFormats as $format => $name}
@ -70,26 +70,26 @@
{/foreach} {/foreach}
</optgroup> </optgroup>
</select><br/><br/> </select><br/><br/>
{if $config->stream} {/if}
<input type="checkbox" checked name="stream" id="stream"/> {if $config->stream}
<label for="stream">{t}Stream the video through the server{/t}</label> <input type="checkbox" checked name="stream" id="stream"/>
<br/><br/> <label for="stream">{t}Stream the video through the server{/t}</label>
{/if} <br/><br/>
{if $config->convertAdvanced} {/if}
<input type="checkbox" name="customConvert" id="customConvert"/> {if $config->convertAdvanced}
<label for="customConvert">{t}Convert into a custom format:{/t}</label> <input type="checkbox" name="customConvert" id="customConvert"/>
<select title="Custom format" name="customFormat" aria-label="{t}Format to convert to{/t}"> <label for="customConvert">{t}Convert into a custom format:{/t}</label>
{foreach $config->convertAdvancedFormats as $format} <select title="Custom format" name="customFormat" aria-label="{t}Format to convert to{/t}">
<option>{$format}</option> {foreach $config->convertAdvancedFormats as $format}
{/foreach} <option>{$format}</option>
</select> {/foreach}
{t}with{/t} </select>
<label for="customBitrate" class="sr-only">{t}Bit rate{/t}</label> {t}with{/t}
<input type="number" value="{$config->audioBitrate}" title="Custom bitrate" class="customBitrate" <label for="customBitrate" class="sr-only">{t}Bit rate{/t}</label>
name="customBitrate" id="customBitrate" aria-describedby="customBitrateUnit" /> <input type="number" value="{$config->audioBitrate}" title="Custom bitrate" class="customBitrate"
<span id="customBitrateUnit">{t}kbit/s audio{/t}</span> name="customBitrate" id="customBitrate" aria-describedby="customBitrateUnit" />
<br/><br/> <span id="customBitrateUnit">{t}kbit/s audio{/t}</span>
{/if} <br/><br/>
{/if} {/if}
<input class="downloadBtn" type="submit" value="{t}Download{/t}" /><br/> <input class="downloadBtn" type="submit" value="{t}Download{/t}" /><br/>
</form> </form>