feat: agregar búsqueda de canciones y configurar hook de Gitea Actions
- Agregar componente SearchFilter.client.vue modular y expandible - Integrar búsqueda en MainContainer con contador de resultados - Implementar filtrado de canciones por nombre en pages/index.vue - Configurar hook PostToolUse para monitorear Gitea Actions - Copiar y adaptar script monitor-gitea-action.sh para repodructor
This commit is contained in:
@@ -7,11 +7,13 @@
|
||||
/>
|
||||
|
||||
<!-- Main Container -->
|
||||
<MainContainer
|
||||
<MainContainer
|
||||
:current-track="currentTrack"
|
||||
:is-playing="isPlaying"
|
||||
:filtered-count="filteredCount"
|
||||
@shuffle-changed="handleShuffleChanged"
|
||||
@repeat-changed="handleRepeatChanged"
|
||||
@search="handleSearch"
|
||||
>
|
||||
<!-- Track List -->
|
||||
<TrackList
|
||||
@@ -91,16 +93,41 @@ const isShuffled = useLocalStorage('shuffle', false)
|
||||
const repeatMode = useLocalStorage('repeat', 'none') // 'none', 'all', 'one'
|
||||
const shuffledIndices = ref([])
|
||||
|
||||
// Search state
|
||||
const searchQuery = ref('')
|
||||
|
||||
// Refs
|
||||
const audioPlayer = ref(null)
|
||||
|
||||
// Computed - removed progressPercent as it's not used in this component
|
||||
|
||||
const displayTracks = computed(() => {
|
||||
if (isShuffled.value && shuffledIndices.value.length > 0) {
|
||||
return shuffledIndices.value.map(index => tracks.value[index])
|
||||
let tracksToDisplay = tracks.value
|
||||
|
||||
// Aplicar filtro de búsqueda
|
||||
if (searchQuery.value.length > 0) {
|
||||
tracksToDisplay = tracksToDisplay.filter(track =>
|
||||
track.name.toLowerCase().includes(searchQuery.value)
|
||||
)
|
||||
}
|
||||
return tracks.value
|
||||
|
||||
// Aplicar shuffle si está activado
|
||||
if (isShuffled.value && shuffledIndices.value.length > 0) {
|
||||
const shuffledTracks = shuffledIndices.value
|
||||
.map(index => tracks.value[index])
|
||||
.filter(track =>
|
||||
searchQuery.value.length === 0 ||
|
||||
track.name.toLowerCase().includes(searchQuery.value)
|
||||
)
|
||||
return shuffledTracks
|
||||
}
|
||||
|
||||
return tracksToDisplay
|
||||
})
|
||||
|
||||
const filteredCount = computed(() => {
|
||||
if (searchQuery.value.length === 0) return null
|
||||
return displayTracks.value.length
|
||||
})
|
||||
|
||||
// Methods
|
||||
@@ -293,6 +320,10 @@ const handleRepeatChanged = (mode) => {
|
||||
repeatMode.value = mode
|
||||
}
|
||||
|
||||
const handleSearch = (query) => {
|
||||
searchQuery.value = query
|
||||
}
|
||||
|
||||
const handleTrackSelected = ({ track, index }) => {
|
||||
playTrack(track, index)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user