RatioMaster_source.RM.getScrapeUrlString C# (CSharp) Method

getScrapeUrlString() private method

private getScrapeUrlString ( RatioMaster_source.TorrentInfo torrentInfo ) : string
torrentInfo RatioMaster_source.TorrentInfo
return string
        internal string getScrapeUrlString(TorrentInfo torrentInfo)
        {
            string urlString;
            urlString = torrentInfo.tracker;
            int index = urlString.LastIndexOf("/");
            if (urlString.Substring(index + 1, 8).ToLower() != "announce")
            {
                return "";
            }

            urlString = urlString.Substring(0, index + 1) + "scrape" + urlString.Substring(index + 9);
            string hash = HashUrlEncode(torrentInfo.hash, currentClient.HashUpperCase);
            if (urlString.Contains("?"))
            {
                urlString = urlString + "&";
            }
            else
            {
                urlString = urlString + "?";
            }

            return (urlString + "info_hash=" + hash);
        }