File tree Expand file tree Collapse file tree 2 files changed +25
-6
lines changed
LearningHub.Nhs.WebUI/Controllers/Api
WebAPI/LearningHub.Nhs.Services Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 77 using System . Text . RegularExpressions ;
88 using System . Threading . Tasks ;
99 using System . Web ;
10+ using LearningHub . Nhs . Models . Entities . Resource ;
1011 using LearningHub . Nhs . Models . Enums ;
1112 using LearningHub . Nhs . Models . Resource ;
1213 using LearningHub . Nhs . Models . Resource . Blocks ;
@@ -682,10 +683,19 @@ private void RemoveBlockCollectionFiles(BlockCollectionViewModel existingResourc
682683 var entry = newBlocks . FirstOrDefault ( x => x . BlockType == BlockType . Media && x . MediaBlock != null && x . MediaBlock . MediaType == MediaType . Video && x . MediaBlock . Video != null && x . MediaBlock . Video . VideoFile ? . File ? . FileId == oldblock . MediaBlock ? . Video ? . VideoFile ? . File ? . FileId ) ;
683684 if ( entry == null )
684685 {
685- filePaths . Add ( oldblock . MediaBlock . Video ? . VideoFile ? . File ? . FilePath ) ;
686- if ( oldblock . MediaBlock ? . Video ? . VideoFile ? . TranscriptFile ? . File ? . FilePath != null )
686+ if ( ! string . IsNullOrWhiteSpace ( oldblock . MediaBlock . Video . File . FilePath ) )
687687 {
688- filePaths . Add ( oldblock . MediaBlock . Video ? . VideoFile ? . TranscriptFile ? . File ? . FilePath ) ;
688+ filePaths . Add ( oldblock . MediaBlock . Video . File . FilePath ) ;
689+ }
690+
691+ if ( ! string . IsNullOrWhiteSpace ( oldblock . MediaBlock . Video ? . File ? . VideoFile ? . File ? . FilePath ) )
692+ {
693+ filePaths . Add ( oldblock . MediaBlock . Video . File . VideoFile . File . FilePath ) ;
694+ }
695+
696+ if ( oldblock . MediaBlock ? . Video ? . File ? . VideoFile ? . TranscriptFile ? . File ? . FilePath != null )
697+ {
698+ filePaths . Add ( oldblock . MediaBlock . Video . File . VideoFile . TranscriptFile . File . FilePath ) ;
689699 }
690700 }
691701 }
Original file line number Diff line number Diff line change @@ -4907,10 +4907,19 @@ private List<string> CheckBlockFile(BlockCollectionViewModel model)
49074907 {
49084908 foreach ( var oldblock in existingVideos )
49094909 {
4910- retVal . Add ( oldblock . MediaBlock ? . Video ? . VideoFile ? . File ? . FilePath ) ;
4911- if ( oldblock . MediaBlock ? . Video ? . VideoFile ? . TranscriptFile ? . File ? . FilePath != null )
4910+ if ( ! string . IsNullOrWhiteSpace ( oldblock . MediaBlock . Video . File . FilePath ) )
49124911 {
4913- retVal . Add ( oldblock . MediaBlock . Video ? . VideoFile ? . TranscriptFile ? . File ? . FilePath ) ;
4912+ retVal . Add ( oldblock . MediaBlock . Video . File . FilePath ) ;
4913+ }
4914+
4915+ if ( ! string . IsNullOrWhiteSpace ( oldblock . MediaBlock . Video ? . File ? . VideoFile ? . File ? . FilePath ) )
4916+ {
4917+ retVal . Add ( oldblock . MediaBlock . Video . File . VideoFile . File . FilePath ) ;
4918+ }
4919+
4920+ if ( oldblock . MediaBlock ? . Video ? . File ? . VideoFile ? . TranscriptFile ? . File ? . FilePath != null )
4921+ {
4922+ retVal . Add ( oldblock . MediaBlock . Video . File . VideoFile . TranscriptFile . File . FilePath ) ;
49144923 }
49154924 }
49164925 }
You can’t perform that action at this time.
0 commit comments