change iteration to only drop the bad shows. Will get more specific after we get a data dump of a bad example
This commit is contained in:
		
							parent
							
								
									68b7542bcb
								
							
						
					
					
						commit
						bcc8b05517
					
				
					 1 changed files with 16 additions and 8 deletions
				
			
		|  | @ -90,10 +90,14 @@ class SonarrAPI(object): | ||||||
|         if not get: |         if not get: | ||||||
|             return |             return | ||||||
| 
 | 
 | ||||||
|  |         tv_shows = [] | ||||||
|  |         for show in get: | ||||||
|             try: |             try: | ||||||
|             tv_shows = [SonarrTVShow(**show) for show in get] |                 show_tuple = SonarrTVShow(**show) | ||||||
|  |                 tv_shows.append(show_tuple) | ||||||
|             except TypeError as e: |             except TypeError as e: | ||||||
|             self.logger.error('TypeError has occurred : %s while creating SonarrTVShow structure', e) |                 self.logger.error('TypeError has occurred : %s while creating SonarrTVShow structure for show', e) | ||||||
|  |         if not tv_shows: | ||||||
|             return |             return | ||||||
| 
 | 
 | ||||||
|         for show in tv_shows: |         for show in tv_shows: | ||||||
|  | @ -140,10 +144,14 @@ class SonarrAPI(object): | ||||||
|         if not get: |         if not get: | ||||||
|             return |             return | ||||||
| 
 | 
 | ||||||
|  |         download_queue = [] | ||||||
|  |         for show in get: | ||||||
|             try: |             try: | ||||||
|             download_queue = [Queue(**show) for show in get] |                 show_tuple = Queue(**show) | ||||||
|  |                 download_queue.append(show_tuple) | ||||||
|             except TypeError as e: |             except TypeError as e: | ||||||
|                 self.logger.error('TypeError has occurred : %s while creating Queue structure', e) |                 self.logger.error('TypeError has occurred : %s while creating Queue structure', e) | ||||||
|  |         if not download_queue: | ||||||
|             return |             return | ||||||
| 
 | 
 | ||||||
|         for show in download_queue: |         for show in download_queue: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue