@@ -63,13 +63,14 @@ public List<Result> Query(Query query)
6363 {
6464 var displayData = query . Search . Trim ( ) . Length == 0
6565 ? _dataList
66- : _dataList . Where ( i => ! string . IsNullOrEmpty ( i . Text ) && i . Text . ToLower ( ) . Contains ( query . Search . Trim ( ) . ToLower ( ) ) ) ;
66+ : _dataList . Where ( i =>
67+ ! string . IsNullOrEmpty ( i . Text ) && i . Text . ToLower ( ) . Contains ( query . Search . Trim ( ) . ToLower ( ) ) ) ;
6768
6869 var results = new List < Result > ( ) ;
6970 results . AddRange ( displayData . Select ( o => new Result
7071 {
7172 Title = o . DisplayTitle ,
72- SubTitle = o . SenderApp ,
73+ SubTitle = $ " { o . Score } " ,
7374 // IcoPath = o.IconPath,
7475 Icon = ( ) => o . Icon ,
7576 CopyText = o . Text ,
@@ -113,7 +114,7 @@ private void _OnClipboardChange(object? sender, SharpClipboard.ClipboardChangedE
113114 IconPath = _defaultIconPath ,
114115 Icon = new BitmapImage ( new Uri ( _defaultIconPath , UriKind . RelativeOrAbsolute ) ) ,
115116 PreviewImagePath = _defaultIconPath ,
116- Score = CurrentScore ++ ,
117+ Score = CurrentScore ,
117118 } ;
118119 switch ( e . ContentType )
119120 {
@@ -151,11 +152,13 @@ private void _OnClipboardChange(object? sender, SharpClipboard.ClipboardChangedE
151152 ? clipboardData . Text [ ..MaxTitleLength ] . Trim ( ) + "..."
152153 : clipboardData . Text ;
153154
155+ // make sure no repeat
156+ if ( _dataList . Any ( node => node . Equals ( clipboardData ) ) )
157+ return ;
154158 _dataList . AddFirst ( clipboardData ) ;
155159 if ( _dataList . Count > MaxDataCount )
156- {
157160 _dataList . RemoveLast ( ) ;
158- }
161+ CurrentScore ++ ;
159162 }
160163
161164 private string ? SaveImageCache ( ClipboardData clipboardData )
0 commit comments