mirror of
https://github.com/snobu/destreamer.git
synced 2026-03-12 15:08:27 +00:00
updating comments
This commit is contained in:
@@ -3,13 +3,11 @@ import { logger } from './Logger';
|
|||||||
import cliProgress from 'cli-progress';
|
import cliProgress from 'cli-progress';
|
||||||
import WebSocket from 'ws';
|
import WebSocket from 'ws';
|
||||||
|
|
||||||
// TODO: ADD ERROR HANDLING!!!
|
|
||||||
// FIXME: progress bar does not update after the first time, it just fills up immediatly
|
|
||||||
|
|
||||||
export class DownloadManager {
|
export class DownloadManager {
|
||||||
private webSocket: WebSocket;
|
private webSocket: WebSocket;
|
||||||
// TODO: there's a "not a tty" mode for progresBar
|
// TODO: there's a "not a tty" mode for progresBar
|
||||||
// FIXME: is there a way to fix the ETA? Can't get size nor ETA from aria that I can see
|
// NOTE: is there a way to fix the ETA? Can't get size nor ETA from aria that I can see
|
||||||
// we initialize this for each download
|
// we initialize this for each download
|
||||||
private progresBar!: cliProgress.Bar;
|
private progresBar!: cliProgress.Bar;
|
||||||
private completed: number;
|
private completed: number;
|
||||||
@@ -37,7 +35,7 @@ export class DownloadManager {
|
|||||||
const parsed = JSON.parse(data.toString());
|
const parsed = JSON.parse(data.toString());
|
||||||
|
|
||||||
// print only messaged not handled during download
|
// print only messaged not handled during download
|
||||||
// TODO: maybe we could remove this and re-add when the downloads are done
|
// NOTE: maybe we could remove this and re-add when the downloads are done
|
||||||
if (parsed.method !== 'aria2.onDownloadComplete' &&
|
if (parsed.method !== 'aria2.onDownloadComplete' &&
|
||||||
parsed.method !== 'aria2.onDownloadStart' &&
|
parsed.method !== 'aria2.onDownloadStart' &&
|
||||||
parsed.id !== 'getSpeed' &&
|
parsed.id !== 'getSpeed' &&
|
||||||
@@ -166,7 +164,7 @@ export class DownloadManager {
|
|||||||
this.queue.delete(parsed.params.pop().gid.toString());
|
this.queue.delete(parsed.params.pop().gid.toString());
|
||||||
this.progresBar.update(++this.completed);
|
this.progresBar.update(++this.completed);
|
||||||
|
|
||||||
/* TODO: probably we could use setIntervall because reling on
|
/* NOTE: probably we could use setIntervall because reling on
|
||||||
a completed download is good in most cases (since the segments
|
a completed download is good in most cases (since the segments
|
||||||
are small and a lot, somany and frequent updates) BUT if the user
|
are small and a lot, somany and frequent updates) BUT if the user
|
||||||
internet speed is really low the completed downalods come in
|
internet speed is really low the completed downalods come in
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import { logger } from './Logger';
|
|||||||
/**
|
/**
|
||||||
* This file contains global destreamer process events
|
* This file contains global destreamer process events
|
||||||
*
|
*
|
||||||
* @note SIGINT event is overridden in downloadVideo function
|
|
||||||
*
|
|
||||||
* @note function is required for non-packaged destreamer, so we can't do better
|
* @note function is required for non-packaged destreamer, so we can't do better
|
||||||
*/
|
*/
|
||||||
export function setProcessEvents(): void {
|
export function setProcessEvents(): void {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export type Video = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* TODO: expand this template once we are all on board with a list
|
/* NOTE: expand this template once we are all on board with a list
|
||||||
see https://github.com/snobu/destreamer/issues/190#issuecomment-663718010 for list*/
|
see https://github.com/snobu/destreamer/issues/190#issuecomment-663718010 for list*/
|
||||||
export const templateElements: Array<string> = [
|
export const templateElements: Array<string> = [
|
||||||
'title',
|
'title',
|
||||||
|
|||||||
Reference in New Issue
Block a user