This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit 1674a34 committed Jan 9, 2024 Verified
1 parent 0179c0f commit 1674a34 Copy full SHA for 1674a34
File tree 3 files changed +41
-8
lines changed
src/renderer/components/ft-playlist-add-video-prompt
3 files changed +41
-8
lines changed Original file line number Diff line number Diff line change 16
16
flex-direction : column;
17
17
}
18
18
19
+ .searchInputsRow {
20
+ display : grid;
21
+
22
+ /* 2 columns */
23
+ grid-template-columns : 1fr auto;
24
+ column-gap : 16px ;
25
+
26
+ @media only screen and (max-width : 800px ) {
27
+ /* Switch to 2 rows from 2 columns */
28
+ grid-template-columns : auto;
29
+ grid-template-rows : auto auto;
30
+ }
31
+ }
32
+
19
33
.sortSelect {
20
34
/* Put it on the right */
21
35
margin-inline-start : auto;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import FtButton from '../ft-button/ft-button.vue'
7
7
import FtPlaylistSelector from '../ft-playlist-selector/ft-playlist-selector.vue'
8
8
import FtInput from '../../components/ft-input/ft-input.vue'
9
9
import FtSelect from '../../components/ft-select/ft-select.vue'
10
+ import FtToggleSwitch from '../../components/ft-toggle-switch/ft-toggle-switch.vue'
10
11
import {
11
12
showToast ,
12
13
} from '../../helpers/utils'
@@ -31,12 +32,14 @@ export default defineComponent({
31
32
'ft-playlist-selector' : FtPlaylistSelector ,
32
33
'ft-input' : FtInput ,
33
34
'ft-select' : FtSelect ,
35
+ 'ft-toggle-switch' : FtToggleSwitch ,
34
36
} ,
35
37
data : function ( ) {
36
38
return {
37
39
selectedPlaylistIdList : [ ] ,
38
40
createdSincePromptShownPlaylistIdList : [ ] ,
39
41
query : '' ,
42
+ doSearchPlaylistsWithMatchingVideos : false ,
40
43
updateQueryDebounce : function ( ) { } ,
41
44
lastShownAt : Date . now ( ) ,
42
45
lastActiveElement : null ,
@@ -115,6 +118,12 @@ export default defineComponent({
115
118
return this . allPlaylists . filter ( ( playlist ) => {
116
119
if ( typeof ( playlist . playlistName ) !== 'string' ) { return false }
117
120
121
+ if ( this . doSearchPlaylistsWithMatchingVideos ) {
122
+ if ( playlist . videos . some ( ( v ) => v . title . toLowerCase ( ) . includes ( this . processedQuery ) ) ) {
123
+ return true
124
+ }
125
+ }
126
+
118
127
return playlist . playlistName . toLowerCase ( ) . includes ( this . processedQuery )
119
128
} )
120
129
} ,
Original file line number Diff line number Diff line change 12
12
playlistCount: selectedPlaylistCount,
13
13
}) }}
14
14
</p >
15
- <ft-input
16
- ref =" searchBar"
17
- :placeholder =" $t('User Playlists.AddVideoPrompt.Search in Playlists')"
18
- :show-clear-text-button =" true"
19
- :show-action-button =" false"
20
- @input =" (input) => updateQueryDebounce(input)"
21
- @clear =" updateQueryDebounce('')"
22
- />
15
+ <div
16
+ class =" searchInputsRow"
17
+ >
18
+ <ft-input
19
+ ref =" searchBar"
20
+ :placeholder =" $t('User Playlists.AddVideoPrompt.Search in Playlists')"
21
+ :show-clear-text-button =" true"
22
+ :show-action-button =" false"
23
+ @input =" (input) => updateQueryDebounce(input)"
24
+ @clear =" updateQueryDebounce('')"
25
+ />
26
+ <ft-toggle-switch
27
+ :label =" $t('User Playlists.Search in Videos')"
28
+ :compact =" true"
29
+ :default-value =" doSearchPlaylistsWithMatchingVideos"
30
+ @change =" doSearchPlaylistsWithMatchingVideos = !doSearchPlaylistsWithMatchingVideos"
31
+ />
32
+ </div >
23
33
<ft-select
24
34
v-if =" allPlaylists.length > 1"
25
35
class =" sortSelect"
You can’t perform that action at this time.
0 commit comments