public static async Task <WebDiskSpaceInformation> ProcessAsync(IOwinContext context, string id)
        {
            if (!ServiceRegistration.IsRegistered <ITvProvider>())
            {
                throw new BadRequestException("GetRecordingDiskInformationForCard: ITvProvider not found");
            }

            IList <ICard> cards = await TVAccess.GetTunerCardsAsync(context);

            return(DiskSpaceInformation.GetSpaceInformation(cards.Select(card => Card(card)).Single(x => x.Id == int.Parse(id)).RecordingFolder));
        }
Пример #2
0
        public static async Task <IList <WebCard> > ProcessAsync(IOwinContext context)
        {
            if (!ServiceRegistration.IsRegistered <ITvProvider>())
            {
                throw new BadRequestException("GetCards: ITvProvider not found");
            }

            var cards = await TVAccess.GetTunerCardsAsync(context);

            return(cards.Select(card => Card(card)).ToList());
        }
        public static async Task <IList <WebDiskSpaceInformation> > ProcessAsync(IOwinContext context)
        {
            if (!ServiceRegistration.IsRegistered <ITvProvider>())
            {
                throw new BadRequestException("GetAllRecordingDiskInformation: ITvProvider not found");
            }

            var cards = await TVAccess.GetTunerCardsAsync(context);

            return(cards.Select(card => Card(card)).Select(x => x.RecordingFolder).Distinct().AsQueryable()
                   .Select(x => DiskSpaceInformation.GetSpaceInformation(x))
                   .GroupBy(x => x.Disk, (key, list) => list.First())
                   .ToList());
        }