diff --git a/Directory.Build.props b/Directory.Build.props index 2cde674..b02f91e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 1.0.0.4 - 1.0.0.4 - 1.0.0.4 + 1.0.0.5 + 1.0.0.5 + 1.0.0.5 diff --git a/Jellyfin.Plugin.Request/Configuration/configPage.html b/Jellyfin.Plugin.Request/Configuration/configPage.html index 0b934b9..a291c98 100644 --- a/Jellyfin.Plugin.Request/Configuration/configPage.html +++ b/Jellyfin.Plugin.Request/Configuration/configPage.html @@ -13,10 +13,12 @@
- +
- Create a free key at themoviedb.org. Stored server-side only; never sent to browsers by plugin APIs. + From TMDB API settings: + paste either the v3 API Key or the API Read Access Token (Bearer). + Stored server-side only. Docs: Getting Started.
+

@@ -135,6 +136,7 @@ globalMessage: root.querySelector('[data-role="global-message"]'), searchInput: root.querySelector('[data-role="search-input"]'), searchBtn: root.querySelector('[data-role="search-btn"]'), + searchMeta: root.querySelector('[data-role="search-meta"]'), results: root.querySelector('[data-role="results"]'), detail: root.querySelector('[data-role="detail"]'), mineList: root.querySelector('[data-role="mine-list"]'), @@ -198,35 +200,69 @@ } } + function setSearchMeta(text) { + if (!els.searchMeta) { + return; + } + + els.searchMeta.textContent = text || ""; + els.searchMeta.classList.toggle("req-hidden", !text); + } + async function runSearch() { const query = els.searchInput.value.trim(); if (!query) { showMessage("Enter a search query.", true); + setSearchMeta(""); return; } - showMessage("Searching…"); + if (state.status && !state.status.isConfigured) { + showMessage("TMDB is not configured. Set a TMDB API key or Read Access Token in Dashboard → Plugins → Request.", true); + return; + } + + showMessage(""); + setSearchMeta(`Searching TMDB for “${query}”…`); + els.searchBtn.disabled = true; els.detail.classList.add("req-hidden"); els.results.classList.remove("req-hidden"); + els.results.innerHTML = ""; try { const results = await api(`/Search?query=${encodeURIComponent(query)}&type=${encodeURIComponent(state.mediaType)}`); - showMessage(results.length ? "" : "No results found."); - renderResults(results); + const list = Array.isArray(results) ? results : []; + setSearchMeta(list.length + ? `Showing ${list.length} result${list.length === 1 ? "" : "s"} for “${query}”` + : `No TMDB results for “${query}”`); + showMessage(list.length ? "" : "No movies or TV shows matched that search."); + renderResults(list); } catch (error) { + setSearchMeta(`Search failed for “${query}”`); showMessage(error.message, true); els.results.innerHTML = ""; + } finally { + els.searchBtn.disabled = false; } } function renderResults(results) { + if (!results.length) { + els.results.innerHTML = ""; + return; + } + els.results.innerHTML = results.map((item) => { - const img = item.posterUrl || posterUrl(item.posterPath); + const mediaType = item.mediaType || item.MediaType || ""; + const tmdbId = item.tmdbId ?? item.TmdbId; + const title = item.title || item.Title || "Untitled"; + const year = item.year ?? item.Year; + const img = item.posterUrl || item.PosterUrl || posterUrl(item.posterPath || item.PosterPath); return ` -
- ${img ? `` : `

No poster

`} +
+ ${img ? `${escapeHtml(title)}` : `

No poster

`}
-

${escapeHtml(item.title)}

-

${escapeHtml(item.mediaType)}${item.year ? ` · ${item.year}` : ""}

+

${escapeHtml(title)}

+

${escapeHtml(mediaType)}${year ? ` · ${escapeHtml(year)}` : ""}

`; }).join(""); diff --git a/README.md b/README.md index ea9f7e1..911f9af 100644 --- a/README.md +++ b/README.md @@ -24,14 +24,14 @@ https://www.iamparadox.dev/jellyfin/plugins/manifest.json ``` 4. From **Catalog**, install **File Transformation**, then install **Request**, then restart Jellyfin. -5. Configure under **Dashboard → Plugins → Request** (TMDB API key + enable submissions). +5. Configure under **Dashboard → Plugins → Request** (TMDB v3 API key or API Read Access Token + enable submissions). 6. Hard-refresh the browser (Ctrl+F5). You should see a **Request** tab next to Home/Favorites that shows the request UI under the same top bar (no full-page navigation). ## Requirements - Jellyfin Server **10.11.x** - .NET SDK **9+** to build from source -- A free [TMDB API key](https://www.themoviedb.org/settings/api) +- A free [TMDB API key or Read Access Token](https://www.themoviedb.org/settings/api) ([docs](https://developer.themoviedb.org/docs/getting-started)) ## Build / package a release @@ -83,7 +83,7 @@ Authenticated Jellyfin users call plugin endpoints under `/Requests`: | POST | `/Requests/{id}/fulfill` | Admin | | DELETE | `/Requests/{id}` | Admin, or owner while Pending | -The TMDB API key stays on the server. Browsers never receive it. +The TMDB credential stays on the server. Browsers never receive it. ## Data storage diff --git a/build.yaml b/build.yaml index e3b8eb8..19ed880 100644 --- a/build.yaml +++ b/build.yaml @@ -1,7 +1,7 @@ --- name: "Request" guid: "11c08950-c4bb-484d-89ff-205b3724416b" -version: "1.0.0.4" +version: "1.0.0.5" targetAbi: "10.11.11.0" framework: "net9.0" overview: "Request movies and TV shows from a local admin review queue" diff --git a/manifest.json b/manifest.json index af93ead..10669f7 100644 --- a/manifest.json +++ b/manifest.json @@ -9,12 +9,12 @@ "repositoryUrl": "https://git.masengr.com/Michael-A-Sloan/Jellyfin_Request_tvandmovies", "versions": [ { - "version": "1.0.0.4", - "changelog": "Fix blank Request tab by syncing panel visibility and blocking Jellyfin HomeView tab handlers", + "version": "1.0.0.5", + "changelog": "TMDB search: support API key or Read Access Token, clearer results and errors", "targetAbi": "10.11.11.0", - "sourceUrl": "https://git.masengr.com/Michael-A-Sloan/Jellyfin_Request_tvandmovies/raw/branch/main/release/Jellyfin.Plugin.Request_1.0.0.4.zip", - "checksum": "5A31B38274F40F3AF3DE0240D2319C1E", - "timestamp": "2026-08-02T21:03:57.4534409Z", + "sourceUrl": "https://git.masengr.com/Michael-A-Sloan/Jellyfin_Request_tvandmovies/raw/branch/main/release/Jellyfin.Plugin.Request_1.0.0.5.zip", + "checksum": "0CDC1AF943448041BED74990E53174A8", + "timestamp": "2026-08-02T21:05:32.0804687Z", "dependencies": [] } ] diff --git a/release/Jellyfin.Plugin.Request_1.0.0.5.zip b/release/Jellyfin.Plugin.Request_1.0.0.5.zip new file mode 100644 index 0000000..83080d7 Binary files /dev/null and b/release/Jellyfin.Plugin.Request_1.0.0.5.zip differ diff --git a/scripts/package-release.ps1 b/scripts/package-release.ps1 index 7f32a85..132a5d8 100644 --- a/scripts/package-release.ps1 +++ b/scripts/package-release.ps1 @@ -1,5 +1,5 @@ param( - [string]$Version = "1.0.0.4", + [string]$Version = "1.0.0.5", [string]$TargetAbi = "10.11.11.0", [string]$RepoRawBase = "https://git.masengr.com/Michael-A-Sloan/Jellyfin_Request_tvandmovies/raw/branch/main" ) @@ -17,7 +17,7 @@ $dllPath = Join-Path $root "Jellyfin.Plugin.Request\bin\Release\net9.0\Jellyfin. $zipPath = Join-Path $releaseDir $zipFileName $manifestPath = Join-Path $root "manifest.json" $timestamp = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ") -$changelog = "Fix blank Request tab by syncing panel visibility and blocking Jellyfin HomeView tab handlers" +$changelog = "TMDB search: support API key or Read Access Token, clearer results and errors" Write-Host "Building plugin..." dotnet build (Join-Path $root "Jellyfin.Plugin.Request.sln") -c Release