mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Improve podcast search
This commit is contained in:
		
							parent
							
								
									97b5cf04f5
								
							
						
					
					
						commit
						cfb5e909a9
					
				@ -1,6 +1,6 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <ui-tooltip v-if="alreadyInLibrary" :text="$strings.LabelAlreadyInYourLibrary" direction="top">
 | 
					  <ui-tooltip v-if="alreadyInLibrary" :text="$strings.LabelAlreadyInYourLibrary" direction="top">
 | 
				
			||||||
    <span class="material-icons ml-1" style="font-size: 0.8rem">check_circle</span>
 | 
					    <span class="material-icons ml-1 text-success" style="font-size: 0.8rem">check_circle</span>
 | 
				
			||||||
  </ui-tooltip>
 | 
					  </ui-tooltip>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -155,6 +155,7 @@ export default {
 | 
				
			|||||||
        let podcast = this.existentPodcasts.find((p) => p.itunesId === result.id || p.title === result.title.toLowerCase())
 | 
					        let podcast = this.existentPodcasts.find((p) => p.itunesId === result.id || p.title === result.title.toLowerCase())
 | 
				
			||||||
        if (podcast) {
 | 
					        if (podcast) {
 | 
				
			||||||
          result.alreadyInLibrary = true
 | 
					          result.alreadyInLibrary = true
 | 
				
			||||||
 | 
					          result.existentId = podcast.id
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      this.results = results
 | 
					      this.results = results
 | 
				
			||||||
@ -163,12 +164,16 @@ export default {
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
    async selectPodcast(podcast) {
 | 
					    async selectPodcast(podcast) {
 | 
				
			||||||
      console.log('Selected podcast', podcast)
 | 
					      console.log('Selected podcast', podcast)
 | 
				
			||||||
 | 
					      if(podcast.existentId){
 | 
				
			||||||
 | 
					        this.$router.push(`/item/${podcast.existentId}`)
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      if (!podcast.feedUrl) {
 | 
					      if (!podcast.feedUrl) {
 | 
				
			||||||
        this.$toast.error('Invalid podcast - no feed')
 | 
					        this.$toast.error('Invalid podcast - no feed')
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      this.processing = true
 | 
					      this.processing = true
 | 
				
			||||||
      var payload = await this.$axios.$post(`/api/podcasts/feed`, { rssFeed: podcast.feedUrl }).catch((error) => {
 | 
					      var payload = await this.$axios.$post(`/api/podcasts/feed`, {rssFeed: podcast.feedUrl}).catch((error) => {
 | 
				
			||||||
        console.error('Failed to get feed', error)
 | 
					        console.error('Failed to get feed', error)
 | 
				
			||||||
        this.$toast.error('Failed to get podcast feed')
 | 
					        this.$toast.error('Failed to get podcast feed')
 | 
				
			||||||
        return null
 | 
					        return null
 | 
				
			||||||
@ -191,7 +196,8 @@ export default {
 | 
				
			|||||||
      this.existentPodcasts = podcasts.results.map((p) => {
 | 
					      this.existentPodcasts = podcasts.results.map((p) => {
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
          title: p.media.metadata.title.toLowerCase(),
 | 
					          title: p.media.metadata.title.toLowerCase(),
 | 
				
			||||||
          itunesId: p.media.metadata.itunesId
 | 
					          itunesId: p.media.metadata.itunesId,
 | 
				
			||||||
 | 
					          id: p.id
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
      this.processing = false
 | 
					      this.processing = false
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user