-
-
Notifications
You must be signed in to change notification settings - Fork 61
bandwidth based quality selection #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,10 @@ tabs[SettingsTabs.OPTIONS] = (props: SettingsProps) => ( | |
| item: SettingsTabs.TRACKS, | ||
| label: props.data.getTranslation('Quality'), | ||
| info: `${ | ||
| props.data.activeTrack ? props.data.activeTrack.width : '' | ||
| props.data.activeTrack ? | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nested condition shorthands are a bit confusing, could this be better structured?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as i already mentioned in a earlier reply, i'm not very familiar with TS or JS. if it would be python or rust code, i would definitely choose the most pleasant and idiomatic expression, but on the java script side i'm unfortunately hardly able to keep my head above water. ;) if you don't mind, i would prefer, that you simply modify the suggested changes to the better. i know, it's a little bit of annoying work, but at the end it's definitely better to keep the code base clean and in exemplary style, which i'm simply not capable to serve in this particular programming language without spending huge amounts of time to study and learn the most basic expressive possibilities. |
||
| (props.data.activeTrack.width ? | ||
| (""+props.data.activeTrack.width+"x"+props.data.activeTrack.height+", "):"") | ||
| +(props.data.activeTrack.bandwidth/1e6).toPrecision(2)+"M" : '' | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a big fan of this line, ES6 template literals would be a cleaner approach imo. |
||
| }`, | ||
| }, | ||
| props.data.visibleSettingsTabs.includes(SettingsTabs.SUBTITLES) && { | ||
|
|
@@ -55,7 +58,8 @@ tabs[SettingsTabs.TRACKS] = (props: SettingsProps) => ( | |
| items={[ | ||
| ...props.data.tracks.map(track => ({ | ||
| item: track, | ||
| label: `${track.width}`, | ||
| label: `${(track.width?(""+track.width+"x"+track.height+", "):"") | ||
| +(track.bandwidth/1e6).toPrecision(2)+"M"}`, | ||
| })), | ||
| { | ||
| item: 'auto', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we can drop the uniqBy filter above, as this would select "bandwidth" to group by.