Checking for the / at the back

This commit is contained in:
aditya-K2 2021-12-13 00:15:16 +05:30
parent 73aebcd0a0
commit 75d5d13fbe
2 changed files with 5 additions and 2 deletions

4
cache/cache.go vendored
View File

@ -5,6 +5,8 @@ import (
"fmt"
"os"
"strings"
"github.com/aditya-K2/goMP/config"
)
var (
@ -13,7 +15,7 @@ var (
)
func SetCacheDir(path string) {
CACHE_DIR = path
CACHE_DIR = config.CheckDirectoryFmt(path)
}
func Exists(artist, album string) bool {

View File

@ -2,6 +2,7 @@ package main
import (
"github.com/aditya-K2/goMP/cache"
"github.com/aditya-K2/goMP/config"
"github.com/spf13/viper"
"gitlab.com/diamondburned/ueberzug-go"
)
@ -79,7 +80,7 @@ func getImagePath(path string) string {
extractedImage = cache.GenerateName(a[0]["artist"], a[0]["album"])
} else {
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)
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)