Checking for the / at the back
This commit is contained in:
		
							parent
							
								
									73aebcd0a0
								
							
						
					
					
						commit
						75d5d13fbe
					
				
							
								
								
									
										4
									
								
								cache/cache.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								cache/cache.go
									
									
									
									
										vendored
									
									
								
							@ -5,6 +5,8 @@ import (
 | 
				
			|||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/aditya-K2/goMP/config"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var (
 | 
					var (
 | 
				
			||||||
@ -13,7 +15,7 @@ var (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func SetCacheDir(path string) {
 | 
					func SetCacheDir(path string) {
 | 
				
			||||||
	CACHE_DIR = path
 | 
						CACHE_DIR = config.CheckDirectoryFmt(path)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func Exists(artist, album string) bool {
 | 
					func Exists(artist, album string) bool {
 | 
				
			||||||
 | 
				
			|||||||
@ -2,6 +2,7 @@ package main
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"github.com/aditya-K2/goMP/cache"
 | 
						"github.com/aditya-K2/goMP/cache"
 | 
				
			||||||
 | 
						"github.com/aditya-K2/goMP/config"
 | 
				
			||||||
	"github.com/spf13/viper"
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
	"gitlab.com/diamondburned/ueberzug-go"
 | 
						"gitlab.com/diamondburned/ueberzug-go"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@ -79,7 +80,7 @@ func getImagePath(path string) string {
 | 
				
			|||||||
			extractedImage = cache.GenerateName(a[0]["artist"], a[0]["album"])
 | 
								extractedImage = cache.GenerateName(a[0]["artist"], a[0]["album"])
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			imagePath := cache.GenerateName(a[0]["artist"], a[0]["album"])
 | 
								imagePath := cache.GenerateName(a[0]["artist"], a[0]["album"])
 | 
				
			||||||
			absPath := viper.GetString("MUSIC_DIRECTORY") + path
 | 
								absPath := config.CheckDirectoryFmt(viper.GetString("MUSIC_DIRECTORY")) + path
 | 
				
			||||||
			extractedImage = extractImageFromFile(absPath, imagePath)
 | 
								extractedImage = extractImageFromFile(absPath, imagePath)
 | 
				
			||||||
			if extractedImage == viper.GetString("DEFAULT_IMAGE_PATH") && viper.GetString("GET_COVER_ART_FROM_LAST_FM") == "TRUE" {
 | 
								if extractedImage == viper.GetString("DEFAULT_IMAGE_PATH") && viper.GetString("GET_COVER_ART_FROM_LAST_FM") == "TRUE" {
 | 
				
			||||||
				downloadedImage, err := getImageFromLastFM(a[0]["artist"], a[0]["album"], imagePath)
 | 
									downloadedImage, err := getImageFromLastFM(a[0]["artist"], a[0]["album"], imagePath)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user