Fixed issue with the filenames not working when unpacking.

This commit is contained in:
Roger Far 2021-02-11 19:54:08 -07:00
parent 426ff20273
commit 58a6fafbc2
2 changed files with 8 additions and 0 deletions

View file

@ -3,6 +3,7 @@ using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using RdtClient.Data.Enums;
using RdtClient.Service.Helpers;
@ -211,6 +212,9 @@ namespace RdtClient.Service.Services
// Check if the unpacking process is even needed
var uri = new Uri(download.Link);
var fileName = uri.Segments.Last();
fileName = HttpUtility.UrlDecode(fileName);
var extension = Path.GetExtension(fileName);
if (extension != ".rar")

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using RdtClient.Data.Models.Data;
using SharpCompress.Archives;
using SharpCompress.Archives.Rar;
@ -53,6 +54,9 @@ namespace RdtClient.Service.Services
var torrentPath = Path.Combine(_destinationPath, _torrent.RdName);
var fileName = uri.Segments.Last();
fileName = HttpUtility.UrlDecode(fileName);
var filePath = Path.Combine(torrentPath, fileName);
if (!File.Exists(filePath))