File tree Expand file tree Collapse file tree
Arrowgene.Ddon.Client/Files/Client
Arrowgene.Ddon.Cli/Command Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
33using System . IO ;
4+ using System . Linq ;
45using System . Text ;
56using System . Text . Json ;
67using Arrowgene . Ddon . Client ;
@@ -219,16 +220,27 @@ public CommandResultType Run(CommandParameter parameter)
219220 foreach ( GuiMessage . Entry entry in gmd . Entries )
220221 {
221222 GmdCsv . Entry matchCsvEntry = null ;
223+ List < GmdCsv . Entry > keyMatches = new ( ) ;
224+ List < GmdCsv . Entry > indexMatches = new ( ) ;
222225 foreach ( GmdCsv . Entry csvEntry in gmdCsvEntries )
223226 {
224- if ( ! string . IsNullOrEmpty ( entry . Key ) && csvEntry . Key == entry . Key && entry . ReadIndex == csvEntry . ReadIndex )
227+ if ( ! string . IsNullOrEmpty ( entry . Key ) && csvEntry . Key == entry . Key )
225228 {
226- // Both key AND index have to match, because there are gui entries with duplicate keys.
227- matchCsvEntry = csvEntry ;
228- break ;
229+ keyMatches . Add ( csvEntry ) ;
230+ continue ;
231+ }
232+
233+ if ( entry . ReadIndex == csvEntry . ReadIndex )
234+ {
235+ indexMatches . Add ( csvEntry ) ;
236+ continue ;
229237 }
230238 }
231239
240+ matchCsvEntry = keyMatches . Where ( x => x . ReadIndex == entry . ReadIndex ) . FirstOrDefault ( )
241+ ?? keyMatches . FirstOrDefault ( )
242+ ?? indexMatches . FirstOrDefault ( ) ;
243+
232244 if ( matchCsvEntry == null )
233245 {
234246 Logger . Info (
You can’t perform that action at this time.
0 commit comments