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

Search sorting by time #130

Closed
n-ce opened this issue Sep 29, 2023 · 1 comment · Fixed by #135
Closed

Search sorting by time #130

n-ce opened this issue Sep 29, 2023 · 1 comment · Fixed by #135
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@n-ce
Copy link
Owner

n-ce commented Sep 29, 2023

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 n-ce added the enhancement New feature or request label Sep 29, 2023
@n-ce
Copy link
Owner Author

n-ce commented Oct 4, 2023

Linking Relevant Issues & PR
TeamPiped/Piped#1376
TeamNewPipe/NewPipe#2251
TeamNewPipe/NewPipeExtractor#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 :

  • Sort the UI results
  • Sort the API results

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

fetch(pipedInstances.value + '/search?q=' + text + '&filter=' + searchFilters.value)
.then(res => res.json())
.then(searchResults => {
token = searchResults.nextpage;
loadMoreBtn.style.display = 'block';
searchlist.appendChild(
itemsLoader(
searchResults.items
)
)
})

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.

@n-ce n-ce added the good first issue Good for newcomers label Oct 4, 2023
n-ce added a commit that referenced this issue Oct 5, 2023
@n-ce n-ce closed this as completed in #135 Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant