mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Invalidate count cache on entity update
This commit is contained in:
		
							parent
							
								
									0cc2e39367
								
							
						
					
					
						commit
						e8b60defb6
					
				@ -201,6 +201,10 @@ class Book extends Model {
 | 
			
		||||
    Book.addHook('afterCreate', async (instance) => {
 | 
			
		||||
      libraryItemsBookFilters.clearCountCache('afterCreate')
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    Book.addHook('afterUpdate', async (instance) => {
 | 
			
		||||
      libraryItemsBookFilters.clearCountCache('afterUpdate')
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
 | 
			
		||||
@ -157,6 +157,10 @@ class Podcast extends Model {
 | 
			
		||||
    Podcast.addHook('afterCreate', async (instance) => {
 | 
			
		||||
      libraryItemsPodcastFilters.clearCountCache('podcast', 'afterCreate')
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    Podcast.addHook('afterUpdate', async (instance) => {
 | 
			
		||||
      libraryItemsPodcastFilters.clearCountCache('podcast', 'afterUpdate')
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  get hasMediaFiles() {
 | 
			
		||||
 | 
			
		||||
@ -140,6 +140,10 @@ class PodcastEpisode extends Model {
 | 
			
		||||
    PodcastEpisode.addHook('afterCreate', async (instance) => {
 | 
			
		||||
      libraryItemsPodcastFilters.clearCountCache('podcastEpisode', 'afterCreate')
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    PodcastEpisode.addHook('afterUpdate', async (instance) => {
 | 
			
		||||
      libraryItemsPodcastFilters.clearCountCache('podcastEpisode', 'afterUpdate')
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  get size() {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user