mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-07-09 03:25:09 +00:00
Fixed Downloads
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { basename } from 'path'
|
||||
import { GetSettingsHandler } from '../ipc/SettingsHandler.ipc'
|
||||
import { getSettingsHandler } from '../ipc/SettingsHandler.ipc'
|
||||
|
||||
/**
|
||||
* @returns The relative filepath from the library folder to `absoluteFilepath`.
|
||||
*/
|
||||
export function getRelativeFilepath(absoluteFilepath: string) {
|
||||
const settings = GetSettingsHandler.getSettings()
|
||||
const settings = getSettingsHandler.getSettings()
|
||||
return basename(settings.libraryPath) + absoluteFilepath.substring(settings.libraryPath.length)
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
import { SongSearch, SongResult } from './interfaces/search.interface'
|
||||
import { VersionResult, AlbumArtResult } from './interfaces/songDetails.interface'
|
||||
import SearchHandler from '../ipc/SearchHandler.ipc'
|
||||
import SongDetailsHandler from '../ipc/SongDetailsHandler.ipc'
|
||||
import AlbumArtHandler from '../ipc/AlbumArtHandler.ipc'
|
||||
import { searchHandler } from '../ipc/SearchHandler.ipc'
|
||||
import { songDetailsHandler } from '../ipc/SongDetailsHandler.ipc'
|
||||
import { albumArtHandler } from '../ipc/AlbumArtHandler.ipc'
|
||||
import { Download, DownloadProgress } from './interfaces/download.interface'
|
||||
import { DownloadHandler } from '../ipc/download/DownloadHandler'
|
||||
import { downloadHandler } from '../ipc/download/DownloadHandler'
|
||||
import { Settings } from './Settings'
|
||||
import BatchSongDetailsHandler from '../ipc/BatchSongDetailsHandler.ipc'
|
||||
import { GetSettingsHandler, SetSettingsHandler } from '../ipc/SettingsHandler.ipc'
|
||||
import { batchSongDetailsHandler } from '../ipc/BatchSongDetailsHandler.ipc'
|
||||
import { getSettingsHandler, setSettingsHandler } from '../ipc/SettingsHandler.ipc'
|
||||
|
||||
/**
|
||||
* To add a new IPC listener:
|
||||
@@ -19,11 +19,11 @@ import { GetSettingsHandler, SetSettingsHandler } from '../ipc/SettingsHandler.i
|
||||
|
||||
export function getIPCInvokeHandlers(): IPCInvokeHandler<keyof IPCInvokeEvents>[] {
|
||||
return [
|
||||
new GetSettingsHandler(),
|
||||
new SearchHandler(),
|
||||
new SongDetailsHandler(),
|
||||
new BatchSongDetailsHandler(),
|
||||
new AlbumArtHandler()
|
||||
getSettingsHandler,
|
||||
searchHandler,
|
||||
songDetailsHandler,
|
||||
batchSongDetailsHandler,
|
||||
albumArtHandler
|
||||
]
|
||||
}
|
||||
|
||||
@@ -64,8 +64,8 @@ export interface IPCInvokeHandler<E extends keyof IPCInvokeEvents> {
|
||||
|
||||
export function getIPCEmitHandlers(): IPCEmitHandler<keyof IPCEmitEvents>[] {
|
||||
return [
|
||||
new DownloadHandler(),
|
||||
new SetSettingsHandler()
|
||||
downloadHandler,
|
||||
setSettingsHandler
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -26,5 +26,11 @@ export interface DownloadProgress {
|
||||
header: string
|
||||
description: string
|
||||
percent: number
|
||||
type: 'good' | 'warning' | 'error' | 'cancel' | 'done' | 'wait'
|
||||
}
|
||||
type: ProgressType
|
||||
}
|
||||
|
||||
export type ProgressType = 'good' | 'warning' | 'error' | 'cancel' | 'done' | 'fastUpdate'
|
||||
// export function downloadSorter(p1: DownloadProgress, p2: DownloadProgress) {
|
||||
// return 0
|
||||
// // return p1 - p2 // negative if p1 < p2
|
||||
// }
|
||||
Reference in New Issue
Block a user