Skip to content

Commit

Permalink
Added path seperator on the content_path, fixed reporting errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerfar committed Apr 14, 2021
1 parent a15c247 commit 2cb81e2
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 20 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
64 changes: 48 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,67 @@ 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

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

# 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 addgroup --quiet --gid 1000 dotnet
RUN adduser --system --uid 1000 --group dotnet --shell /bin/sh
# set environment variables
ARG DEBIAN_FRONTEND="noninteractive"
ENV XDG_CONFIG_HOME="/config/xdg"
ENV RDTCLIENT_BRANCH="main"

RUN mkdir /app
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"]
# ports and volumes
EXPOSE 6500
VOLUME ["/config", "/data" ]
2 changes: 1 addition & 1 deletion client/src/app/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<a class="navbar-item"> Profile </a>
<a class="navbar-item" (click)="logout()"> Logout </a>
<hr class="navbar-divider" />
<div class="navbar-item">Version 1.7.1</div>
<div class="navbar-item">Version 1.7.2</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
8 changes: 7 additions & 1 deletion server/RdtClient.Service/Services/QBittorrent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
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;

Expand Down Expand Up @@ -239,7 +240,7 @@ public async Task<IList<TorrentInfo>> TorrentInfo()
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;
Expand Down Expand Up @@ -315,6 +316,11 @@ public async Task<IList<TorrentInfo>> TorrentInfo()
}
}
}

if (torrent.RdStatus == RealDebridStatus.Error)
{
result.State = "error";
}

results.Add(result);
}
Expand Down
2 changes: 1 addition & 1 deletion server/RdtClient.Web/RdtClient.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net5.0</TargetFramework>
<OutputType>Exe</OutputType>
<UserSecretsId>94c24cba-f03f-4453-a671-3640b517c573</UserSecretsId>
<Version>1.7.1</Version>
<Version>1.7.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 2cb81e2

Please sign in to comment.