Add logging for the symlink downloader.
Some checks failed
Docker Image CI / build (push) Has been cancelled
Some checks failed
Docker Image CI / build (push) Has been cancelled
This commit is contained in:
parent
8972db8938
commit
05dd562be1
6 changed files with 51 additions and 5 deletions
|
|
@ -4,6 +4,10 @@ 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/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [2.0.70] - 2024-04-10
|
||||||
|
### Added
|
||||||
|
- Added symlink logging.
|
||||||
|
|
||||||
## [2.0.69] - 2024-04-09
|
## [2.0.69] - 2024-04-09
|
||||||
### Added
|
### Added
|
||||||
- Added sorting to the GUI columns.
|
- Added sorting to the GUI columns.
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
<a class="navbar-item" routerLink="profile"> Profile </a>
|
<a class="navbar-item" routerLink="profile"> Profile </a>
|
||||||
<a class="navbar-item" (click)="logout()"> Logout </a>
|
<a class="navbar-item" (click)="logout()"> Logout </a>
|
||||||
<hr class="navbar-divider" />
|
<hr class="navbar-divider" />
|
||||||
<a href="https://github.com/rogerfar/rdt-client" target="_blank" class="navbar-item">Version 2.0.69</a>
|
<a href="https://github.com/rogerfar/rdt-client" target="_blank" class="navbar-item">Version 2.0.70</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "rdt-client",
|
"name": "rdt-client",
|
||||||
"version": "2.0.69",
|
"version": "2.0.70",
|
||||||
"description": "This is a web interface to manage your torrents on Real-Debrid.",
|
"description": "This is a web interface to manage your torrents on Real-Debrid.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
namespace RdtClient.Service.Helpers;
|
using System.Text;
|
||||||
|
|
||||||
|
namespace RdtClient.Service.Helpers;
|
||||||
|
|
||||||
public static class FileHelper
|
public static class FileHelper
|
||||||
{
|
{
|
||||||
|
|
@ -78,4 +80,29 @@ public static class FileHelper
|
||||||
{
|
{
|
||||||
return String.Concat(filename.Split(Path.GetInvalidFileNameChars()));
|
return String.Concat(filename.Split(Path.GetInvalidFileNameChars()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String GetDirectoryContents(String path)
|
||||||
|
{
|
||||||
|
var stringBuilder = new StringBuilder();
|
||||||
|
GetDirectoryContents(path, stringBuilder, "");
|
||||||
|
return stringBuilder.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void GetDirectoryContents(String path, StringBuilder stringBuilder, String indent)
|
||||||
|
{
|
||||||
|
var directoryInfo = new DirectoryInfo(path);
|
||||||
|
|
||||||
|
var directories = directoryInfo.GetDirectories();
|
||||||
|
foreach (var directory in directories)
|
||||||
|
{
|
||||||
|
stringBuilder.AppendLine($"{indent}{directory.Name}");
|
||||||
|
GetDirectoryContents(directory.FullName, stringBuilder, indent + " ");
|
||||||
|
}
|
||||||
|
|
||||||
|
var files = directoryInfo.GetFiles();
|
||||||
|
foreach (var file in files)
|
||||||
|
{
|
||||||
|
stringBuilder.AppendLine($"{indent}{file.Name}");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Serilog;
|
using RdtClient.Service.Helpers;
|
||||||
|
using Serilog;
|
||||||
|
|
||||||
namespace RdtClient.Service.Services.Downloaders;
|
namespace RdtClient.Service.Services.Downloaders;
|
||||||
|
|
||||||
|
|
@ -82,6 +83,8 @@ public class SymlinkDownloader(String uri, String destinationPath, String path)
|
||||||
{
|
{
|
||||||
var potentialFilePathWithFileName = Path.Combine(potentialFilePath, fileName);
|
var potentialFilePathWithFileName = Path.Combine(potentialFilePath, fileName);
|
||||||
|
|
||||||
|
_logger.Debug($"Searching {potentialFilePathWithFileName}...");
|
||||||
|
|
||||||
if (File.Exists(potentialFilePathWithFileName))
|
if (File.Exists(potentialFilePathWithFileName))
|
||||||
{
|
{
|
||||||
file = new(potentialFilePathWithFileName);
|
file = new(potentialFilePathWithFileName);
|
||||||
|
|
@ -101,6 +104,18 @@ public class SymlinkDownloader(String uri, String destinationPath, String path)
|
||||||
|
|
||||||
if (file == null)
|
if (file == null)
|
||||||
{
|
{
|
||||||
|
_logger.Debug($"Unable to find file in rclone mount. Folders available in {rcloneMountPath}: ");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var allFolders = FileHelper.GetDirectoryContents(rcloneMountPath);
|
||||||
|
|
||||||
|
_logger.Debug(allFolders);
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
_logger.Error(ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
throw new("Could not find file from rclone mount!");
|
throw new("Could not find file from rclone mount!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<UserSecretsId>94c24cba-f03f-4453-a671-3640b517c573</UserSecretsId>
|
<UserSecretsId>94c24cba-f03f-4453-a671-3640b517c573</UserSecretsId>
|
||||||
<Version>2.0.69</Version>
|
<Version>2.0.70</Version>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue