fix Various Artists
This commit is contained in:
parent
76e2693baa
commit
b2bf894d03
7
main.go
7
main.go
@ -1300,11 +1300,16 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
|||||||
"{ArtistName}", "Apple Music",
|
"{ArtistName}", "Apple Music",
|
||||||
"{ArtistId}", "",
|
"{ArtistId}", "",
|
||||||
).Replace(config.ArtistFolderFormat)
|
).Replace(config.ArtistFolderFormat)
|
||||||
} else {
|
} else if len(meta.Data[0].Relationships.Artists.Data) > 0 {
|
||||||
singerFoldername = strings.NewReplacer(
|
singerFoldername = strings.NewReplacer(
|
||||||
"{ArtistName}", meta.Data[0].Attributes.ArtistName,
|
"{ArtistName}", meta.Data[0].Attributes.ArtistName,
|
||||||
"{ArtistId}", meta.Data[0].Relationships.Artists.Data[0].ID,
|
"{ArtistId}", meta.Data[0].Relationships.Artists.Data[0].ID,
|
||||||
).Replace(config.ArtistFolderFormat)
|
).Replace(config.ArtistFolderFormat)
|
||||||
|
} else {
|
||||||
|
singerFoldername = strings.NewReplacer(
|
||||||
|
"{ArtistName}", meta.Data[0].Attributes.ArtistName,
|
||||||
|
"{ArtistId}", "",
|
||||||
|
).Replace(config.ArtistFolderFormat)
|
||||||
}
|
}
|
||||||
if strings.HasSuffix(singerFoldername, ".") {
|
if strings.HasSuffix(singerFoldername, ".") {
|
||||||
singerFoldername = strings.ReplaceAll(singerFoldername, ".", "")
|
singerFoldername = strings.ReplaceAll(singerFoldername, ".", "")
|
||||||
|
@ -1246,11 +1246,16 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
|||||||
"{ArtistName}", "Apple Music",
|
"{ArtistName}", "Apple Music",
|
||||||
"{ArtistId}", "",
|
"{ArtistId}", "",
|
||||||
).Replace(config.ArtistFolderFormat)
|
).Replace(config.ArtistFolderFormat)
|
||||||
} else {
|
} else if len(meta.Data[0].Relationships.Artists.Data) > 0 {
|
||||||
singerFoldername = strings.NewReplacer(
|
singerFoldername = strings.NewReplacer(
|
||||||
"{ArtistName}", meta.Data[0].Attributes.ArtistName,
|
"{ArtistName}", meta.Data[0].Attributes.ArtistName,
|
||||||
"{ArtistId}", meta.Data[0].Relationships.Artists.Data[0].ID,
|
"{ArtistId}", meta.Data[0].Relationships.Artists.Data[0].ID,
|
||||||
).Replace(config.ArtistFolderFormat)
|
).Replace(config.ArtistFolderFormat)
|
||||||
|
} else {
|
||||||
|
singerFoldername = strings.NewReplacer(
|
||||||
|
"{ArtistName}", meta.Data[0].Attributes.ArtistName,
|
||||||
|
"{ArtistId}", "",
|
||||||
|
).Replace(config.ArtistFolderFormat)
|
||||||
}
|
}
|
||||||
if strings.HasSuffix(singerFoldername, ".") {
|
if strings.HasSuffix(singerFoldername, ".") {
|
||||||
singerFoldername = strings.ReplaceAll(singerFoldername, ".", "")
|
singerFoldername = strings.ReplaceAll(singerFoldername, ".", "")
|
||||||
|
@ -1191,11 +1191,16 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
|||||||
"{ArtistName}", "Apple Music",
|
"{ArtistName}", "Apple Music",
|
||||||
"{ArtistId}", "",
|
"{ArtistId}", "",
|
||||||
).Replace(config.ArtistFolderFormat)
|
).Replace(config.ArtistFolderFormat)
|
||||||
} else {
|
} else if len(meta.Data[0].Relationships.Artists.Data) > 0 {
|
||||||
singerFoldername = strings.NewReplacer(
|
singerFoldername = strings.NewReplacer(
|
||||||
"{ArtistName}", meta.Data[0].Attributes.ArtistName,
|
"{ArtistName}", meta.Data[0].Attributes.ArtistName,
|
||||||
"{ArtistId}", meta.Data[0].Relationships.Artists.Data[0].ID,
|
"{ArtistId}", meta.Data[0].Relationships.Artists.Data[0].ID,
|
||||||
).Replace(config.ArtistFolderFormat)
|
).Replace(config.ArtistFolderFormat)
|
||||||
|
} else {
|
||||||
|
singerFoldername = strings.NewReplacer(
|
||||||
|
"{ArtistName}", meta.Data[0].Attributes.ArtistName,
|
||||||
|
"{ArtistId}", "",
|
||||||
|
).Replace(config.ArtistFolderFormat)
|
||||||
}
|
}
|
||||||
if strings.HasSuffix(singerFoldername, ".") {
|
if strings.HasSuffix(singerFoldername, ".") {
|
||||||
singerFoldername = strings.ReplaceAll(singerFoldername, ".", "")
|
singerFoldername = strings.ReplaceAll(singerFoldername, ".", "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user