From 0782a1597923050ba342b20b74081fc7721242be Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Thu, 9 Feb 2017 19:27:23 +0100 Subject: [PATCH] Remove backslashes from BTN release titles. fixes #1075 --- .../Indexers/BroadcastheNet/BroadcastheNetParser.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetParser.cs b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetParser.cs index 9d126da54..2af7b6739 100644 --- a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetParser.cs +++ b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetParser.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet { throw new IndexerException(indexerResponse, "Indexer API call returned an error [{0}]", jsonResponse.Error); } - + if (jsonResponse.Result.Results == 0) { return results; @@ -57,7 +57,7 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet var torrentInfo = new TorrentInfo(); torrentInfo.Guid = string.Format("BTN-{0}", torrent.TorrentID); - torrentInfo.Title = torrent.ReleaseName; + torrentInfo.Title = CleanReleaseName(torrent.ReleaseName); torrentInfo.Size = torrent.Size; torrentInfo.DownloadUrl = RegexProtocol.Replace(torrent.DownloadURL, protocol); torrentInfo.InfoUrl = string.Format("{0}//broadcasthe.net/torrents.php?id={1}&torrentid={2}", protocol, torrent.GroupID, torrent.TorrentID); @@ -71,7 +71,7 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet torrentInfo.TvRageId = torrent.TvrageID.Value; } torrentInfo.PublishDate = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).ToUniversalTime().AddSeconds(torrent.Time); - //torrentInfo.MagnetUrl = + //torrentInfo.MagnetUrl = torrentInfo.InfoHash = torrent.InfoHash; torrentInfo.Seeders = torrent.Seeders; torrentInfo.Peers = torrent.Leechers + torrent.Seeders; @@ -87,5 +87,12 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet return results; } + + private string CleanReleaseName(string releaseName) + { + releaseName = releaseName.Replace("\\", ""); + + return releaseName; + } } }