fix: resolved errors in formatting search results

This commit is contained in:
Roberto Tonino
2020-11-02 20:00:09 +01:00
parent 7f0d621f62
commit 738a2ff35e
5 changed files with 29 additions and 17 deletions

View File

@@ -44,7 +44,7 @@ import { sendAddToQueue } from '@/utils/downloads'
import { numberWithDots, convertDuration } from '@/utils/utils'
import EventBus from '@/utils/EventBus'
import { reduceSearchResults, formatSingleTrack, formatAlbums, formatArtist, formatPlaylist } from '@/data/search'
import { formatSearchResults, formatSingleTrack, formatAlbums, formatArtist, formatPlaylist } from '@/data/search'
const resetObj = { data: [], next: 0, total: 0, hasLoaded: false }
@@ -172,7 +172,7 @@ export default {
return this.results.allTab
}
return reduceSearchResults(this.results[this.currentTab.viewInfo], this.currentTab.formatFunc)
return formatSearchResults(this.results[this.currentTab.viewInfo], this.currentTab.formatFunc)
},
changeSearchTab(tabName) {
tabName = tabName.toLowerCase()

View File

@@ -30,28 +30,28 @@
<ResultsTracks
v-else-if="section === 'TRACK'"
:viewInfo="reduceSearchResults(viewInfo.TRACK, formatSingleTrack)"
:viewInfo="formatSearchResults(viewInfo.TRACK, formatSingleTrack)"
:itemsToShow="6"
@add-to-queue="$emit('add-to-queue', $event)"
/>
<ResultsAlbums
v-else-if="section == 'ALBUM'"
:viewInfo="reduceSearchResults(viewInfo.ALBUM, formatAlbums)"
:viewInfo="formatSearchResults(viewInfo.ALBUM, formatAlbums)"
:itemsToShow="6"
@add-to-queue="$emit('add-to-queue', $event)"
/>
<ResultsPlaylists
v-else-if="section == 'PLAYLIST'"
:viewInfo="reduceSearchResults(viewInfo.PLAYLIST, formatPlaylist)"
:viewInfo="formatSearchResults(viewInfo.PLAYLIST, formatPlaylist)"
:itemsToShow="6"
@add-to-queue="$emit('add-to-queue', $event)"
/>
<ResultsArtists
v-else-if="section === 'ARTIST'"
:viewInfo="reduceSearchResults(viewInfo.ARTIST, formatArtist)"
:viewInfo="formatSearchResults(viewInfo.ARTIST, formatArtist)"
:itemsToShow="6"
@add-to-queue="$emit('add-to-queue', $event)"
/>
@@ -81,7 +81,7 @@ import ResultsAlbums from '@components/search/ResultsAlbums.vue'
import ResultsArtists from '@components/search/ResultsArtists.vue'
import ResultsPlaylists from '@components/search/ResultsPlaylists.vue'
import { reduceSearchResults, formatSingleTrack, formatAlbums, formatArtist, formatPlaylist } from '@/data/search'
import { formatSearchResults, formatSingleTrack, formatAlbums, formatArtist, formatPlaylist } from '@/data/search'
export default {
components: {
@@ -130,7 +130,7 @@ export default {
methods: {
convertDuration,
upperCaseFirstLowerCaseRest,
reduceSearchResults,
formatSearchResults,
formatSingleTrack,
formatAlbums,
formatArtist,