From 58a80e45e1a6430846f30f64c157cd585a2fe79a Mon Sep 17 00:00:00 2001 From: Roger Far Date: Thu, 1 Apr 2021 16:19:33 -0600 Subject: [PATCH] Update to 1.7.0 --- .gitignore | 3 ++- CHANGELOG.md | 7 ++++++ client/src/app/navbar/navbar.component.html | 2 +- dotnet-publish.ps1 | 13 +++++++++++ package.json | 2 +- server/RdtClient.Web/RdtClient.Web.csproj | 2 +- server/RdtClient.Web/Update.ps1 | 26 +++++++++++++++++++++ 7 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 server/RdtClient.Web/Update.ps1 diff --git a/.gitignore b/.gitignore index 9108426..3ce944c 100644 --- a/.gitignore +++ b/.gitignore @@ -40,4 +40,5 @@ build/ publish/ server/Downloader/ -node_modules/ \ No newline at end of file +node_modules/ +RealDebridClient.zip diff --git a/CHANGELOG.md b/CHANGELOG.md index c57fba6..3b488da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.7.0] - 2021-04-01 +### Added +- Add automatic retry functionality for downloads. It will retry downloading a file after an error 3 times. +- Add Update.ps1 to automatically download the latest version from Github for Windows users. +### Changed +- Fixed an issue downloads sometimes getting added multiple times. + ## [1.6.3] - 2021-03-15 ### Changed - Fixed a bug where it sometimes could add a download multiple times when the RD torrent was in a certain state. diff --git a/client/src/app/navbar/navbar.component.html b/client/src/app/navbar/navbar.component.html index 7a120d5..b0e65d2 100644 --- a/client/src/app/navbar/navbar.component.html +++ b/client/src/app/navbar/navbar.component.html @@ -49,7 +49,7 @@ Profile Logout - + diff --git a/dotnet-publish.ps1 b/dotnet-publish.ps1 index b3ce95f..1d40703 100644 --- a/dotnet-publish.ps1 +++ b/dotnet-publish.ps1 @@ -1,3 +1,16 @@ +$utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False + +$version = (Get-Content "package.json" | ConvertFrom-Json).version + +$csProj = "$pwd\server\RdtClient.Web\RdtClient.Web.csproj" +$navbar = "$pwd\client\src\app\navbar\navbar.component.html"; + +$newCsProj = (Get-Content $csProj) -replace '.*?<\/Version>', "$version" +[System.IO.File]::WriteAllLines($csProj, $newCsProj, $utf8NoBomEncoding) + +$newNavbar = (Get-Content $navbar) -replace 'Version .*?<', "Version $version<" +[System.IO.File]::WriteAllLines($navbar, $newNavbar, $utf8NoBomEncoding) + cd client npm install ng build --prod --output-path=..\server\RdtClient.Web\wwwroot diff --git a/package.json b/package.json index 8c8a258..7f4ede0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rdt-client", - "version": "1.6.3", + "version": "1.7.0", "description": "This is a web interface to manage your torrents on Real-Debrid.", "main": "index.js", "dependencies": { diff --git a/server/RdtClient.Web/RdtClient.Web.csproj b/server/RdtClient.Web/RdtClient.Web.csproj index 45acd6c..03e5156 100644 --- a/server/RdtClient.Web/RdtClient.Web.csproj +++ b/server/RdtClient.Web/RdtClient.Web.csproj @@ -4,7 +4,7 @@ net5.0 Exe 94c24cba-f03f-4453-a671-3640b517c573 - 1.6.3 + 1.7.0 diff --git a/server/RdtClient.Web/Update.ps1 b/server/RdtClient.Web/Update.ps1 new file mode 100644 index 0000000..de581d2 --- /dev/null +++ b/server/RdtClient.Web/Update.ps1 @@ -0,0 +1,26 @@ +If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) +{ + $arguments = "& '" + $myinvocation.mycommand.definition + "'" + Start-Process powershell -Verb runAs -ArgumentList $arguments + Break +} + +Stop-Service RealDebridClient + +$releasesUri = "https://api.github.com/repos/rogerfar/rdt-client/releases/latest" +$downloadUri = ((Invoke-RestMethod -Method GET -Uri $releasesUri).assets | Where-Object name -like "*.zip").browser_download_url + +$pathZip = Join-Path -Path $([System.IO.Path]::GetTempPath()) -ChildPath $(Split-Path -Path $downloadUri -Leaf) + +Invoke-WebRequest -Uri $downloadUri -Out $pathZip + +$tempExtract = Join-Path -Path $([System.IO.Path]::GetTempPath()) -ChildPath $((New-Guid).Guid) + +Expand-Archive -Path $pathZip -DestinationPath $tempExtract -Force +Copy-Item -Path ".\appsettings.json" -Destination $tempExtract -Force +Move-Item -Path "$tempExtract\*" -Destination $pathExtract -Force +Remove-Item -Path $tempExtract -Force -Recurse -ErrorAction SilentlyContinue + +Remove-Item $pathZip -Force + +Start-Service RealDebridClient \ No newline at end of file