fix(nav): inject request tab via file transformation
Register with IAmParadox File Transformation so the Request tab works when jellyfin-web is read-only (Docker/Unraid). Keep disk patch as fallback. Publish 1.0.0.2. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
4531603d08
commit
57798d30e8
11 files changed
+174
-55
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>1.0.0.1</Version>
|
<Version>1.0.0.2</Version>
|
||||||
<AssemblyVersion>1.0.0.1</AssemblyVersion>
|
<AssemblyVersion>1.0.0.2</AssemblyVersion>
|
||||||
<FileVersion>1.0.0.1</FileVersion>
|
<FileVersion>1.0.0.2</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace Jellyfin.Plugin.Request.Hosting;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Payload shape expected by the File Transformation callback.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class IndexHtmlPatchPayload
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the current file contents.
|
||||||
|
/// </summary>
|
||||||
|
public string Contents { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
@@ -1,24 +1,31 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.Loader;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Controller;
|
using MediaBrowser.Controller;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.Request.Hosting;
|
namespace Jellyfin.Plugin.Request.Hosting;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ensures jellyfin-web index.html loads the Request nav loader script.
|
/// Injects the Request nav loader into jellyfin-web.
|
||||||
|
/// Prefers File Transformation (safe on Docker/Unraid); falls back to patching index.html on disk.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class WebNavInjector : IHostedService
|
public sealed class WebNavInjector : IHostedService
|
||||||
{
|
{
|
||||||
private const string LoaderSrc = "/Requests/Assets/nav-loader.js";
|
private const string LoaderSrc = "/Requests/Assets/nav-loader.js";
|
||||||
private const string MarkerStart = "<!-- jellyfin-plugin-request-nav-start -->";
|
private const string MarkerStart = "<!-- jellyfin-plugin-request-nav-start -->";
|
||||||
private const string MarkerEnd = "<!-- jellyfin-plugin-request-nav-end -->";
|
private const string MarkerEnd = "<!-- jellyfin-plugin-request-nav-end -->";
|
||||||
|
private static readonly Guid TransformationId = Guid.Parse("11c08950-c4bb-484d-89ff-205b3724416b");
|
||||||
|
|
||||||
private readonly IServerApplicationPaths _applicationPaths;
|
private readonly IServerApplicationPaths _applicationPaths;
|
||||||
private readonly ILogger<WebNavInjector> _logger;
|
private readonly ILogger<WebNavInjector> _logger;
|
||||||
|
private CancellationTokenSource? _retryCts;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="WebNavInjector"/> class.
|
/// Initializes a new instance of the <see cref="WebNavInjector"/> class.
|
||||||
@@ -34,27 +41,127 @@ public sealed class WebNavInjector : IHostedService
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Task StartAsync(CancellationToken cancellationToken)
|
public Task StartAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
if (TryRegisterFileTransformation())
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Request nav loader registered with File Transformation for index.html.");
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
_logger.LogWarning(
|
||||||
|
"File Transformation plugin was not found. Install it from https://www.iamparadox.dev/jellyfin/plugins/manifest.json for reliable Request tab injection. Falling back to disk patch.");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
TryInject();
|
TryPatchIndexHtml();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogWarning(
|
_logger.LogWarning(ex, "Could not patch jellyfin-web index.html on disk.");
|
||||||
ex,
|
|
||||||
"Could not inject Request nav loader into jellyfin-web. Use scripts/install-web-loader.ps1 or .sh after ensuring index.html is writable.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_retryCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
|
||||||
|
_ = RetryRegisterAsync(_retryCts.Token);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Task StopAsync(CancellationToken cancellationToken)
|
public Task StopAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
_retryCts?.Cancel();
|
||||||
|
_retryCts?.Dispose();
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TryInject()
|
/// <summary>
|
||||||
|
/// File Transformation callback: injects the nav-loader script tag into index.html contents.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="payload">Current file contents.</param>
|
||||||
|
/// <returns>Transformed HTML.</returns>
|
||||||
|
public static string InjectNavLoader(IndexHtmlPatchPayload payload)
|
||||||
|
{
|
||||||
|
var html = payload?.Contents ?? string.Empty;
|
||||||
|
if (html.Contains(LoaderSrc, StringComparison.Ordinal)
|
||||||
|
|| html.Contains(MarkerStart, StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
var block = $"{MarkerStart}\n<script src=\"{LoaderSrc}\" defer></script>\n{MarkerEnd}\n";
|
||||||
|
var bodyIndex = html.LastIndexOf("</body>", StringComparison.OrdinalIgnoreCase);
|
||||||
|
return bodyIndex >= 0
|
||||||
|
? html.Insert(bodyIndex, block)
|
||||||
|
: html + "\n" + block;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task RetryRegisterAsync(CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
for (var attempt = 1; attempt <= 10; attempt++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.Delay(TimeSpan.FromSeconds(3 * attempt), cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TryRegisterFileTransformation())
|
||||||
|
{
|
||||||
|
_logger.LogInformation(
|
||||||
|
"Request nav loader registered with File Transformation on retry {Attempt}.",
|
||||||
|
attempt);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_logger.LogWarning(
|
||||||
|
"File Transformation still unavailable after retries. Use scripts/install-web-loader.sh|.ps1 if the Request tab is missing.");
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool TryRegisterFileTransformation()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Assembly? fileTransformationAssembly = AssemblyLoadContext.All
|
||||||
|
.SelectMany(context => context.Assemblies)
|
||||||
|
.FirstOrDefault(assembly => assembly.FullName?.Contains(".FileTransformation", StringComparison.OrdinalIgnoreCase) == true);
|
||||||
|
|
||||||
|
if (fileTransformationAssembly is null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Type? pluginInterfaceType = fileTransformationAssembly.GetType("Jellyfin.Plugin.FileTransformation.PluginInterface");
|
||||||
|
MethodInfo? registerMethod = pluginInterfaceType?.GetMethod(
|
||||||
|
"RegisterTransformation",
|
||||||
|
BindingFlags.Public | BindingFlags.Static);
|
||||||
|
|
||||||
|
if (registerMethod is null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
JObject payload = new()
|
||||||
|
{
|
||||||
|
["id"] = TransformationId,
|
||||||
|
["fileNamePattern"] = @"index\.html",
|
||||||
|
["callbackAssembly"] = typeof(WebNavInjector).Assembly.FullName,
|
||||||
|
["callbackClass"] = typeof(WebNavInjector).FullName,
|
||||||
|
["callbackMethod"] = nameof(InjectNavLoader)
|
||||||
|
};
|
||||||
|
|
||||||
|
registerMethod.Invoke(null, [payload]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogDebug(ex, "File Transformation registration failed.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TryPatchIndexHtml()
|
||||||
{
|
{
|
||||||
var indexPath = ResolveIndexHtmlPath();
|
var indexPath = ResolveIndexHtmlPath();
|
||||||
if (indexPath is null)
|
if (indexPath is null)
|
||||||
@@ -63,12 +170,6 @@ public sealed class WebNavInjector : IHostedService
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!File.Exists(indexPath))
|
|
||||||
{
|
|
||||||
_logger.LogWarning("jellyfin-web index.html was not found at {Path}", indexPath);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var html = File.ReadAllText(indexPath);
|
var html = File.ReadAllText(indexPath);
|
||||||
if (html.Contains(LoaderSrc, StringComparison.Ordinal))
|
if (html.Contains(LoaderSrc, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
@@ -76,18 +177,7 @@ public sealed class WebNavInjector : IHostedService
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var block = $"{MarkerStart}{Environment.NewLine}<script src=\"{LoaderSrc}\" defer></script>{Environment.NewLine}{MarkerEnd}";
|
var updated = InjectNavLoader(new IndexHtmlPatchPayload { Contents = html });
|
||||||
string updated;
|
|
||||||
var bodyIndex = html.LastIndexOf("</body>", StringComparison.OrdinalIgnoreCase);
|
|
||||||
if (bodyIndex >= 0)
|
|
||||||
{
|
|
||||||
updated = html.Insert(bodyIndex, block + Environment.NewLine);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
updated = html + Environment.NewLine + block + Environment.NewLine;
|
|
||||||
}
|
|
||||||
|
|
||||||
File.WriteAllText(indexPath, updated);
|
File.WriteAllText(indexPath, updated);
|
||||||
_logger.LogInformation("Injected Request nav loader into {Path}", indexPath);
|
_logger.LogInformation("Injected Request nav loader into {Path}", indexPath);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<ExcludeAssets>runtime</ExcludeAssets>
|
<ExcludeAssets>runtime</ExcludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<ExcludeAssets>runtime</ExcludeAssets>
|
||||||
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -17,8 +17,17 @@ Jellyfin does not clone git repos for plugins. It reads a `manifest.json` URL an
|
|||||||
https://git.masengr.com/Michael-A-Sloan/Jellyfin_Request_tvandmovies/raw/branch/main/manifest.json
|
https://git.masengr.com/Michael-A-Sloan/Jellyfin_Request_tvandmovies/raw/branch/main/manifest.json
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Open **Catalog**, find **Request**, install it, then restart Jellyfin.
|
3. Also add Paradox’s repo (needed for the home **Request** tab on Docker/Unraid):
|
||||||
4. Configure under **Dashboard → Plugins → Request** (TMDB API key + enable submissions).
|
|
||||||
|
```text
|
||||||
|
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).
|
||||||
|
6. Hard-refresh the browser (Ctrl+F5). You should see a **Request** tab next to Home/Favorites.
|
||||||
|
|
||||||
|
Direct page (even without the tab): `/Requests/Page`
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
@@ -33,7 +42,7 @@ dotnet restore Jellyfin.Plugin.Request.sln
|
|||||||
.\scripts\package-release.ps1
|
.\scripts\package-release.ps1
|
||||||
```
|
```
|
||||||
|
|
||||||
That rebuilds the DLL, writes `release/Jellyfin.Plugin.Request_10.11.11.zip`, and refreshes `manifest.json` (including the MD5 checksum Jellyfin verifies).
|
That rebuilds the DLL, writes `release/Jellyfin.Plugin.Request_<version>.zip`, and refreshes `manifest.json` (including the MD5 checksum Jellyfin verifies).
|
||||||
|
|
||||||
Commit and push `manifest.json` + `release/*.zip` so the raw Gitea URLs stay valid.
|
Commit and push `manifest.json` + `release/*.zip` so the raw Gitea URLs stay valid.
|
||||||
|
|
||||||
@@ -45,15 +54,11 @@ Jellyfin.Plugin.Request\bin\Release\net9.0\Jellyfin.Plugin.Request.dll
|
|||||||
|
|
||||||
## Request nav tab
|
## Request nav tab
|
||||||
|
|
||||||
On startup the plugin tries to inject:
|
The plugin injects `nav-loader.js` into jellyfin-web so a **Request** item appears in the top tabs and side menu.
|
||||||
|
|
||||||
```html
|
**Preferred:** install [File Transformation](https://github.com/IAmParadox27/jellyfin-plugin-file-transformation). The Request plugin registers with it at startup and patches `index.html` in memory (survives Jellyfin updates; works when the web folder is read-only).
|
||||||
<script src="/Requests/Assets/nav-loader.js" defer></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
into jellyfin-web `index.html`. That adds a **Request** item to the top library tabs and side menu.
|
**Fallback:** if File Transformation is not installed, the plugin tries to write the script tag into `index.html` on disk. That often fails in Docker/Unraid. Manual scripts:
|
||||||
|
|
||||||
Docker and some packaged installs make `index.html` read-only. If the tab does not appear, run the matching script with a writable path:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo bash scripts/install-web-loader.sh /usr/share/jellyfin/web/index.html
|
sudo bash scripts/install-web-loader.sh /usr/share/jellyfin/web/index.html
|
||||||
@@ -63,13 +68,6 @@ sudo bash scripts/install-web-loader.sh /usr/share/jellyfin/web/index.html
|
|||||||
.\scripts\install-web-loader.ps1 -IndexPath "C:\Program Files\Jellyfin\Server\jellyfin-web\index.html"
|
.\scripts\install-web-loader.ps1 -IndexPath "C:\Program Files\Jellyfin\Server\jellyfin-web\index.html"
|
||||||
```
|
```
|
||||||
|
|
||||||
Jellyfin updates can replace `index.html`. Re-run the install script if the tab disappears.
|
|
||||||
|
|
||||||
Uninstall helpers:
|
|
||||||
|
|
||||||
- `scripts/uninstall-web-loader.sh`
|
|
||||||
- `scripts/uninstall-web-loader.ps1`
|
|
||||||
|
|
||||||
## API overview
|
## API overview
|
||||||
|
|
||||||
Authenticated Jellyfin users call plugin endpoints under `/Requests`:
|
Authenticated Jellyfin users call plugin endpoints under `/Requests`:
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: "Request"
|
name: "Request"
|
||||||
guid: "11c08950-c4bb-484d-89ff-205b3724416b"
|
guid: "11c08950-c4bb-484d-89ff-205b3724416b"
|
||||||
version: "1.0.0.1"
|
version: "1.0.0.2"
|
||||||
targetAbi: "10.11.11.0"
|
targetAbi: "10.11.11.0"
|
||||||
framework: "net9.0"
|
framework: "net9.0"
|
||||||
overview: "Request movies and TV shows from a local admin review queue"
|
overview: "Request movies and TV shows from a local admin review queue"
|
||||||
|
|||||||
+5
-5
@@ -9,12 +9,12 @@
|
|||||||
"repositoryUrl": "https://git.masengr.com/Michael-A-Sloan/Jellyfin_Request_tvandmovies",
|
"repositoryUrl": "https://git.masengr.com/Michael-A-Sloan/Jellyfin_Request_tvandmovies",
|
||||||
"versions": [
|
"versions": [
|
||||||
{
|
{
|
||||||
"version": "1.0.0.1",
|
"version": "1.0.0.2",
|
||||||
"changelog": "Built against Jellyfin 10.11.11 (targetAbi 10.11.11.0)",
|
"changelog": "Inject Request tab via File Transformation (Docker/Unraid safe); keep disk patch fallback",
|
||||||
"targetAbi": "10.11.11.0",
|
"targetAbi": "10.11.11.0",
|
||||||
"sourceUrl": "https://git.masengr.com/Michael-A-Sloan/Jellyfin_Request_tvandmovies/raw/branch/main/release/Jellyfin.Plugin.Request_10.11.11.zip",
|
"sourceUrl": "https://git.masengr.com/Michael-A-Sloan/Jellyfin_Request_tvandmovies/raw/branch/main/release/Jellyfin.Plugin.Request_1.0.0.2.zip",
|
||||||
"checksum": "75C63C5CB75418E21510B23E8F3AD16C",
|
"checksum": "DFD860D8E616B33B7BE31B3CEE462EAB",
|
||||||
"timestamp": "2026-08-02T20:34:44.0000000Z",
|
"timestamp": "2026-08-02T20:41:46.8916597Z",
|
||||||
"dependencies": []
|
"dependencies": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
param(
|
param(
|
||||||
[string]$Version = "1.0.0.1",
|
[string]$Version = "1.0.0.2",
|
||||||
[string]$TargetAbi = "10.11.11.0",
|
[string]$TargetAbi = "10.11.11.0",
|
||||||
[string]$RepoRawBase = "https://git.masengr.com/Michael-A-Sloan/Jellyfin_Request_tvandmovies/raw/branch/main"
|
[string]$RepoRawBase = "https://git.masengr.com/Michael-A-Sloan/Jellyfin_Request_tvandmovies/raw/branch/main"
|
||||||
)
|
)
|
||||||
@@ -10,14 +10,14 @@ Set-Location $root
|
|||||||
|
|
||||||
$guid = "11c08950-c4bb-484d-89ff-205b3724416b"
|
$guid = "11c08950-c4bb-484d-89ff-205b3724416b"
|
||||||
$pluginName = "Request"
|
$pluginName = "Request"
|
||||||
$zipFileName = "Jellyfin.Plugin.Request_10.11.11.zip"
|
$zipFileName = "Jellyfin.Plugin.Request_$Version.zip"
|
||||||
$releaseDir = Join-Path $root "release"
|
$releaseDir = Join-Path $root "release"
|
||||||
$stageDir = Join-Path $releaseDir "stage"
|
$stageDir = Join-Path $releaseDir "stage"
|
||||||
$dllPath = Join-Path $root "Jellyfin.Plugin.Request\bin\Release\net9.0\Jellyfin.Plugin.Request.dll"
|
$dllPath = Join-Path $root "Jellyfin.Plugin.Request\bin\Release\net9.0\Jellyfin.Plugin.Request.dll"
|
||||||
$zipPath = Join-Path $releaseDir $zipFileName
|
$zipPath = Join-Path $releaseDir $zipFileName
|
||||||
$manifestPath = Join-Path $root "manifest.json"
|
$manifestPath = Join-Path $root "manifest.json"
|
||||||
$timestamp = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ")
|
$timestamp = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ")
|
||||||
$changelog = "Built against Jellyfin 10.11.11 (targetAbi 10.11.11.0)"
|
$changelog = "Inject Request tab via File Transformation (Docker/Unraid safe); keep disk patch fallback"
|
||||||
|
|
||||||
Write-Host "Building plugin..."
|
Write-Host "Building plugin..."
|
||||||
dotnet build (Join-Path $root "Jellyfin.Plugin.Request.sln") -c Release
|
dotnet build (Join-Path $root "Jellyfin.Plugin.Request.sln") -c Release
|
||||||
@@ -54,10 +54,25 @@ Compress-Archive -Path (Join-Path $stageDir "*") -DestinationPath $tempZip -Forc
|
|||||||
Remove-Item $stageDir -Recurse -Force
|
Remove-Item $stageDir -Recurse -Force
|
||||||
|
|
||||||
if (Test-Path $zipPath) {
|
if (Test-Path $zipPath) {
|
||||||
Remove-Item $zipPath -Force -ErrorAction SilentlyContinue
|
for ($i = 0; $i -lt 5; $i++) {
|
||||||
Start-Sleep -Milliseconds 200
|
try {
|
||||||
|
Remove-Item $zipPath -Force -ErrorAction Stop
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
catch {
|
||||||
|
Start-Sleep -Milliseconds 300
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Test-Path $zipPath) {
|
||||||
|
# Last resort: write under a new name and replace via copy bytes.
|
||||||
|
[System.IO.File]::Copy($tempZip, $zipPath, $true)
|
||||||
|
Remove-Item $tempZip -Force
|
||||||
|
}
|
||||||
|
else {
|
||||||
Move-Item -Path $tempZip -Destination $zipPath -Force
|
Move-Item -Path $tempZip -Destination $zipPath -Force
|
||||||
|
}
|
||||||
|
|
||||||
$checksum = (Get-FileHash -Path $zipPath -Algorithm MD5).Hash.ToUpperInvariant()
|
$checksum = (Get-FileHash -Path $zipPath -Algorithm MD5).Hash.ToUpperInvariant()
|
||||||
$sourceUrl = "$RepoRawBase/release/$zipFileName"
|
$sourceUrl = "$RepoRawBase/release/$zipFileName"
|
||||||
|
|||||||
Reference in new issue
Block a user