fix dict check for lidarr
This commit is contained in:
		
							parent
							
								
									0bba242e72
								
							
						
					
					
						commit
						5827bb2c97
					
				
					 2 changed files with 7 additions and 5 deletions
				
			
		|  | @ -48,10 +48,12 @@ class LidarrAPI(object): | ||||||
| 
 | 
 | ||||||
|         # Add Album to missing list if album is not complete |         # Add Album to missing list if album is not complete | ||||||
|         for album in albums: |         for album in albums: | ||||||
|             if album.statistics['percentOfTracks'] != 100: |             percent_of_tracks = album.statistics.get('percentOfTracks', 0) | ||||||
|                 influx_albums.append((album.title, album.releaseDate, album.artist['artistName'], album.id, |             if percent_of_tracks != 100: | ||||||
|                                       album.statistics['percentOfTracks'], |                 influx_albums.append( | ||||||
|                                       f"{album.statistics['trackFileCount']}/{album.statistics['TrackCount']}")) |                     (album.title, album.releaseDate, album.artist['artistName'], album.id,percent_of_tracks, | ||||||
|  |                      f"{album.statistics.get('trackFileCount', 0)}/{album.statistics.get('trackCount', 0)}") | ||||||
|  |                 ) | ||||||
| 
 | 
 | ||||||
|         for title, release_date, artist_name, album_id, percent_complete, complete_count in influx_albums: |         for title, release_date, artist_name, album_id, percent_complete, complete_count in influx_albums: | ||||||
|             hash_id = hashit(f'{self.server.id}{title}{album_id}') |             hash_id = hashit(f'{self.server.id}{title}{album_id}') | ||||||
|  |  | ||||||
|  | @ -501,5 +501,5 @@ class LidarrAlbum(NamedTuple): | ||||||
|     artist: dict = None |     artist: dict = None | ||||||
|     images: list = None |     images: list = None | ||||||
|     links: list = None |     links: list = None | ||||||
|     statistics: dict = None |     statistics: dict = {} | ||||||
|     id: int = None |     id: int = None | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue