Implementing the previous commit
In main.go we are setting the default image path. and whenever we don't find the image through lastfm we pointhepath to default image in render.go
This commit is contained in:
		
							parent
							
								
									3195223e82
								
							
						
					
					
						commit
						2a2e6336e4
					
				
							
								
								
									
										1
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								main.go
									
									
									
									
									
								
							@ -35,6 +35,7 @@ func main() {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	defer CONN.Close()
 | 
						defer CONN.Close()
 | 
				
			||||||
	cache.SetCacheDir(viper.GetString("CACHE_DIR"))
 | 
						cache.SetCacheDir(viper.GetString("CACHE_DIR"))
 | 
				
			||||||
 | 
						cache.SetDefaultPath(viper.GetString("DEFAULT_IMAGE_PATH"))
 | 
				
			||||||
	cache.LoadCache(viper.GetString("CACHE_FILE"))
 | 
						cache.LoadCache(viper.GetString("CACHE_FILE"))
 | 
				
			||||||
	r := newRenderer()
 | 
						r := newRenderer()
 | 
				
			||||||
	c, _ := CONN.CurrentSong()
 | 
						c, _ := CONN.CurrentSong()
 | 
				
			||||||
 | 
				
			|||||||
@ -86,6 +86,8 @@ func getImagePath(path string) string {
 | 
				
			|||||||
				if err == nil {
 | 
									if err == nil {
 | 
				
			||||||
					NOTIFICATION_SERVER.Send("Image From LastFM")
 | 
										NOTIFICATION_SERVER.Send("Image From LastFM")
 | 
				
			||||||
					extractedImage = downloadedImage
 | 
										extractedImage = downloadedImage
 | 
				
			||||||
 | 
									} else {
 | 
				
			||||||
 | 
										cache.PointToDefault(a[0]["artist"], a[0]["album"])
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user