mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-07-08 02:55:09 +00:00
Add playlists
This commit is contained in:
@@ -6,6 +6,7 @@ import { resolveChartFolderName } from 'src-shared/UtilFunctions'
|
||||
|
||||
import { DownloadProgress } from '../../../../src-shared/interfaces/download.interface'
|
||||
import { SettingsService } from './settings.service'
|
||||
import { PlaylistService } from './playlist.service'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -15,7 +16,7 @@ export class DownloadService {
|
||||
public downloadCountChanges = new EventEmitter<number>()
|
||||
public downloads: DownloadProgress[] = []
|
||||
|
||||
constructor(zone: NgZone, private settingsService: SettingsService) {
|
||||
constructor(zone: NgZone, private settingsService: SettingsService, private playlistService: PlaylistService) {
|
||||
window.electron.on.downloadQueueUpdate(download => zone.run(() => {
|
||||
const downloadIndex = this.downloads.findIndex(d => d.md5 === download.md5)
|
||||
if (download.type === 'cancel') {
|
||||
@@ -68,6 +69,9 @@ export class DownloadService {
|
||||
if (this.downloads.every(d => d.type === 'done')) { // Reset overall progress bar if it finished
|
||||
this.downloads.forEach(d => d.stale = true)
|
||||
}
|
||||
|
||||
this.playlistService.playlistAdd(chart)
|
||||
|
||||
const newChart = {
|
||||
name: chart.name ?? 'Unknown Name',
|
||||
artist: chart.artist ?? 'Unknown Artist',
|
||||
|
||||
Reference in New Issue
Block a user