This commit is contained in:
N1KO 2024-12-13 16:11:43 +08:00
parent f3c70b89be
commit 6467eac4ed
6 changed files with 16 additions and 11 deletions

View File

@ -98,7 +98,7 @@ public class NetEaseMusicClient implements ChannelClient<MusicSearchReq, MusicSe
if (Objects.isNull(res) || Objects.isNull(res.getName()) || Objects.isNull(res.getUrl())) {
return;
}
Path baseDir = Paths.get(netEaseMusicProperties.getDownloadPath(), res.getName());
Path baseDir = Paths.get(netEaseMusicProperties.getDownloadPath(), res.getArtistName(), res.getAlbumName());
if (!Files.exists(baseDir)) {
Files.createDirectories(baseDir);
}

View File

@ -316,7 +316,7 @@ public class QQMusicClient implements ChannelClient<MusicSearchReq, MusicSearchR
if (Objects.isNull(res) || Objects.isNull(res.getName()) || Objects.isNull(res.getUrl())) {
return;
}
Path baseDir = Paths.get(qqMusicProperties.getDownloadPath(), res.getName());
Path baseDir = Paths.get(qqMusicProperties.getDownloadPath(), res.getArtistName(), res.getAlbumName());
if (!Files.exists(baseDir)) {
Files.createDirectories(baseDir);
}

View File

@ -30,7 +30,7 @@ public class MusicRecordEntity extends BaseEntity {
private String artistName;
private MusicQualityEnum level;
private String level;
private String pic;

View File

@ -6,8 +6,8 @@ import org.jaudiotagger.audio.exceptions.CannotReadException;
import org.jaudiotagger.audio.exceptions.CannotWriteException;
import org.jaudiotagger.audio.exceptions.InvalidAudioFrameException;
import org.jaudiotagger.audio.exceptions.ReadOnlyFileException;
import org.jaudiotagger.audio.flac.FlacFileWriter;
import org.jaudiotagger.audio.mp3.MP3FileReader;
import org.jaudiotagger.audio.mp3.MP3FileWriter;
import org.jaudiotagger.tag.FieldKey;
import org.jaudiotagger.tag.Tag;
import org.jaudiotagger.tag.TagException;
@ -41,8 +41,8 @@ public class Mp3AudioProcessor extends AbstractAudioProcessor {
artwork.setImageUrl(res.getPic());
artwork.setBinaryData(fetchImageData(res.getPic()));
tag.setField(artwork);
FlacFileWriter flacFileWriter = new FlacFileWriter();
flacFileWriter.write(audioFile);
MP3FileWriter fileWriter = new MP3FileWriter();
fileWriter.write(audioFile);
return new FileInputStream(file);
}
}

View File

@ -42,7 +42,12 @@ public class MusicRecordServiceImpl extends ServiceImpl<MusicRecordMapper, Music
entity.setName(res.getName());
entity.setAlbumName(res.getAlbumName());
entity.setArtistName(res.getArtistName());
entity.setLevel(MusicQualityEnum.parse(res.getLevel()));
MusicQualityEnum musicQualityEnum = MusicQualityEnum.parse(res.getLevel());
if (musicQualityEnum != null) {
entity.setLevel(musicQualityEnum.name());
} else {
entity.setLevel(res.getLevel());
}
entity.setPic(res.getPic());
entity.setSize(res.getSize());
entity.setUrl(res.getUrl());

View File

@ -45,15 +45,15 @@ baogutang:
album-base-url: http://117.72.78.133:5173/album?id=%d
artist-base-url: http://117.72.78.133:5173/artists?id=%d
download-base-url: https://api.sooooooooooooooooootheby.top/Netease_url/Song_V1?level=jymaster&type=json&ids=%d
download-path: /downloads/music
# download-path: /Users/nikooh/Desktop/downloads/music
# download-path: /downloads/music
download-path: /Users/nikooh/Desktop/downloads/music
qq-music:
query-base-url: http://117.72.78.133:5175/search?key=%s&pageNo=%d&pageSize=%d&t=%d
playlist-base-url: http://117.72.78.133:5175/songlist?id=%s
album-base-url: http://117.72.78.133:5175/album/songs?albummid=%s
download-base-url: http://117.72.78.133:5176/song?url=https://y.qq.com/n/ryqq/songDetail/%s
download-path: /downloads/music
# download-path: /Users/nikooh/Desktop/downloads/music
# download-path: /downloads/music
download-path: /Users/nikooh/Desktop/downloads/music