Skip to content

Commit 29361ea

Browse files
author
Meyn
committed
Fix path
1 parent c79201f commit 29361ea

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Tubifarry/Download/Clients/Soulseek/SlskdClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ private void FileStateChanged(object? sender, SlskdDownloadFile file)
5454

5555
private void PostProcess(SlskdDownloadItem item, SlskdDownloadFile file) => item.PostProcessTasks.Add(Task.Run(async () =>
5656
{
57-
string filename = file.Filename;
58-
string filePath = Path.Combine(Settings.DownloadPath, filename);
57+
string filename = Path.GetFileName(file.Filename);
58+
string filePath = Path.Combine(item.GetFullFolderPath(Settings.DownloadPath).FullPath, filename);
5959
_logger.Info("PostProcess");
6060
if (!File.Exists(filePath))
6161
return;

Tubifarry/Download/Clients/Soulseek/SlskdModels.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ private void CompareFileStates(SlskdDownloadDirectory? previousDirectory, SlskdD
5959
_previousFileStates = newDirectory.Files.ToDictionary(file => file.Id, file => file.State);
6060
}
6161

62-
public DownloadClientItem GetDownloadClientItem(string downloadPath)
63-
{
64-
_downloadClientItem.OutputPath = new OsPath(Path.Combine(downloadPath, SlskdDownloadDirectory?.Directory
62+
public OsPath GetFullFolderPath(string downloadPath) => new(Path.Combine(downloadPath, SlskdDownloadDirectory?.Directory
6563
.Replace('\\', '/')
6664
.TrimEnd('/')
6765
.Split('/')
6866
.LastOrDefault() ?? ""));
67+
68+
public DownloadClientItem GetDownloadClientItem(string downloadPath)
69+
{
70+
_downloadClientItem.OutputPath = GetFullFolderPath(downloadPath);
6971
_downloadClientItem.Title = RemoteAlbum.Release.Title;
7072

7173
if (SlskdDownloadDirectory?.Files == null)
@@ -91,7 +93,7 @@ public DownloadClientItem GetDownloadClientItem(string downloadPath)
9193

9294
DownloadItemStatus status = DownloadItemStatus.Queued;
9395

94-
if ((double)failedFiles.Count / fileStatuses.Count * 100 > 30)
96+
if ((double)failedFiles.Count / fileStatuses.Count * 100 > 10)
9597
{
9698
status = DownloadItemStatus.Failed;
9799
_downloadClientItem.Message = $"Downloading {failedFiles.Count} files failed: {string.Join(", ", failedFiles)}";

0 commit comments

Comments
 (0)