protected override string AddFromTorrentFile(RemoteBook remoteBook, string hash, string filename, byte[] fileContent) { var actualHash = _proxy.AddTorrentFromFile(filename, fileContent, Settings); if (actualHash.IsNullOrWhiteSpace()) { throw new DownloadClientException("Deluge failed to add torrent " + filename); } _proxy.SetTorrentSeedingConfiguration(actualHash, remoteBook.SeedConfiguration, Settings); if (Settings.MusicCategory.IsNotNullOrWhiteSpace()) { _proxy.SetTorrentLabel(actualHash, Settings.MusicCategory, Settings); } var isRecentBook = remoteBook.IsRecentBook(); if ((isRecentBook && Settings.RecentTvPriority == (int)DelugePriority.First) || (!isRecentBook && Settings.OlderTvPriority == (int)DelugePriority.First)) { _proxy.MoveTorrentToTopInQueue(actualHash, Settings); } return(actualHash.ToUpper()); }
protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent) { var actualHash = _proxy.AddTorrentFromFile(filename, fileContent, Settings); if (actualHash.IsNullOrWhiteSpace()) { throw new DownloadClientException("Deluge failed to add torrent " + filename); } if (!Settings.TvCategory.IsNullOrWhiteSpace()) { _proxy.SetLabel(actualHash, Settings.TvCategory, Settings); } _proxy.SetTorrentConfiguration(actualHash, "remove_at_ratio", false, Settings); var isRecentEpisode = remoteEpisode.IsRecentEpisode(); if (isRecentEpisode && Settings.RecentTvPriority == (int)DelugePriority.First || !isRecentEpisode && Settings.OlderTvPriority == (int)DelugePriority.First) { _proxy.MoveTorrentToTopInQueue(actualHash, Settings); } return(actualHash.ToUpper()); }
protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent) { var actualHash = _proxy.AddTorrentFromFile(filename, fileContent, Settings); if (!Settings.MovieCategory.IsNullOrWhiteSpace()) { _proxy.SetLabel(actualHash, Settings.MovieCategory, Settings); } _proxy.SetTorrentConfiguration(actualHash, "remove_at_ratio", false, Settings); return(actualHash.ToUpper()); }
protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent) { var actualHash = _proxy.AddTorrentFromFile(filename, fileContent, Settings); if (!Settings.MovieCategory.IsNullOrWhiteSpace()) { _proxy.SetLabel(actualHash, Settings.MovieCategory, Settings); } var isRecentMovie = remoteMovie.Movie.IsRecentMovie; if (isRecentMovie && Settings.RecentMoviePriority == (int)DelugePriority.First || !isRecentMovie && Settings.OlderMoviePriority == (int)DelugePriority.First) { _proxy.MoveTorrentToTopInQueue(actualHash, Settings); } return(actualHash.ToUpper()); }
protected override string AddFromTorrentFile(ReleaseInfo release, string hash, string filename, byte[] fileContent) { var actualHash = _proxy.AddTorrentFromFile(filename, fileContent, Settings); if (actualHash.IsNullOrWhiteSpace()) { throw new DownloadClientException("Deluge failed to add torrent " + filename); } // _proxy.SetTorrentSeedingConfiguration(actualHash, release.SeedConfiguration, Settings); if (Settings.Category.IsNotNullOrWhiteSpace()) { _proxy.SetTorrentLabel(actualHash, Settings.Category, Settings); } if (Settings.Priority == (int)DelugePriority.First) { _proxy.MoveTorrentToTopInQueue(actualHash, Settings); } return(actualHash.ToUpper()); }