Exemplo n.º 1
0
        async protected override Task <DataListPageResult <MovieVm> > FetchPageAsync(int pageNumber)
        {
            //var mvs = await _appContext.XBMC.VideoLibrary.GetMovies(Movie.AllFields(), new Limits() { start = (pageNumber - 1) * PageSize, end = (pageNumber - 1) * PageSize + PageSize }, new Sort() { method = Sort_method.title, ignorearticle = true, order = Sort_order.@ascending });
            var mvs = await GetMovies(Movie.AllFields(),
                                      new Limits()
            {
                start = (pageNumber - 1) * PageSize, end = (pageNumber - 1) * PageSize + PageSize
            },
                                      new Sort()
            {
                method        = Sort_method.title,
                ignorearticle = false,
                order         = Sort_order.@ascending
            });

            List <MovieVm> list = null;

            if (mvs.movies != null)
            {
                list = mvs.movies.Select(MovieFactory).ToList();
            }
            else
            {
                list = new List <MovieVm>();
            }

            return(new DataListPageResult <MovieVm>(mvs.limits.total, PageSize, pageNumber, list));
        }
Exemplo n.º 2
0
 protected abstract Task <KODIRPC.VideoLibrary.GetMoviesResponse> GetMovies(Movie fields, Limits limits, Sort sort);