Пример #1
0
        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");
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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);
        }