File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed
components/ft-playlist-add-video-prompt Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ export default defineComponent({
119
119
if ( typeof ( playlist . playlistName ) !== 'string' ) { return false }
120
120
121
121
if ( this . doSearchPlaylistsWithMatchingVideos ) {
122
- if ( playlist . videos . some ( ( v ) => v . title . toLowerCase ( ) . includes ( this . processedQuery ) ) ) {
122
+ if ( playlist . videos . some ( ( v ) => v . author . toLowerCase ( ) . includes ( this . processedQuery ) || v . title . toLowerCase ( ) . includes ( this . processedQuery ) ) ) {
123
123
return true
124
124
}
125
125
}
Original file line number Diff line number Diff line change @@ -93,11 +93,13 @@ export default defineComponent({
93
93
} else {
94
94
const lowerCaseQuery = this . query . toLowerCase ( )
95
95
const filteredQuery = this . historyCacheSorted . filter ( ( video ) => {
96
- if ( typeof ( video . title ) !== 'string' || typeof ( video . author ) !== 'string' ) {
97
- return false
98
- } else {
99
- return video . title . toLowerCase ( ) . includes ( lowerCaseQuery ) || video . author . toLowerCase ( ) . includes ( lowerCaseQuery )
96
+ if ( typeof ( video . title ) === 'string' && video . title . toLowerCase ( ) . includes ( lowerCaseQuery ) ) {
97
+ return true
98
+ } else if ( typeof ( video . author ) === 'string' && video . author . toLowerCase ( ) . includes ( lowerCaseQuery ) ) {
99
+ return true
100
100
}
101
+
102
+ return false
101
103
} ) . sort ( ( a , b ) => {
102
104
return b . timeWatched - a . timeWatched
103
105
} )
Original file line number Diff line number Diff line change @@ -142,7 +142,13 @@ export default defineComponent({
142
142
if ( this . processedVideoSearchQuery === '' ) { return this . playlistItems }
143
143
144
144
return this . playlistItems . filter ( ( v ) => {
145
- return v . title . toLowerCase ( ) . includes ( this . processedVideoSearchQuery )
145
+ if ( typeof ( v . title ) === 'string' && v . title . toLowerCase ( ) . includes ( this . processedVideoSearchQuery ) ) {
146
+ return true
147
+ } else if ( typeof ( v . author ) === 'string' && v . author . toLowerCase ( ) . includes ( this . processedVideoSearchQuery ) ) {
148
+ return true
149
+ }
150
+
151
+ return false
146
152
} )
147
153
} ,
148
154
visiblePlaylistItems : function ( ) {
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ export default defineComponent({
223
223
if ( typeof ( playlist . playlistName ) !== 'string' ) { return false }
224
224
225
225
if ( this . doSearchPlaylistsWithMatchingVideos ) {
226
- if ( playlist . videos . some ( ( v ) => v . title . toLowerCase ( ) . includes ( this . lowerCaseQuery ) ) ) {
226
+ if ( playlist . videos . some ( ( v ) => v . author . toLowerCase ( ) . includes ( this . lowerCaseQuery ) || v . title . toLowerCase ( ) . includes ( this . lowerCaseQuery ) ) ) {
227
227
return true
228
228
}
229
229
}
You can’t perform that action at this time.
0 commit comments