mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Merge pull request #561 from jflattery/main
Add support for seasonal podcasts
This commit is contained in:
		
						commit
						c8c7a9ece5
					
				@ -40,6 +40,10 @@ export default {
 | 
			
		||||
          text: 'Title',
 | 
			
		||||
          value: 'title'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          text: 'Season',
 | 
			
		||||
          value: 'season'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          text: 'Episode',
 | 
			
		||||
          value: 'episode'
 | 
			
		||||
 | 
			
		||||
@ -7,13 +7,16 @@
 | 
			
		||||
    </template>
 | 
			
		||||
    <div ref="wrapper" class="p-4 w-full text-sm py-2 rounded-lg bg-bg shadow-lg border border-black-300 relative overflow-hidden">
 | 
			
		||||
      <div class="flex flex-wrap">
 | 
			
		||||
        <div class="w-1/3 p-1">
 | 
			
		||||
        <div class="w-1/5 p-1">
 | 
			
		||||
          <ui-text-input-with-label v-model="newEpisode.season" label="Season" />
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="w-1/5 p-1">
 | 
			
		||||
          <ui-text-input-with-label v-model="newEpisode.episode" label="Episode" />
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="w-1/3 p-1">
 | 
			
		||||
        <div class="w-1/5 p-1">
 | 
			
		||||
          <ui-text-input-with-label v-model="newEpisode.episodeType" label="Episode Type" />
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="w-1/3 p-1">
 | 
			
		||||
        <div class="w-2/5 p-1">
 | 
			
		||||
          <ui-text-input-with-label v-model="pubDateInput" @input="updatePubDate" type="datetime-local" label="Pub Date" />
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="w-full p-1">
 | 
			
		||||
@ -39,6 +42,7 @@ export default {
 | 
			
		||||
    return {
 | 
			
		||||
      processing: false,
 | 
			
		||||
      newEpisode: {
 | 
			
		||||
        season: null,
 | 
			
		||||
        episode: null,
 | 
			
		||||
        episodeType: null,
 | 
			
		||||
        title: null,
 | 
			
		||||
@ -92,6 +96,7 @@ export default {
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    init() {
 | 
			
		||||
      this.newEpisode.season = this.episode.season || ''
 | 
			
		||||
      this.newEpisode.episode = this.episode.episode || ''
 | 
			
		||||
      this.newEpisode.episodeType = this.episode.episodeType || ''
 | 
			
		||||
      this.newEpisode.title = this.episode.title || ''
 | 
			
		||||
 | 
			
		||||
@ -20,6 +20,7 @@
 | 
			
		||||
          <ui-tooltip :text="userIsFinished ? 'Mark as Not Finished' : 'Mark as Finished'" direction="top">
 | 
			
		||||
            <ui-read-icon-btn :disabled="isProcessingReadUpdate" :is-read="userIsFinished" borderless class="mx-1 mt-0.5" @click="toggleFinished" />
 | 
			
		||||
          </ui-tooltip>
 | 
			
		||||
          <p v-if="episode.season" class="px-4 text-sm text-gray-300">Season #{{ episode.season }}</p>
 | 
			
		||||
          <p v-if="episode.episode" class="px-4 text-sm text-gray-300">Episode #{{ episode.episode }}</p>
 | 
			
		||||
          <p v-if="publishedAt" class="px-4 text-sm text-gray-300">Published {{ $formatDate(publishedAt, 'MMM do, yyyy') }}</p>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
@ -9,6 +9,7 @@ class PodcastEpisode {
 | 
			
		||||
    this.id = null
 | 
			
		||||
    this.index = null
 | 
			
		||||
 | 
			
		||||
    this.season = null
 | 
			
		||||
    this.episode = null
 | 
			
		||||
    this.episodeType = null
 | 
			
		||||
    this.title = null
 | 
			
		||||
@ -31,6 +32,7 @@ class PodcastEpisode {
 | 
			
		||||
    this.libraryItemId = episode.libraryItemId
 | 
			
		||||
    this.id = episode.id
 | 
			
		||||
    this.index = episode.index
 | 
			
		||||
    this.season = episode.season
 | 
			
		||||
    this.episode = episode.episode
 | 
			
		||||
    this.episodeType = episode.episodeType
 | 
			
		||||
    this.title = episode.title
 | 
			
		||||
@ -51,6 +53,7 @@ class PodcastEpisode {
 | 
			
		||||
      libraryItemId: this.libraryItemId,
 | 
			
		||||
      id: this.id,
 | 
			
		||||
      index: this.index,
 | 
			
		||||
      season: this.season,
 | 
			
		||||
      episode: this.episode,
 | 
			
		||||
      episodeType: this.episodeType,
 | 
			
		||||
      title: this.title,
 | 
			
		||||
@ -70,6 +73,7 @@ class PodcastEpisode {
 | 
			
		||||
      libraryItemId: this.libraryItemId,
 | 
			
		||||
      id: this.id,
 | 
			
		||||
      index: this.index,
 | 
			
		||||
      season: this.season,
 | 
			
		||||
      episode: this.episode,
 | 
			
		||||
      episodeType: this.episodeType,
 | 
			
		||||
      title: this.title,
 | 
			
		||||
@ -117,6 +121,7 @@ class PodcastEpisode {
 | 
			
		||||
    this.pubDate = data.pubDate || ''
 | 
			
		||||
    this.description = data.description || ''
 | 
			
		||||
    this.enclosure = data.enclosure ? { ...data.enclosure } : null
 | 
			
		||||
    this.season = data.season || ''
 | 
			
		||||
    this.episode = data.episode || ''
 | 
			
		||||
    this.episodeType = data.episodeType || ''
 | 
			
		||||
    this.publishedAt = data.publishedAt || 0
 | 
			
		||||
 | 
			
		||||
@ -85,7 +85,7 @@ function extractEpisodeData(item) {
 | 
			
		||||
    episode.descriptionPlain = stripHtml(episode.description || '').result
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  var arrayFields = ['title', 'pubDate', 'itunes:episodeType', 'itunes:episode', 'itunes:author', 'itunes:duration', 'itunes:explicit', 'itunes:subtitle']
 | 
			
		||||
  var arrayFields = ['title', 'pubDate', 'itunes:episodeType', 'itunes:season', 'itunes:episode', 'itunes:author', 'itunes:duration', 'itunes:explicit', 'itunes:subtitle']
 | 
			
		||||
  arrayFields.forEach((key) => {
 | 
			
		||||
    var cleanKey = key.split(':').pop()
 | 
			
		||||
    episode[cleanKey] = extractFirstArrayItem(item, key)
 | 
			
		||||
@ -101,6 +101,7 @@ function cleanEpisodeData(data) {
 | 
			
		||||
    descriptionPlain: data.descriptionPlain || '',
 | 
			
		||||
    pubDate: data.pubDate || '',
 | 
			
		||||
    episodeType: data.episodeType || '',
 | 
			
		||||
    season: data.season || '',
 | 
			
		||||
    episode: data.episode || '',
 | 
			
		||||
    author: data.author || '',
 | 
			
		||||
    duration: data.duration || '',
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user