mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-07-09 03:25:09 +00:00
Cancel, Retry, and Warning download UI
This commit is contained in:
@@ -37,6 +37,7 @@ export default class Database {
|
||||
}
|
||||
})
|
||||
|
||||
// TODO: make this error message more user-friendly (retry option?)
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
this.conn.connect(err => {
|
||||
if (err) {
|
||||
|
||||
@@ -3,8 +3,8 @@ import { VersionResult, AlbumArtResult } from './interfaces/songDetails.interfac
|
||||
import SearchHandler from '../ipc/SearchHandler.ipc'
|
||||
import SongDetailsHandler from '../ipc/SongDetailsHandler.ipc'
|
||||
import AlbumArtHandler from '../ipc/AlbumArtHandler.ipc'
|
||||
import { Download, NewDownload } from './interfaces/download.interface'
|
||||
import { AddDownloadHandler } from '../ipc/download/AddDownloadHandler'
|
||||
import { Download, NewDownload, DownloadProgress } from './interfaces/download.interface'
|
||||
import { DownloadHandler } from '../ipc/download/DownloadHandler'
|
||||
import { Settings } from './Settings'
|
||||
import InitSettingsHandler from '../ipc/InitSettingsHandler.ipc'
|
||||
|
||||
@@ -51,13 +51,13 @@ export interface IPCInvokeHandler<E extends keyof IPCInvokeEvents> {
|
||||
|
||||
export function getIPCEmitHandlers(): IPCEmitHandler<keyof IPCEmitEvents>[]{
|
||||
return [
|
||||
new AddDownloadHandler()
|
||||
new DownloadHandler()
|
||||
]
|
||||
}
|
||||
|
||||
export type IPCEmitEvents = {
|
||||
'add-download': NewDownload
|
||||
'download-updated': Download
|
||||
'download': Download
|
||||
'download-updated': DownloadProgress
|
||||
}
|
||||
|
||||
export interface IPCEmitHandler<E extends keyof IPCEmitEvents> {
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
export interface Download {
|
||||
action: 'add' | 'retry' | 'continue' | 'cancel'
|
||||
versionID: number
|
||||
data ?: NewDownload
|
||||
}
|
||||
|
||||
/**
|
||||
* Contains the data required to start downloading a single chart
|
||||
*/
|
||||
export interface NewDownload {
|
||||
versionID: number
|
||||
avTagName: string
|
||||
artist: string
|
||||
charter: string
|
||||
@@ -12,10 +17,11 @@ export interface NewDownload {
|
||||
/**
|
||||
* Represents the download progress of a single chart
|
||||
*/
|
||||
export interface Download {
|
||||
export interface DownloadProgress {
|
||||
versionID: number
|
||||
title: string
|
||||
header: string
|
||||
description: string
|
||||
percent: number
|
||||
type: 'good' | 'warning' | 'error' | 'cancel'
|
||||
}
|
||||
Reference in New Issue
Block a user