|
|
@@ -1,9 +1,7 @@
|
|
|
package top.lvzhiqiang.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.mpatric.mp3agic.InvalidDataException;
|
|
|
import com.mpatric.mp3agic.Mp3File;
|
|
|
-import com.mpatric.mp3agic.UnsupportedTagException;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jsoup.Connection;
|
|
|
import org.jsoup.Jsoup;
|
|
|
@@ -12,8 +10,6 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import top.lvzhiqiang.config.InitRunner;
|
|
|
import top.lvzhiqiang.dto.R;
|
|
|
-import top.lvzhiqiang.entity.CoinWatchlist;
|
|
|
-import top.lvzhiqiang.entity.FileImage;
|
|
|
import top.lvzhiqiang.entity.FileMusicCollection;
|
|
|
import top.lvzhiqiang.enumeration.ResultCodeEnum;
|
|
|
import top.lvzhiqiang.exception.BusinessException;
|
|
|
@@ -63,7 +59,7 @@ public class MusicInfoServiceImpl extends BaseServiceImpl<Object> implements Mus
|
|
|
FileMusicCollection fileMusicCollection = new FileMusicCollection();
|
|
|
String parentPath = StringUtils.isEmpty(issuingDate) ? String.valueOf(LocalDate.now().getYear()) : issuingDate.substring(0, 4);
|
|
|
try {
|
|
|
- if (file != null && "low".equals(qualityType)) {
|
|
|
+ if (file != null && StringUtils.isNotEmpty(file.getOriginalFilename()) && "low".equals(qualityType)) {
|
|
|
// 1、给上传的图片生成新的文件名
|
|
|
// 1.1获取原始文件名
|
|
|
String oldName = file.getOriginalFilename();
|
|
|
@@ -146,9 +142,17 @@ public class MusicInfoServiceImpl extends BaseServiceImpl<Object> implements Mus
|
|
|
fileMusicCollection.setCollectionDate(LocalDate.parse(collectionDate, DateUtils.dateFormatter));
|
|
|
}
|
|
|
|
|
|
- String parentPath = StringUtils.isEmpty(issuingDate) && fileMusicCollection.getIssuingDate() == null ? String.valueOf(LocalDate.now().getYear()) : issuingDate.substring(0, 4);
|
|
|
+ String parentPath;
|
|
|
+ if (StringUtils.isNotEmpty(issuingDate)) {
|
|
|
+ parentPath = issuingDate.substring(0, 4);
|
|
|
+ } else if (fileMusicCollection.getIssuingDate() == null) {
|
|
|
+ parentPath = String.valueOf(LocalDate.now().getYear());
|
|
|
+ } else {
|
|
|
+ parentPath = fileMusicCollection.getIssuingDate().format(DateUtils.dateFormatter);
|
|
|
+ }
|
|
|
+
|
|
|
try {
|
|
|
- if (file != null && "low".equals(qualityType)) {
|
|
|
+ if (file != null && StringUtils.isNotEmpty(file.getOriginalFilename()) && "low".equals(qualityType)) {
|
|
|
// 1、给上传的图片生成新的文件名
|
|
|
// 1.1获取原始文件名
|
|
|
String oldName = file.getOriginalFilename();
|