Fixed issue with the filenames not working when unpacking.
This commit is contained in:
parent
426ff20273
commit
58a6fafbc2
2 changed files with 8 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ using System.Collections.Concurrent;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Web;
|
||||||
using RdtClient.Data.Enums;
|
using RdtClient.Data.Enums;
|
||||||
using RdtClient.Service.Helpers;
|
using RdtClient.Service.Helpers;
|
||||||
|
|
||||||
|
|
@ -211,6 +212,9 @@ namespace RdtClient.Service.Services
|
||||||
// Check if the unpacking process is even needed
|
// Check if the unpacking process is even needed
|
||||||
var uri = new Uri(download.Link);
|
var uri = new Uri(download.Link);
|
||||||
var fileName = uri.Segments.Last();
|
var fileName = uri.Segments.Last();
|
||||||
|
|
||||||
|
fileName = HttpUtility.UrlDecode(fileName);
|
||||||
|
|
||||||
var extension = Path.GetExtension(fileName);
|
var extension = Path.GetExtension(fileName);
|
||||||
|
|
||||||
if (extension != ".rar")
|
if (extension != ".rar")
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Web;
|
||||||
using RdtClient.Data.Models.Data;
|
using RdtClient.Data.Models.Data;
|
||||||
using SharpCompress.Archives;
|
using SharpCompress.Archives;
|
||||||
using SharpCompress.Archives.Rar;
|
using SharpCompress.Archives.Rar;
|
||||||
|
|
@ -53,6 +54,9 @@ namespace RdtClient.Service.Services
|
||||||
var torrentPath = Path.Combine(_destinationPath, _torrent.RdName);
|
var torrentPath = Path.Combine(_destinationPath, _torrent.RdName);
|
||||||
|
|
||||||
var fileName = uri.Segments.Last();
|
var fileName = uri.Segments.Last();
|
||||||
|
|
||||||
|
fileName = HttpUtility.UrlDecode(fileName);
|
||||||
|
|
||||||
var filePath = Path.Combine(torrentPath, fileName);
|
var filePath = Path.Combine(torrentPath, fileName);
|
||||||
|
|
||||||
if (!File.Exists(filePath))
|
if (!File.Exists(filePath))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue