+
-
-
@@ -329,14 +319,6 @@
-
-
+
+
+
+
@@ -365,12 +357,13 @@
-
+
yt-dlp Information
-
+
Local Information
@@ -383,7 +376,7 @@
-
+
@@ -391,7 +384,8 @@
-
+
@@ -400,6 +394,19 @@
+
+
+
@@ -408,8 +415,12 @@
+ emitter('clear_search')" v-if="query">
+ No results found for '{{ query }}'.
+
+ icon="fas fa-circle-check" v-else-if="socket.isConnected" />
@@ -446,12 +457,17 @@ import { getEmbedable, isEmbedable } from '~/utils/embedable'
import { formatBytes, makeDownload, uri } from '~/utils/index'
import Dropdown from './Dropdown.vue'
-const emitter = defineEmits(['getInfo', 'add_new', 'getItemInfo'])
+const emitter = defineEmits(['getInfo', 'add_new', 'getItemInfo', 'clear_search'])
const props = defineProps({
thumbnails: {
type: Boolean,
default: true
+ },
+ query: {
+ type: String,
+ required: false,
+ default: '',
}
})
@@ -461,34 +477,42 @@ const socket = useSocketStore()
const toast = useNotification()
const box = useConfirm()
-const selectedElms = ref([])
-const masterSelectAll = ref(false)
const showCompleted = useStorage('showCompleted', true)
const hideThumbnail = useStorage('hideThumbnailHistory', false)
const direction = useStorage('sortCompleted', 'desc')
const display_style = useStorage('display_style', 'cards')
-const table_container = ref(false)
+const bg_enable = useStorage('random_bg', true)
+const bg_opacity = useStorage('random_bg_opacity', 0.85)
+const selectedElms = ref([])
+const masterSelectAll = ref(false)
+const table_container = ref(false)
const embed_url = ref('')
const video_item = ref(null)
-
const dialog_confirm = ref({
visible: false,
title: 'Confirm Action',
- confirm: (opts) => { },
+ confirm: () => { },
message: '',
options: [
{ key: 'remove_history', label: 'Also, Remove from history.' },
],
})
+const showThumbnails = computed(() => props.thumbnails && !hideThumbnail.value)
+
const playVideo = item => video_item.value = item
const closeVideo = () => video_item.value = null
-const showThumbnails = computed(() => props.thumbnails && !hideThumbnail.value)
+const filteredItems = items => !props.query ? items : items.filter(filterItem)
-const bg_enable = useStorage('random_bg', true)
-const bg_opacity = useStorage('random_bg_opacity', 0.85)
+const filterItem = item => {
+ const q = props.query?.toLowerCase()
+ if (!q) {
+ return true
+ }
+ return Object.values(item).some(v => typeof v === 'string' && v.toLowerCase().includes(q))
+}
watch(masterSelectAll, (value) => {
for (const key in stateStore.history) {
@@ -512,7 +536,7 @@ const sortCompleted = computed(() => {
})
const hasSelected = computed(() => selectedElms.value.length > 0)
-const hasItems = computed(() => stateStore.count('history') > 0)
+const hasItems = computed(() => filteredItems(sortCompleted.value).length > 0)
const showMessage = (item) => {
if (!item?.msg || item.msg === item?.error) {
diff --git a/ui/components/Queue.vue b/ui/components/Queue.vue
index d844d445..25f86c0b 100644
--- a/ui/components/Queue.vue
+++ b/ui/components/Queue.vue
@@ -4,12 +4,12 @@
-
Queue ({{ stateStore.count('queue') }})
+
Queue ({{ filteredItems.length }})
-
+
-
-
+
+
@@ -58,7 +58,7 @@
-
+
|
|
-
-
-
-
-
-
-
-
-
-
-
+ Play video
+
+
+
+
+
+
+ Cancel Item
+
+
+
+
+
+
+ yt-dlp Information
+
+
+
+
+ Local Information
+
+
|
@@ -135,8 +143,8 @@
-
+ v-for="item in filteredItems" :key="item._id">
+