Skip to content

Commit

Permalink
fix(UI): download song in home playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
foamzou committed Jan 21, 2025
1 parent ae9792c commit fc9a144
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/src/service/job_manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ async function listJobs(uid) {
const jobs = await getUserJobs(uid);
for (const jobId in jobs) {
const job = await getJob(uid, jobId);
if (!job) {
continue;
}
job.id = jobId;
list.push(job);
}
Expand All @@ -25,7 +28,11 @@ async function getJob(uid, jobId) {
if (!await asyncFs.asyncFileExisted(jobFile)) {
return null;
}
return JSON.parse(await asyncFs.asyncReadFile(jobFile));
const fileText = await asyncFs.asyncReadFile(jobFile);
if (fileText == "") {
return null;
}
return JSON.parse(fileText);
}

async function updateJob(uid, jobId, info) {
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/components/SearchResultTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,25 @@
</el-button>
</el-tooltip>

<el-tooltip
:content="
globalConfig.downloadPathExisted
? '下载到服务器'
: '下载到服务器(请先配置下载路径)'
"
placement="top"
>
<el-button
type="primary"
circle
@click="downloadToLocalService(scope.row.url)"
:disabled="!globalConfig.downloadPathExisted"
class="operation-btn"
>
<i class="bi bi-download"></i>
</el-button>
</el-tooltip>

<el-tooltip content="在源站查看" placement="top">
<el-button
type="warning"
Expand Down

0 comments on commit fc9a144

Please sign in to comment.