Jellyfin plugin search #144380
Jellyfin plugin search
#144380
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Product Feedback
GitHub Feature Area
Actions
Body
Can anyone help me with this to get added to Jellyfin
T
o implement a feature like this in Jellyfin, which allows users to paste a list of titles and then searches for matches within the Jellyfin library, you would need to combine a few key components:
User Interface (UI) for Title Input
• Based on the screenshot, we can create a simple HTML form with a textarea where users can paste a list of titles, one per line, and a “Find Titles” button to initiate the search.
• This can be implemented in the plugin’s ConfigurationPage.html.
Backend Search Logic
• When the user submits the list, the plugin would need to parse each line and search for matching titles in Jellyfin’s media library.
• For each title, the plugin can use Jellyfin’s API or directly interact with Jellyfin’s ILibraryManager to search the library for movies or episodes that match the titles in the list.
• Alternatively, if a title doesn’t exist in the local Jellyfin library, the plugin could query external databases (like TheTVDB or TVMaze) to get metadata or notify the user of missing titles.
External Metadata Search (Optional)
• If you want the plugin to look up missing titles on external databases like TheTVDB or TVMaze, you would need to integrate with those APIs.
• For example, if a title (like “Thor: Ragnarok” or “Avengers: Endgame”) isn’t found in Jellyfin, the plugin could query TheTVDB or TVMaze for additional information about that title.
Creating or Organizing Collections in Jellyfin
• Once titles are found in the Jellyfin library, the plugin could organize them into a new collection (e.g., “Marvel Movies Collection” based on your example).
• This can be done by adding matched items to a new or existing collection within Jellyfin.
Sample Plugin Workflow Outline
Here’s a basic overview of how the plugin could work:
1. UI Interaction:
• User pastes titles into the input area and clicks “Find Titles.”
• The list of titles is sent to the plugin backend.
2. Title Parsing and Search:
• The plugin splits the list by line and processes each title individually.
• For each title, it searches the Jellyfin library to find matches.
3. Metadata Lookup (if title is missing):
• If a title isn’t found in Jellyfin, the plugin can optionally query TheTVDB or TVMaze for details.
• If a match is found on an external database, the plugin could display metadata or prompt the user to add the title to their library.
4. Organize Collection:
• The plugin organizes all matched titles into a collection or provides feedback to the user on any titles not found.
Example Code for Search and Organizing
Here’s a high-level example of how you might implement the search function in C# within the plugin:
public class TitleSearchService
{
private readonly ILibraryManager _libraryManager;
}
Integration with TheTVDB or TVMaze (for Missing Titles)
You would need API keys and follow the specific API documentation for each service (TheTVDB or TVMaze) to search for metadata when a title isn’t found in Jellyfin.
Here’s a rough example of querying an external API for a missing title:
public async Task SearchExternalDatabase(string title)
{
// Example: Fetch data from TVMaze
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Accept", "application/json");
var response = await client.GetAsync($"https://api.tvmaze.com/singlesearch/shows?q={title}");
}
Steps for Publishing
This approach will provide an efficient way to match titles within Jellyfin and create organized collections, with the option to extend the plugin to look up external metadata if desired. Let me know if you’d like further guidance on any part of this!
Beta Was this translation helpful? Give feedback.
All reactions