diff --git a/CHANGELOG.md b/CHANGELOG.md index adbcb92..1255bfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ 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.2] - 2021-04-14 +### Changed +- Fixed issue where sometimes the content path is not recognized by Sonarr. +- Fixed reporting errors when a RD torrent errors. + ## [1.7.1] - 2021-04-01 ### Added - Add Update.ps1 to automatically download the latest version from Github for Windows users. diff --git a/Dockerfile b/Dockerfile index 6728ddd..47141a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,11 @@ FROM amd64/node:15.5-buster AS node-build-env RUN mkdir /appclient WORKDIR /appclient -COPY client/. . -RUN npm ci -RUN npx ng build --prod --output-path=out +RUN \ + git clone https://github.com/rogerfar/rdt-client.git . && \ + cd client && \ + npm ci && \ + npx ng build --prod --output-path=out # Stage 2 - Build the backend FROM mcr.microsoft.com/dotnet/sdk:5.0.103-alpine3.13-amd64 AS dotnet-build-env @@ -14,25 +16,55 @@ FROM mcr.microsoft.com/dotnet/sdk:5.0.103-alpine3.13-amd64 AS dotnet-build-env RUN mkdir /appserver WORKDIR /appserver -COPY server/. . - -RUN if [ "$BUILDPLATFORM" = "arm/v7" ] ; then dotnet restore -r linux-arm RdtClient.sln ; else dotnet restore RdtClient.sln ; fi -RUN if [ "$BUILDPLATFORM" = "arm/v7" ] ; then dotnet publish -r linux-arm -c Release -o out ; else dotnet publish -c Release -o out ; fi +RUN \ + git clone https://github.com/rogerfar/rdt-client.git . && \ + cd server && \ + if [ "$BUILDPLATFORM" = "arm/v7" ] ; then dotnet restore -r linux-arm RdtClient.sln ; else dotnet restore RdtClient.sln ; fi && \ + if [ "$BUILDPLATFORM" = "arm/v7" ] ; then dotnet publish -r linux-arm -c Release -o out ; else dotnet publish -c Release -o out ; fi # Stage 3 - Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:5.0.3-buster-slim AS base +FROM ghcr.io/linuxserver/baseimage-mono:LTS -RUN addgroup --quiet --gid 1000 dotnet -RUN adduser --system --uid 1000 --group dotnet --shell /bin/sh +# set version label +ARG BUILD_DATE +ARG VERSION +ARG RDTCLIENT_VERSION +LABEL build_version="Linuxserver.io extended version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="ravensorb" -RUN mkdir /app +# set environment variables +ARG DEBIAN_FRONTEND="noninteractive" +ENV XDG_CONFIG_HOME="/config/xdg" +ENV RDTCLIENT_BRANCH="main" + +RUN mkdir /app || true && mkdir -p /data/downloads /data/db || true && \ + echo "**** Updating package information ****" && \ + apt update -y -qq && \ + apt install -y -qq wget && \ + echo "**** Installing dotnet ****" && \ + wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb && \ + dpkg -i packages-microsoft-prod.deb 2> /dev/null && \ + rm packages-microsoft-prod.deb && \ + apt update -y -qq && \ + apt install -y -qq apt-transport-https dotnet-runtime-5.0 aspnetcore-runtime-5.0 && \ + echo "**** Cleaning image ****" && \ + apt-get -y -qq -o Dpkg::Use-Pty=0 clean && apt-get -y -qq -o Dpkg::Use-Pty=0 purge && \ + echo "**** Setting permissions ****" && \ + chown -R abc:abc /data && \ + rm -rf \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* || true WORKDIR /app -COPY --from=dotnet-build-env /appserver/out . -COPY --from=node-build-env /appclient/out ./wwwroot +COPY --from=dotnet-build-env /appserver/server/out . +COPY --from=node-build-env /appclient/client/out ./wwwroot -RUN chown -R dotnet:dotnet /app +WORKDIR /data -USER 1000 +# add local files +COPY src/root/ / -ENTRYPOINT ["dotnet", "RdtClient.Web.dll"] \ No newline at end of file +# ports and volumes +EXPOSE 6500 +VOLUME ["/config", "/data" ] \ No newline at end of file diff --git a/client/src/app/navbar/navbar.component.html b/client/src/app/navbar/navbar.component.html index d0ce683..8ecab80 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/package.json b/package.json index d2a13db..6af5186 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rdt-client", - "version": "1.7.1", + "version": "1.7.2", "description": "This is a web interface to manage your torrents on Real-Debrid.", "main": "index.js", "dependencies": { diff --git a/server/RdtClient.Service/Services/QBittorrent.cs b/server/RdtClient.Service/Services/QBittorrent.cs index 7aba234..30c67e8 100644 --- a/server/RdtClient.Service/Services/QBittorrent.cs +++ b/server/RdtClient.Service/Services/QBittorrent.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; +using RdtClient.Data.Enums; using RdtClient.Service.Models.QBittorrent; using RdtClient.Service.Models.QBittorrent.QuickType; @@ -239,7 +240,7 @@ namespace RdtClient.Service.Services downloadPath = Path.Combine(downloadPath, torrent.Category); } - var torrentPath = Path.Combine(downloadPath, torrent.RdName); + var torrentPath = Path.Combine(downloadPath, torrent.RdName) + Path.DirectorySeparatorChar; var bytesDone = torrent.RdProgress; var bytesTotal = torrent.RdSize; @@ -315,6 +316,11 @@ namespace RdtClient.Service.Services } } } + + if (torrent.RdStatus == RealDebridStatus.Error) + { + result.State = "error"; + } results.Add(result); } diff --git a/server/RdtClient.Web/RdtClient.Web.csproj b/server/RdtClient.Web/RdtClient.Web.csproj index d6beecd..1844068 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.7.1 + 1.7.2