Show more information on long playlists.#7804
Conversation
|
see #7473 (comment) |
Head branch was pushed to by a user without write access
|
PR updated. |
| let seconds | ||
| let isApproximation = false | ||
|
|
||
| if (Number.isNaN(total)) { | ||
| seconds = props.videos.reduce((acc, video) => { | ||
| return typeof video.lengthSeconds === 'number' ? acc + video.lengthSeconds : acc | ||
| }, 0) | ||
| isApproximation = true | ||
| } else { | ||
| seconds = total | ||
| } |
There was a problem hiding this comment.
Please adjust the original calculation instead of duplicating the code and doing double the work.
Head branch was pushed to by a user without write access
efb4f5ff-1298-471a-8973-3d47447115dc
left a comment
There was a problem hiding this comment.
The + doesnt have to be present in the local playlist because we already copied that over from the remote ones. No need to let the user load all the pages before they find out that the total time doesnt change
VirtualBoxVM_UAjhdEo7ms.mp4
Head branch was pushed to by a user without write access
|
"+" is no longer shown in local playlists. |
efb4f5ff-1298-471a-8973-3d47447115dc
left a comment
There was a problem hiding this comment.
Functionally wise LGTM but i prefer @absidue to sign off code wise first
absidue
left a comment
There was a problem hiding this comment.
Please add some whitespace so the code is readable.
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
|
Adjusted. |
efb4f5ff-1298-471a-8973-3d47447115dc
left a comment
There was a problem hiding this comment.
LGTM
* development: (84 commits) Translated using Weblate (Chinese (Traditional Han script)) Show more information on long playlists. (FreeTubeApp#7804) Translated using Weblate (French) Refactor/cleanup tray related code after PR merged (FreeTubeApp#7856) Translated using Weblate (Estonian) Translated using Weblate (Italian) Translated using Weblate (Afrikaans) Translated using Weblate (Latvian) Translated using Weblate (Lithuanian) Translated using Weblate (Norwegian Nynorsk) Translated using Weblate (Galician) Translated using Weblate (Korean) Translated using Weblate (Slovenian) Translated using Weblate (Danish) Translated using Weblate (Kurdish) Translated using Weblate (Catalan) Translated using Weblate (Indonesian) Translated using Weblate (Greek) Translated using Weblate (Slovak) Translated using Weblate (Spanish (Mexico)) ...
* development: (25 commits) Translated using Weblate (Chinese (Traditional Han script)) Show more information on long playlists. (FreeTubeApp#7804) Translated using Weblate (French) Refactor/cleanup tray related code after PR merged (FreeTubeApp#7856) Translated using Weblate (Estonian) Translated using Weblate (Italian) Translated using Weblate (Afrikaans) Translated using Weblate (Latvian) Translated using Weblate (Lithuanian) Translated using Weblate (Norwegian Nynorsk) Translated using Weblate (Galician) Translated using Weblate (Korean) Translated using Weblate (Slovenian) Translated using Weblate (Danish) Translated using Weblate (Kurdish) Translated using Weblate (Catalan) Translated using Weblate (Indonesian) Translated using Weblate (Greek) Translated using Weblate (Slovak) Translated using Weblate (Spanish (Mexico)) ...
* Show + for long playlists * Add ~ for shorts * Refactor duration and isApproximate calculation * Remove + from local playlists * Fix code spacing Co-authored-by: absidue <48293849+absidue@users.noreply.github.com> * Fix code spacing --------- Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
Pull Request Type
Related issue
Closes #7473
Description
When a playlist still does not have all videos loaded, a "+" is added to the end of the displayed duration.
[Edit Aug, 13th: '~' added for playlists with shorts.]
Screenshots
Testing
For long playlists
For shorts
Desktop