Ejemplo n.º 1
0
        public static Task <WebBoolResult> ProcessAsync(IOwinContext context, string id)
        {
            if (!ServiceRegistration.IsRegistered <ITvProvider>())
            {
                throw new BadRequestException("DeleteRecording: ITvProvider not found");
            }

            MediaItem item = MediaLibraryAccess.GetMediaItemById(context, Guid.Parse(id), BasicNecessaryMIATypeIds, BasicOptionalMIATypeIds);

            if (item == null)
            {
                throw new NotFoundException(String.Format("DeleteRecording: No MediaItem found with id: {0}", id));
            }

            return(System.Threading.Tasks.Task.FromResult(new WebBoolResult {
                Result = MediaLibraryAccess.Delete(context, item)
            }));
        }