FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Fix #5008 : Remember Playlist "Sort By" Selection Between Sessions

Open anurag2787 opened this issue 9 months ago • 3 comments

Pull Request Type

  • [ ] Bugfix
  • [x] Feature Implementation
  • [ ] Documentation
  • [ ] Other

Related issue

closes #5008

Description

This pull request implements the ability to remember the "Sort By" selection for playlists between sessions.
Previously, sorting preferences were not retained after restarting the application.

To ensure persistence, I used localStorage instead of sessionStorage, so the selected sorting option remains even after restarting FreeTube.

Desktop

  • OS: Windows 11
  • OS Version: 24H2 (OS Build 26100.3476)
  • FreeTube version: 0.23.2

Additional context

This feature improves user experience by keeping sorting preferences saved permanently, rather than resetting after each session.

anurag2787 avatar Mar 22 '25 12:03 anurag2787

Hi @efb4f5ff-1298-471a-8973-3d47447115dc , Please Review . Thanks!

anurag2787 avatar Mar 22 '25 12:03 anurag2787

This should be in a store rather than localStorage.

MarmadileManteater avatar Mar 22 '25 15:03 MarmadileManteater

@MarmadileManteater Thank you for feedback! I noticed your suggestion to store the data in a more appropriate place instead of localStorage. Would it be better to store this data in a database?

anurag2787 avatar Mar 23 '25 00:03 anurag2787

Yes, it should be in one of the stores. FreeTube uses nedb to store its persistent data. https://github.com/FreeTubeApp/FreeTube/tree/development/src/renderer/store/modules

MarmadileManteater avatar Mar 23 '25 13:03 MarmadileManteater

Hi @efb4f5ff-1298-471a-8973-3d47447115dc @MarmadileManteater , Please Review . Thanks!

anurag2787 avatar Mar 23 '25 15:03 anurag2787