n-ce / ytify

Opus Audio Streaming Web App for YouTube. Stop watching, Listen & Save Data.
https://ytify.netlify.app
GNU General Public License v3.0
145 stars 48 forks source link

Search sorting by time #130

Closed n-ce closed 10 months ago

n-ce commented 10 months ago

This is a feature I personally want, which includes sorting the results by time uploaded.

What I have in mind is , not to populate superInput for this but instead have it near the bottom of the search as a floating menu, something like what unsplash has implemented. If it makes sense we could also move the search filters to the bottom menu to make proper use of the space. Screenshot_20230929-193944_Chrome

n-ce commented 10 months ago

Linking Relevant Issues & PR https://github.com/TeamPiped/Piped/issues/1376 https://github.com/TeamNewPipe/NewPipe/issues/2251 https://github.com/TeamNewPipe/NewPipeExtractor/pull/904

Till the above PR is merged and the api is exposed for the same, we'll have to use a post-search-filteration process of the default results. This can be done in either of two ways :

Sorting the API results would be more efficient and less complex. On the UI side of things we can use a toggleSwitch to toggle sort. we can use the checked attribute of the element to sort within an if statement , inside searchLoader https://github.com/n-ce/ytify/blob/9c678caca169a052d1cb2763284e331439c4f59b/src/scripts/search.ts#L34-L44

we might also simulate few loadMore clicks to get more results and in turn more results that are newer, also making the time differences between search results more gradual.