In format selection: Show resolution and download size (if available)
This commit is contained in:
@@ -387,6 +387,7 @@ export default function Home({ socket }: Props) {
|
|||||||
setPickedAudioFormat('')
|
setPickedAudioFormat('')
|
||||||
}}>
|
}}>
|
||||||
{downloadFormats.best.format_note || downloadFormats.best.format_id} - {downloadFormats.best.vcodec}+{downloadFormats.best.acodec}
|
{downloadFormats.best.format_note || downloadFormats.best.format_id} - {downloadFormats.best.vcodec}+{downloadFormats.best.acodec}
|
||||||
|
({downloadFormats.best.resolution}{(downloadFormats.best.filesize_approx>0)?", ~"+Math.round(downloadFormats.best.filesize_approx/1024/1024)+" MiB":""})
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
{/* video only */}
|
{/* video only */}
|
||||||
@@ -411,6 +412,7 @@ export default function Home({ socket }: Props) {
|
|||||||
disabled={pickedVideoFormat === format.format_id}
|
disabled={pickedVideoFormat === format.format_id}
|
||||||
>
|
>
|
||||||
{format.format_note} - {format.vcodec === 'none' ? format.acodec : format.vcodec}
|
{format.format_note} - {format.vcodec === 'none' ? format.acodec : format.vcodec}
|
||||||
|
({format.resolution}{(format.filesize_approx>0)?", ~"+Math.round(format.filesize_approx/1024/1024)+" MiB":""})
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
))
|
))
|
||||||
@@ -436,6 +438,7 @@ export default function Home({ socket }: Props) {
|
|||||||
disabled={pickedAudioFormat === format.format_id}
|
disabled={pickedAudioFormat === format.format_id}
|
||||||
>
|
>
|
||||||
{format.format_note} - {format.vcodec === 'none' ? format.acodec : format.vcodec}
|
{format.format_note} - {format.vcodec === 'none' ? format.acodec : format.vcodec}
|
||||||
|
{(format.filesize_approx>0)?" (~"+Math.round(format.filesize_approx/1024/1024)+" MiB)":""}
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
))
|
))
|
||||||
|
|||||||
1
frontend/src/types.d.ts
vendored
1
frontend/src/types.d.ts
vendored
@@ -59,4 +59,5 @@ export interface IDLFormat {
|
|||||||
resolution: string,
|
resolution: string,
|
||||||
vcodec: string,
|
vcodec: string,
|
||||||
acodec: string,
|
acodec: string,
|
||||||
|
filesize_approx: number,
|
||||||
}
|
}
|
||||||
@@ -36,6 +36,7 @@ type Format struct {
|
|||||||
Resolution string `json:"resolution"`
|
Resolution string `json:"resolution"`
|
||||||
VCodec string `json:"vcodec"`
|
VCodec string `json:"vcodec"`
|
||||||
ACodec string `json:"acodec"`
|
ACodec string `json:"acodec"`
|
||||||
|
Size float32 `json:"filesize_approx"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// struct representing the response sent to the client
|
// struct representing the response sent to the client
|
||||||
|
|||||||
Reference in New Issue
Block a user