Beispiel #1
0
        protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent)
        {
            _proxy.AddTorrentFromFile(filename, fileContent, Settings);

            var tries      = 5;
            var retryDelay = 200;

            if (WaitForTorrent(hash, tries, retryDelay))
            {
                _proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings);

                SetPriority(remoteEpisode, hash);
                SetDownloadDirectory(hash);

                _proxy.StartTorrent(hash, Settings);

                return(hash);
            }
            else
            {
                _logger.Debug("rTorrent could not add file");

                RemoveItem(hash, true);
                throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed");
            }
        }
Beispiel #2
0
        protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent)
        {
            _proxy.AddTorrentFromFile(filename, fileContent, Settings);
            _proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings);

            SetPriority(remoteEpisode, hash);
            SetDownloadDirectory(hash);

            _proxy.StartTorrent(hash, Settings);

            return(hash);
        }
Beispiel #3
0
        protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent)
        {
            _proxy.AddTorrentFromFile(filename, fileContent, Settings.MovieCategory, RTorrentPriority.Normal, Settings.MovieDirectory, Settings);

            var tries      = 10;
            var retryDelay = 500;

            if (!WaitForTorrent(hash, tries, retryDelay))
            {
                _logger.Debug("rTorrent didn't add the torrent within {0} seconds: {1}.", tries * retryDelay / 1000, filename);

                throw new ReleaseDownloadException(remoteMovie.Release, "Downloading torrent failed");
            }

            return(hash);
        }
Beispiel #4
0
        protected override string AddFromTorrentFile(RemoteAlbum remoteAlbum, string hash, string filename, byte[] fileContent)
        {
            var priority = (RTorrentPriority)(remoteAlbum.IsRecentAlbum() ? Settings.RecentTvPriority : Settings.OlderTvPriority);

            _proxy.AddTorrentFromFile(filename, fileContent, Settings.MusicCategory, priority, Settings.MusicDirectory, Settings);

            var tries      = 10;
            var retryDelay = 500;

            if (!WaitForTorrent(hash, tries, retryDelay))
            {
                _logger.Debug("rTorrent didn't add the torrent within {0} seconds: {1}.", tries * retryDelay / 1000, filename);

                throw new ReleaseDownloadException(remoteAlbum.Release, "Downloading torrent failed");
            }

            return(hash);
        }