Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1674a34

Browse files
committedJan 9, 2024
* Update add videos to playlists prompt to add search playlists with matching videos function
1 parent 0179c0f commit 1674a34

File tree

3 files changed

+41
-8
lines changed

3 files changed

+41
-8
lines changed
 

‎src/renderer/components/ft-playlist-add-video-prompt/ft-playlist-add-video-prompt.css

+14
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@
1616
flex-direction: column;
1717
}
1818

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+
1933
.sortSelect {
2034
/* Put it on the right */
2135
margin-inline-start: auto;

‎src/renderer/components/ft-playlist-add-video-prompt/ft-playlist-add-video-prompt.js

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import FtButton from '../ft-button/ft-button.vue'
77
import FtPlaylistSelector from '../ft-playlist-selector/ft-playlist-selector.vue'
88
import FtInput from '../../components/ft-input/ft-input.vue'
99
import FtSelect from '../../components/ft-select/ft-select.vue'
10+
import FtToggleSwitch from '../../components/ft-toggle-switch/ft-toggle-switch.vue'
1011
import {
1112
showToast,
1213
} from '../../helpers/utils'
@@ -31,12 +32,14 @@ export default defineComponent({
3132
'ft-playlist-selector': FtPlaylistSelector,
3233
'ft-input': FtInput,
3334
'ft-select': FtSelect,
35+
'ft-toggle-switch': FtToggleSwitch,
3436
},
3537
data: function () {
3638
return {
3739
selectedPlaylistIdList: [],
3840
createdSincePromptShownPlaylistIdList: [],
3941
query: '',
42+
doSearchPlaylistsWithMatchingVideos: false,
4043
updateQueryDebounce: function() {},
4144
lastShownAt: Date.now(),
4245
lastActiveElement: null,
@@ -115,6 +118,12 @@ export default defineComponent({
115118
return this.allPlaylists.filter((playlist) => {
116119
if (typeof (playlist.playlistName) !== 'string') { return false }
117120

121+
if (this.doSearchPlaylistsWithMatchingVideos) {
122+
if (playlist.videos.some((v) => v.title.toLowerCase().includes(this.processedQuery))) {
123+
return true
124+
}
125+
}
126+
118127
return playlist.playlistName.toLowerCase().includes(this.processedQuery)
119128
})
120129
},

‎src/renderer/components/ft-playlist-add-video-prompt/ft-playlist-add-video-prompt.vue

+18-8
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,24 @@
1212
playlistCount: selectedPlaylistCount,
1313
}) }}
1414
</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>
2333
<ft-select
2434
v-if="allPlaylists.length > 1"
2535
class="sortSelect"

0 commit comments

Comments
 (0)
Please sign in to comment.