Skip to content

Show more information on long playlists.#7804

Merged
FreeTubeBot merged 6 commits into
FreeTubeApp:developmentfrom
caetano-dev:enhancePlaylistDuration
Aug 24, 2025
Merged

Show more information on long playlists.#7804
FreeTubeBot merged 6 commits into
FreeTubeApp:developmentfrom
caetano-dev:enhancePlaylistDuration

Conversation

@caetano-dev

@caetano-dev caetano-dev commented Aug 9, 2025

Copy link
Copy Markdown
Contributor

Pull Request Type

  • Feature Implementation

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

b Capture d’écran 2025-08-13 à 10 28 55

Testing

For long playlists

  1. Open a long playlist. (https://youtube.com/playlist?list=PL8mG-RkN2uTw7PhlnAr4pZZz2QubIbujH)
  2. See that there is a + at the end of its duration.
  3. Scroll down and load all videos.
  4. Duration is updated. No "+" is shown.

For shorts

  1. Open a playlist with shorts and normal videos
  2. See that the playlist shows ~ before the duration

Desktop

  • OS: Linux
  • OS Version: Ubuntu 24
  • FreeTube version: 0.23.6 Beta

@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 9, 2025
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) August 9, 2025 14:59
@efb4f5ff-1298-471a-8973-3d47447115dc

Copy link
Copy Markdown
Member

see #7473 (comment)

auto-merge was automatically disabled August 13, 2025 13:30

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) August 13, 2025 13:30
@caetano-dev

caetano-dev commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

PR updated.
I also edited the description.

Comment on lines +378 to +388
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
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adjust the original calculation instead of duplicating the code and doing double the work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted

auto-merge was automatically disabled August 13, 2025 17:37

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) August 13, 2025 17:37

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Aug 17, 2025
auto-merge was automatically disabled August 17, 2025 15:49

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) August 17, 2025 15:49
@caetano-dev

caetano-dev commented Aug 17, 2025

Copy link
Copy Markdown
Contributor Author

"+" is no longer shown in local playlists.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally wise LGTM but i prefer @absidue to sign off code wise first

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Aug 17, 2025

@absidue absidue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some whitespace so the code is readable.

Comment thread src/renderer/components/PlaylistInfo/PlaylistInfo.vue
Comment thread src/renderer/components/PlaylistInfo/PlaylistInfo.vue
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
auto-merge was automatically disabled August 17, 2025 22:56

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) August 17, 2025 22:56
auto-merge was automatically disabled August 17, 2025 23:01

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) August 17, 2025 23:01
@caetano-dev

Copy link
Copy Markdown
Contributor Author

Adjusted.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@FreeTubeBot FreeTubeBot merged commit 2ef9d1a into FreeTubeApp:development Aug 24, 2025
6 checks passed
@github-actions github-actions Bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 24, 2025
PikachuEXE added a commit to NishPatel101/FreeTube that referenced this pull request Aug 25, 2025
* 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))
  ...
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Aug 25, 2025
* 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))
  ...
caetano-dev added a commit to caetano-dev/FreeTube that referenced this pull request Sep 17, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Enhance playlist duration implementation

5 participants