Skip to content
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

[Feature Request]: Sort playlists #48

Closed
2 tasks done
PikachuEXE opened this issue Aug 22, 2023 · 19 comments
Closed
2 tasks done

[Feature Request]: Sort playlists #48

PikachuEXE opened this issue Aug 22, 2023 · 19 comments
Labels
enhancement New feature or request

Comments

@PikachuEXE
Copy link
Owner

Guidelines

  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.
  • I have searched the documentation for information that matches the description of the feature request I want to file, without success.

Problem Description

Cannot sort playlist in playlists view

Proposed Solution

Add sort dropdown in playlists view

  • A-Z
  • Z-A
  • Earliest created first
  • Latest created first
  • Earliest updated first
  • Latest updated first (default)

Alternatives Considered

image

Issue Labels

improvement to existing feature

Additional Information

No response

@PikachuEXE PikachuEXE added the enhancement New feature or request label Aug 22, 2023
@PikachuEXE
Copy link
Owner Author

Implemented in d1a2e90

@efb4f5ff-1298-471a-8973-3d47447115dc help me test~

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Collaborator

Filter is visible when the user only has one playlist. Not very usefull to the user to show it if they cant use it. I would suggest showing the filter when user has more than 1 playlist

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Collaborator

Just created 3 playlist to set a baseline for the filters

  • A-Z Linus,PSU,Tablet
  • Z-A Tablet,PSU,Linus
  • LC Tablet,PSU,Linus
  • EC Linus,PSU,Tablet
  • LU Tablet,PSU,Linus
  • EU Linus,PSU,Tablet
VirtualBoxVM_8Pq9eSkNar.mp4

Changed playlist name

  • A-Z Linus,PSU,Tablet
  • Z-A Tablet,PSU,Linus
  • LC Linus,PSU,Tablet
  • EC Linus,PSU,Tablet
  • LU Tablet,PSU,Linus
  • EU Linus,PSU,Tablet

LC changed even though this has nothing to do with LC

VirtualBoxVM_HkctpmyIy0.mp4

Removing a video in the playlist does not give it the first spot when sorted by latest updated

VirtualBoxVM_XeWVkMEcoD.mp4

@PikachuEXE
Copy link
Owner Author

You makes me find a bug where the updates to playlists are not partial (but complete replace) when updating playlists
Which causes the created time to be absent later (in same window and DB)

Now should be all fixed

Details for nedb partial update op:
$set need to be used for simple documents as partial updates
I put the following code into https://npm.runkit.com/%40seald-io%2Fnedb to test:

const Datastore = require("@seald-io/nedb")
const db = new Datastore()

await db.insertAsync({ _id: 1, videos: [], name: "111", lastUpdatedAt: 9999 })
console.log(await db.findAsync({ _id: 1 }))

await db.updateAsync({ _id: 1 }, { $set: { lastUpdatedAt: 8888 } }, { upsert: true })
console.log(await db.findAsync({ _id: 1 }))

await db.updateAsync({ _id: 2 }, { $set: { lastUpdatedAt: 8888 } }, { upsert: true })
console.log(await db.findAsync({ _id: 2 }))

await db.updateAsync({ _id: 1 }, { lastUpdatedAt: 8888 }, { upsert: true })
console.log(await db.findAsync({ _id: 1 }))

await db.updateAsync({ _id: 1 }, { _id: 1, lastUpdatedAt: 8888 }, { upsert: true })
console.log(await db.findAsync({ _id: 1 }))

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Collaborator

Sorry for taking so long. That bug is indeed solved now.

Random thought would be a nice to have to see the filters in the playlist view and maybe in add to playlist view

@PikachuEXE
Copy link
Owner Author

PikachuEXE commented Aug 29, 2023

Forgot, see 69406b2 which changed logic for filter input AND sort select

Recently Created/Updated? (But what about Earliest...

would be a nice to have to see the filters in the playlist view and maybe in add to playlist view

You mean... add filter in "add to playlist view"?
Edit: Wait there is a filter in "add to playlist view"
Edit 2: Do you mean sorting...?

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Collaborator

Forgot, see 69406b2 which changed logic for filter input AND sort select

LGTM

Recently Created/Updated? (But what about Earliest...

Recently Updated sounds better to me. Ugh idk what to do about earliest...

would be a nice to have to see the filters in the playlist view and maybe in add to playlist view

You mean... add filter in "add to playlist view"? Edit: Wait there is a filter in "add to playlist view" Edit 2: Do you mean sorting...?

Sorry for the confusion. It would be nice to also see the sort by in the following views

VirtualBoxVM_dEdHQWnxII.mp4

@PikachuEXE
Copy link
Owner Author

(Not this issue related)
Also I just merged development into playlist branch
4b21e75

Let me know if you find any regression (I hope not

@PikachuEXE
Copy link
Owner Author

Add playlists sort order for last played at (local playlists only)
New sort order used as default

@PikachuEXE PikachuEXE added this to the Local Playlist v1 milestone Sep 5, 2023
@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Collaborator

Will come back to this later today this will take me a bit longer to test!

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Collaborator

Add playlists sort order for last played at (local playlists only) New sort order used as default

i think u meant to link bdd002a

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Collaborator

efb4f5ff-1298-471a-8973-3d47447115dc commented Sep 6, 2023

LGTM

LGTM

Everything seems to be sorted correctly so LGTM

LGTM

Add playlists sort order for last played at (local playlists only) New sort order used as default

LGTM

(Not this issue related) Also I just merged development into playlist branch 4b21e75

Let me know if you find any regression (I hope not

I do not see anything weird so LGTM but if i do i'll let u know!

Could u also add the sort by dropdown when u go into one of your local playlist
I dont think most of the filters would fit on that page

the ones that will fit are

  • A-Z (Video title)
  • Z-A (Video title)
  • A-Z (Channel name)
  • Z-A (Channel name)
  • Custom (Custom sorting will be set when user moves a video up/down in the list)
  • Sorting by upload date of video (Recently uploaded / Earliest uploaded)
  • Sort by views (Most viewed / Least Viewed)
  • Sort by video length (Shortest somthing? / Longest somthing)
  • Sort by Recently added / Earliest added

@PikachuEXE
Copy link
Owner Author

I rather do it in v2...
Plus this is about sorting videos in playlist not sorting playlistssss

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Collaborator

I rather do it in v2... Plus this is about sorting videos in playlist not sorting playlistssss

I think u mean the opposite. Im requesting sorting videos in playlist but this feature request is about sorting playlists. You're right that this isnt the right place to ask for it but im going to push back a little because i think that this is a very valuable thing to add in v1

@PikachuEXE
Copy link
Owner Author

Plus this is about sorting videos in playlist not sorting playlistssss

For this I mean your request lol

I understand it's valuable but I don't guarantee implementing it in v1 and probably not in initial PR (nice to have, won't upset user too much if absent things)

Anyway, put that into another issue

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Collaborator

Sure, Everything in here LGTM so closing

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Collaborator

Oh lol this is your issue cant close

@PikachuEXE
Copy link
Owner Author

Oops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants