protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, Byte[] fileContent) { _proxy.AddTorrentFromFile(filename, fileContent, Settings); try { if (Settings.MovieCategory.IsNotNullOrWhiteSpace()) { _proxy.SetTorrentLabel(hash.ToLower(), Settings.MovieCategory, Settings); } } catch (Exception ex) { _logger.Warn(ex, "Failed to set the torrent label for {0}.", filename); } try { var isRecentMovie = remoteMovie.Movie.IsRecentMovie; if (isRecentMovie && Settings.RecentMoviePriority == (int)QBittorrentPriority.First || !isRecentMovie && Settings.OlderMoviePriority == (int)QBittorrentPriority.First) { _proxy.MoveTorrentToTopInQueue(hash.ToLower(), Settings); } } catch (Exception ex) { _logger.Warn(ex, "Failed to set the torrent priority for {0}.", filename); } SetInitialState(hash.ToLower()); return(hash); }
protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, Byte[] fileContent) { _proxy.AddTorrentFromFile(filename, fileContent, Settings); if (Settings.MovieCategory.IsNotNullOrWhiteSpace()) { _proxy.SetTorrentLabel(hash.ToLower(), Settings.MovieCategory, Settings); } return(hash); }
protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, Byte[] fileContent) { _proxy.AddTorrentFromFile(filename, fileContent, Settings); if (Settings.TvCategory.IsNotNullOrWhiteSpace()) { _proxy.SetTorrentLabel(hash.ToLower(), Settings.TvCategory, Settings); } var isRecentEpisode = remoteEpisode.IsRecentEpisode(); if (isRecentEpisode && Settings.RecentTvPriority == (int)QBittorrentPriority.First || !isRecentEpisode && Settings.OlderTvPriority == (int)QBittorrentPriority.First) { _proxy.MoveTorrentToTopInQueue(hash.ToLower(), Settings); } return(hash); }