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

Implement Plex Search in program selector #210

Merged
merged 7 commits into from
Mar 28, 2024
Merged

Implement Plex Search in program selector #210

merged 7 commits into from
Mar 28, 2024

Conversation

chrisbenincasa
Copy link
Owner

@chrisbenincasa chrisbenincasa commented Mar 25, 2024

This change is the first cut of implementing 'full' Plex search in the program selector UI

Features include:

  1. Dynamically pulling in available filter fields and values based on the currently selected Plex server and library
  2. Basic / Advanced search -- basic search is a single field (e.g. 'title contains "XYZ"') while advanced search can have nested boolean logic over a variable amount of fields
  3. Autocomplete component for 'tag' type fields (e.g. actors, directors) and a date-picker field for date-type fields
  4. Sort capability, also powered dynamically via the current Plex server

Some things that aren't implemented yet:

  1. Validation of the search query -- this probably won't be too difficult. We need to check things like valid query structure in advanced mode (empty operator nodes) and other basic things
  2. Haven't fully implemented specific input types for all field types (e.g. numeric fields, relative time fields like "greater than 2h", etc). I would like to do these before merge.
  3. I haven't yet tested this on a TV show library, but will do that before merge
  4. There is no backend integration here - filtering/sorting only exists in the program selector for now
  5. The code is a little messy
  6. I also haven't done much deep thought about the UI here, instead I pretty much replicated the way Plex present these options.
    a. one idea to make this a bit simpler could be to allow multiple values per-input and then give the user a way to toggle how the values are related. For instance, a single input on field 'Actor' with multiple actors chosen (they appear as chips) and a toggle between "AND" / "OR"ing the values together.
  7. Error and loading states

For the future, I hope that this same code will be used to power one type of 'dynamic' channels. We could have the user use the new capabilities to construct a Plex query that is used to pull channel content, with regular updates executing the query and scheduling out fresh content (perhaps daily).

Screenshots:
Screenshot from 2024-03-25 16-15-55
Screenshot from 2024-03-25 16-16-11
Screenshot from 2024-03-25 16-16-39

@chrisbenincasa chrisbenincasa self-assigned this Mar 25, 2024
@chrisbenincasa chrisbenincasa linked an issue Mar 26, 2024 that may be closed by this pull request
* Hooked up form to local state and have it triggering search updates
* Need to still confirm that the different operators are working
  correctly
* Lots of updates left for the different form types, like the date
  picker
* Autocomplete working sorta...loading tag values from Plex
1. Tooltips for the different buttons
2. Ability to remove groups
3. Hookup and/or operator nodes to the overall form
4. Some stylistic fixes
1. Hooked up the filtering feature to the actual program selector UI
2. Implement sorting
3. Differentiation between basic/advanced search types (Basic is a
   single value field while advanced supports boolean operators)
4. Some hideous UI for all of this

Still TODO:
* Caching? Unclear whether this is worth it
* Auto-search when values change based on a timeout -- current flow
  requires a button press which is sort of annoying
* Clear search value button (button on each input to clear the value)
* Validation of search parameters / fields
@chrisbenincasa chrisbenincasa marked this pull request as ready for review March 28, 2024 17:16
@chrisbenincasa chrisbenincasa merged commit 0069184 into main Mar 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Full Plex search
1 participant