feat(repo): add request plugin with jellyfin catalog manifest
Ship the plugin sources, release zip, and SeerrFin-style manifest.json so Jellyfin can install from the Gitea raw repository URL. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
3a1960d860
commit
bf6cd4540f
30 files changed
+3096
No files matched your search
@@ -0,0 +1,53 @@
|
||||
param(
|
||||
[string]$IndexPath = ""
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$loaderSrc = "/Requests/Assets/nav-loader.js"
|
||||
$markerStart = "<!-- jellyfin-plugin-request-nav-start -->"
|
||||
$markerEnd = "<!-- jellyfin-plugin-request-nav-end -->"
|
||||
|
||||
if (-not $IndexPath) {
|
||||
$candidates = @(
|
||||
(Join-Path $env:LOCALAPPDATA "jellyfin\jellyfin-web\index.html"),
|
||||
"C:\Program Files\Jellyfin\Server\jellyfin-web\index.html",
|
||||
"C:\ProgramData\Jellyfin\Server\jellyfin-web\index.html"
|
||||
)
|
||||
foreach ($candidate in $candidates) {
|
||||
if (Test-Path $candidate) {
|
||||
$IndexPath = $candidate
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $IndexPath -or -not (Test-Path $IndexPath)) {
|
||||
Write-Error "Could not find jellyfin-web index.html. Pass -IndexPath explicitly."
|
||||
}
|
||||
|
||||
$html = Get-Content -Raw -Path $IndexPath
|
||||
if ($html -like "*$loaderSrc*") {
|
||||
Write-Host "Request web loader is already installed in $IndexPath"
|
||||
exit 0
|
||||
}
|
||||
|
||||
$backupPath = "$IndexPath.bak.request.$(Get-Date -Format 'yyyyMMddHHmmss')"
|
||||
Copy-Item -Path $IndexPath -Destination $backupPath
|
||||
|
||||
$block = @"
|
||||
$markerStart
|
||||
<script src="$loaderSrc" defer></script>
|
||||
$markerEnd
|
||||
"@
|
||||
|
||||
if ($html -match '(?i)</body>') {
|
||||
$updated = [regex]::Replace($html, '(?i)</body>', ($block + "`r`n</body>"), 1)
|
||||
} else {
|
||||
$updated = $html + "`r`n" + $block + "`r`n"
|
||||
}
|
||||
|
||||
Set-Content -Path $IndexPath -Value $updated -NoNewline
|
||||
Write-Host "Installed Request web loader in $IndexPath"
|
||||
Write-Host "Backup saved to $backupPath"
|
||||
Write-Host "Restart Jellyfin, then hard refresh the browser."
|
||||
Reference in new issue
Block a user