PLAYER: Added generated playlists feature
Build and Publish / Build and Publish Docker Image (push) Successful in 2m57s
Build and Publish / Build and Publish Docker Image (push) Successful in 2m57s
This commit is contained in:
Generated
+1
-1
@@ -1418,7 +1418,7 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "furumusic"
|
name = "furumusic"
|
||||||
version = "0.2.9"
|
version = "0.2.10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
|||||||
+32
-5
@@ -2325,6 +2325,8 @@ function adminV2() {
|
|||||||
],
|
],
|
||||||
jobs: [],
|
jobs: [],
|
||||||
recentRuns: [],
|
recentRuns: [],
|
||||||
|
activeJobRuns: [],
|
||||||
|
activeJobRunsName: null,
|
||||||
activeJobName: null,
|
activeJobName: null,
|
||||||
activeRunDetail: null,
|
activeRunDetail: null,
|
||||||
recentRunsPage: 0,
|
recentRunsPage: 0,
|
||||||
@@ -2456,7 +2458,15 @@ function adminV2() {
|
|||||||
this.reviewFilter.status = nextStatus;
|
this.reviewFilter.status = nextStatus;
|
||||||
} else if (view === 'jobs') {
|
} else if (view === 'jobs') {
|
||||||
this.activeView = 'jobs';
|
this.activeView = 'jobs';
|
||||||
if (parts[1]) this.activeJobName = decodeURIComponent(parts[1]);
|
if (parts[1]) {
|
||||||
|
const nextJobName = decodeURIComponent(parts[1]);
|
||||||
|
if (this.activeJobName !== nextJobName) {
|
||||||
|
this.activeJobRuns = [];
|
||||||
|
this.activeJobRunsName = nextJobName;
|
||||||
|
this.recentRunsPage = 0;
|
||||||
|
}
|
||||||
|
this.activeJobName = nextJobName;
|
||||||
|
}
|
||||||
} else if (view === 'library') {
|
} else if (view === 'library') {
|
||||||
const nextKind = ['artists', 'releases', 'tracks', 'playlists'].includes(parts[1]) ? parts[1] : 'artists';
|
const nextKind = ['artists', 'releases', 'tracks', 'playlists'].includes(parts[1]) ? parts[1] : 'artists';
|
||||||
if (this.libraryKind !== nextKind) this.clearLibrarySelection();
|
if (this.libraryKind !== nextKind) this.clearLibrarySelection();
|
||||||
@@ -2510,7 +2520,14 @@ function adminV2() {
|
|||||||
|
|
||||||
openJobs(name = this.activeJobName) {
|
openJobs(name = this.activeJobName) {
|
||||||
this.activeView = 'jobs';
|
this.activeView = 'jobs';
|
||||||
if (name) this.activeJobName = name;
|
if (name && this.activeJobName !== name) {
|
||||||
|
this.activeJobRuns = [];
|
||||||
|
this.activeJobRunsName = name;
|
||||||
|
this.recentRunsPage = 0;
|
||||||
|
this.activeJobName = name;
|
||||||
|
} else if (name) {
|
||||||
|
this.activeJobName = name;
|
||||||
|
}
|
||||||
this.setRoute(this.activeJobName ? `#jobs/${encodeURIComponent(this.activeJobName)}` : '#jobs');
|
this.setRoute(this.activeJobName ? `#jobs/${encodeURIComponent(this.activeJobName)}` : '#jobs');
|
||||||
this.loadJobs();
|
this.loadJobs();
|
||||||
if (this.activeJobName) this.loadRunsForJob(this.activeJobName);
|
if (this.activeJobName) this.loadRunsForJob(this.activeJobName);
|
||||||
@@ -2852,6 +2869,8 @@ function adminV2() {
|
|||||||
this.setRoute(`#jobs/${encodeURIComponent(name)}`);
|
this.setRoute(`#jobs/${encodeURIComponent(name)}`);
|
||||||
this.activeReview = null;
|
this.activeReview = null;
|
||||||
this.activeRunDetail = null;
|
this.activeRunDetail = null;
|
||||||
|
this.activeJobRuns = [];
|
||||||
|
this.activeJobRunsName = name;
|
||||||
this.recentRunsPage = 0;
|
this.recentRunsPage = 0;
|
||||||
this.runLogAutoScroll = true;
|
this.runLogAutoScroll = true;
|
||||||
await this.loadRunsForJob(name);
|
await this.loadRunsForJob(name);
|
||||||
@@ -2860,10 +2879,15 @@ function adminV2() {
|
|||||||
async loadRunsForJob(name, showErrors = true) {
|
async loadRunsForJob(name, showErrors = true) {
|
||||||
try {
|
try {
|
||||||
const data = await this.request(`${this.apiBase}/jobs/${encodeURIComponent(name)}/runs`);
|
const data = await this.request(`${this.apiBase}/jobs/${encodeURIComponent(name)}/runs`);
|
||||||
|
const runs = data.runs || [];
|
||||||
const job = this.jobs.find(item => item.name === name);
|
const job = this.jobs.find(item => item.name === name);
|
||||||
if (job) job.recent_runs = data.runs;
|
if (job) job.recent_runs = runs;
|
||||||
const maxPage = Math.max(0, Math.ceil(((data.runs || []).length) / this.recentRunsPerPage) - 1);
|
if (this.activeJobName === name) {
|
||||||
this.recentRunsPage = Math.min(this.recentRunsPage, maxPage);
|
this.activeJobRuns = runs;
|
||||||
|
this.activeJobRunsName = name;
|
||||||
|
const maxPage = Math.max(0, Math.ceil(runs.length / this.recentRunsPerPage) - 1);
|
||||||
|
this.recentRunsPage = Math.min(this.recentRunsPage, maxPage);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (showErrors) this.showToast(error.message);
|
if (showErrors) this.showToast(error.message);
|
||||||
}
|
}
|
||||||
@@ -2924,6 +2948,9 @@ function adminV2() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
visibleRuns() {
|
visibleRuns() {
|
||||||
|
if (this.activeJobName && this.activeJobRunsName === this.activeJobName) {
|
||||||
|
return this.activeJobRuns || [];
|
||||||
|
}
|
||||||
const job = this.activeJob;
|
const job = this.activeJob;
|
||||||
return job ? (job.recent_runs || []) : this.recentRuns;
|
return job ? (job.recent_runs || []) : this.recentRuns;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user