{#if inProgressCount > 0}
{:else if allDownloaded}
{:else}
{/if} {#if size !== "sm"}
{getButtonText()}
{:else}
{getButtonText()}
{/if}
{#if showQualityPicker}
Download Quality
{episodeCount} episodes
{#each Object.entries(QUALITY_PRESETS) as [key, preset]}
startSeasonDownload(key as QualityPreset)} class="w-full px-4 py-3 text-left hover:bg-gray-700 transition-colors flex justify-between items-center" >
{preset.label}
{#if preset.videoBitrate}
{Math.round(preset.videoBitrate / 1_000_000)}Mbps
{:else}
Direct
{/if}
{/each}
showQualityPicker = false} class="w-full px-4 py-3 text-left text-sm text-gray-400 hover:bg-gray-700 border-t border-gray-700" > Cancel
{/if}
{#if showQualityPicker}
showQualityPicker = false} aria-label="Close quality picker" >
{/if}