Skip to content

Search filter for videos within a channel #12167

@Angelk90

Description

@Angelk90

Checklist

  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have read the FAQ and my problem isn't listed.
  • I'm aware that this is a request for NewPipe itself and that requests for adding a new service need to be made at NewPipeExtractor.
  • I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise.
  • This issue contains only one feature request.
  • I have read and understood the contribution guidelines.

Feature description

I am inside a channel, but I want to search for videos on that channel with specific terms in the title, without having to do a generate search and check if that video is from that channel or not.

This filter would not add http calls, but would only filter videos that do not contain those terms in the title.
So having two variables, items remains with all possible videos, filteredItems, instead if there is a search term it applies the filter.

Why do you want this feature?

Ability to search within a video channel with specific title terms.

Additional information

Example code:

data class VideoItem(val id: Int, val name: String, val url: String)

fun filterItems(items: List<VideoItem>, searchTerm: String): List<VideoItem> {
    return items.filter { it.name.contains(searchTerm, ignoreCase = true) }
}

fun main() {
    val items = listOf(
        VideoItem(1, "Video 1", "https://example.com/video1"),
        VideoItem(2, "Video 2", "https://example.com/video2"),
        VideoItem(3, "Tutorial", "https://example.com/tutorial"),
        VideoItem(4, "Demo", "https://example.com/demo")
    )

    val search = "video"
    val filteredItems = if (search.isNotEmpty()) filterItems(items, search) else items

    filteredItems.forEach { println(it) }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssue or discussion is a duplicate of an existing issue or discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions