|
@@ -92,7 +92,7 @@ export default class RdbUtils {
|
|
|
|
|
|
|
|
|
|
|
|
|
//检查是否存在相同id的记录,存在则不插入,进一步判断pixelMapPath字段,如果旧值为空而新值不为空,则更新该字段。
|
|
//检查是否存在相同id的记录,存在则不插入,进一步判断pixelMapPath字段,如果旧值为空而新值不为空,则更新该字段。
|
|
|
- async insertData(data: relationalStore.ValuesBucket, callback: Function = () => {}) {
|
|
|
|
|
|
|
+ async insertData(data: relationalStore.ValuesBucket, callback: Function = () => {},cover_api?:string) {
|
|
|
if (!callback || typeof callback !== 'function') {
|
|
if (!callback || typeof callback !== 'function') {
|
|
|
Logger.info(RdbUtils.RDB_TAG, 'insertData() has no valid callback!');
|
|
Logger.info(RdbUtils.RDB_TAG, 'insertData() has no valid callback!');
|
|
|
return;
|
|
return;
|
|
@@ -125,8 +125,8 @@ export default class RdbUtils {
|
|
|
const existingPixelMapPath = resultSet.getString(resultSet.getColumnIndex('pixelMapPath'));
|
|
const existingPixelMapPath = resultSet.getString(resultSet.getColumnIndex('pixelMapPath'));
|
|
|
const name = resultSet.getString(resultSet.getColumnIndex('name'));
|
|
const name = resultSet.getString(resultSet.getColumnIndex('name'));
|
|
|
const artist = resultSet.getString(resultSet.getColumnIndex('artist'));
|
|
const artist = resultSet.getString(resultSet.getColumnIndex('artist'));
|
|
|
- if ((!existingPixelMapPath || existingPixelMapPath.trim() === '') ) {
|
|
|
|
|
- let newPixelMapPath = await NetAxiosUtil.getLyricCover(name,artist)
|
|
|
|
|
|
|
+ if ((!existingPixelMapPath || existingPixelMapPath.trim() === '')&& cover_api!==undefined) {
|
|
|
|
|
+ let newPixelMapPath = await NetAxiosUtil.getLyricCover(name,artist,cover_api)
|
|
|
console.info('onecold getLyricCover success. name= '+name);
|
|
console.info('onecold getLyricCover success. name= '+name);
|
|
|
console.info('onecold getLyricCover success. newPixelMapPath= '+newPixelMapPath);
|
|
console.info('onecold getLyricCover success. newPixelMapPath= '+newPixelMapPath);
|
|
|
if(StrUtil.isNotEmpty(newPixelMapPath)){
|
|
if(StrUtil.isNotEmpty(newPixelMapPath)){
|
|
@@ -160,7 +160,7 @@ export default class RdbUtils {
|
|
|
|
|
|
|
|
//不存在相同记录 ,判断要不要去请求getLyricCover
|
|
//不存在相同记录 ,判断要不要去请求getLyricCover
|
|
|
if(pixelMapPathV==undefined||pixelMapPathV.toString()==='' ){
|
|
if(pixelMapPathV==undefined||pixelMapPathV.toString()==='' ){
|
|
|
- valueBucket.pixelMapPath = await NetAxiosUtil.getLyricCover(titleNameV+'',artistV+'')
|
|
|
|
|
|
|
+ valueBucket.pixelMapPath = await NetAxiosUtil.getLyricCover(titleNameV+'',artistV+'',cover_api)
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
console.info('onecold getLyricCover pixelMapPathV1= '+pixelMapPathV);
|
|
console.info('onecold getLyricCover pixelMapPathV1= '+pixelMapPathV);
|