Skip to content

Commit

Permalink
fix artist-folder
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaarey committed Jun 6, 2024
1 parent 8628931 commit 8251a7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1163,9 +1163,8 @@ func rip(albumId string, token string, storefront string, userToken string) erro
fmt.Println("Failed to get album metadata.\n")
return err
}
singerFolder:=""
var singerFoldername string
if config.ArtistFolderFormat != ""{
var singerFoldername string
if strings.Contains(albumId, "pl.") {
singerFoldername = strings.NewReplacer(
"{ArtistName}", "Apple Music",
Expand All @@ -1182,8 +1181,8 @@ func rip(albumId string, token string, storefront string, userToken string) erro
}
singerFoldername = strings.TrimSpace(singerFoldername)
fmt.Println(singerFoldername)
singerFolder = filepath.Join(config.AlacSaveFolder, forbiddenNames.ReplaceAllString(singerFoldername, "_"))
}
singerFolder := filepath.Join(config.AlacSaveFolder, forbiddenNames.ReplaceAllString(singerFoldername, "_"))
manifest1, err := getInfoFromAdam(meta.Data[0].Relationships.Tracks.Data[0].ID, token, storefront)
if err != nil {
fmt.Println("Failed to get manifest.\n", err)
Expand Down
5 changes: 2 additions & 3 deletions main_atmos.go
Original file line number Diff line number Diff line change
Expand Up @@ -1123,9 +1123,8 @@ func rip(albumId string, token string, storefront string, userToken string) erro
fmt.Println("Failed to get album metadata.\n")
return err
}
singerFolder:=""
var singerFoldername string
if config.ArtistFolderFormat != ""{
var singerFoldername string
if strings.Contains(albumId, "pl.") {
singerFoldername = strings.NewReplacer(
"{ArtistName}", "Apple Music",
Expand All @@ -1142,8 +1141,8 @@ func rip(albumId string, token string, storefront string, userToken string) erro
}
singerFoldername = strings.TrimSpace(singerFoldername)
fmt.Println(singerFoldername)
singerFolder = filepath.Join(config.AlacSaveFolder, forbiddenNames.ReplaceAllString(singerFoldername, "_"))
}
singerFolder := filepath.Join(config.AtmosSaveFolder, forbiddenNames.ReplaceAllString(singerFoldername, "_"))
var albumFolder string
Quality:=fmt.Sprintf("%dkbps", config.AtmosMax-2000)
if config.AddCodec{
Expand Down
5 changes: 2 additions & 3 deletions main_select.go
Original file line number Diff line number Diff line change
Expand Up @@ -1125,9 +1125,8 @@ func rip(albumId string, token string, storefront string, userToken string) erro
fmt.Println("Failed to get album metadata.\n")
return err
}
singerFolder:=""
var singerFoldername string
if config.ArtistFolderFormat != ""{
var singerFoldername string
if strings.Contains(albumId, "pl.") {
singerFoldername = strings.NewReplacer(
"{ArtistName}", "Apple Music",
Expand All @@ -1144,8 +1143,8 @@ func rip(albumId string, token string, storefront string, userToken string) erro
}
singerFoldername = strings.TrimSpace(singerFoldername)
fmt.Println(singerFoldername)
singerFolder = filepath.Join(config.AlacSaveFolder, forbiddenNames.ReplaceAllString(singerFoldername, "_"))
}
singerFolder := filepath.Join(config.AlacSaveFolder, forbiddenNames.ReplaceAllString(singerFoldername, "_"))
var albumFolder string
if strings.Contains(albumId, "pl.") {
albumFolder = strings.NewReplacer(
Expand Down

0 comments on commit 8251a7c

Please sign in to comment.