private string _getPredefinedQueueName(PredefinedQueue predefined) { switch (predefined) { case PredefinedQueue.NEWLY_ADDED: return("Newly Added Movies"); case PredefinedQueue.CONTINUE_WATCHING: return("Continue Watching"); default: return("Movies"); } }
private List <Movie> _getQueueMovies(long userId, PredefinedQueue predefined) { //This could probably be combined with the _getPredefinedQueueName bellow switch (predefined) { case PredefinedQueue.NEWLY_ADDED: return(_movieRepository.GetNewlyAddedMovies(userId)); case PredefinedQueue.CONTINUE_WATCHING: return(_movieRepository.GetMoviesInProgress(userId)); default: return(null); } }
private bool _buildPredefinedQueue(long userId, PredefinedQueue predefined, out MovieQueue queue) { bool queueBuilt = false; queue = new MovieQueue(); var movies = _getQueueMovies(userId, predefined); if (movies != null && movies.Count != 0) { queue.Name = _getPredefinedQueueName(predefined); queue.Movies = movies; queueBuilt = true; } return(queueBuilt); }