mirror of
https://github.com/billsonnn/nitro-converter.git
synced 2024-11-22 23:50:52 +01:00
add console.logs for download URLs as configuration option
This commit is contained in:
parent
32435a3c84
commit
476b0762d4
@ -18,4 +18,5 @@
|
||||
"convert.effect": "1",
|
||||
"convert.furniture": "1",
|
||||
"convert.pet": "1"
|
||||
"misc.log_download_urls": "0"
|
||||
}
|
||||
|
@ -63,6 +63,10 @@ export class EffectDownloader
|
||||
|
||||
if(!url || !url.length) return null;
|
||||
|
||||
const logDownloads = this._configuration.getBoolean('misc.log_download_urls');
|
||||
|
||||
if(logDownloads) console.log(`<Downloader> Downloading effect map from ${url}`);
|
||||
|
||||
const content = await FileUtilities.readFileAsString(url);
|
||||
|
||||
if(!content || !content.length) return null;
|
||||
@ -78,6 +82,10 @@ export class EffectDownloader
|
||||
|
||||
url = url.replace('%className%', className);
|
||||
|
||||
const logDownloads = this._configuration.getBoolean('misc.log_download_urls');
|
||||
|
||||
if(logDownloads) console.log(`<Downloader> Downloading effect from ${url}`);
|
||||
|
||||
const buffer = await FileUtilities.readFileAsBuffer(url);
|
||||
|
||||
if(!buffer) return;
|
||||
|
@ -23,6 +23,10 @@ export class EffectMapDownloader
|
||||
|
||||
if(!url || !url.length) return null;
|
||||
|
||||
const logDownloads = this._configuration.getBoolean('misc.log_download_urls');
|
||||
|
||||
if(logDownloads) console.log(`<Downloader> Downloading effect map from ${url}`);
|
||||
|
||||
const content = await FileUtilities.readFileAsString(url);
|
||||
|
||||
if(!content || !content.length) return null;
|
||||
|
@ -23,6 +23,10 @@ export class ExternalTextsDownloader
|
||||
|
||||
if(!url || !url.length) return null;
|
||||
|
||||
const logDownloads = this._configuration.getBoolean('misc.log_download_urls');
|
||||
|
||||
if(logDownloads) console.log(`<Downloader> Downloading external texts from ${url}`);
|
||||
|
||||
const content = await FileUtilities.readFileAsString(url);
|
||||
|
||||
if(!content || !content.length) return null;
|
||||
|
@ -65,6 +65,10 @@ export class FigureDownloader
|
||||
|
||||
if(!url || !url.length) return null;
|
||||
|
||||
const logDownloads = this._configuration.getBoolean('misc.log_download_urls');
|
||||
|
||||
if(logDownloads) console.log(`<Downloader> Downloading figure data from ${url}`);
|
||||
|
||||
const content = await FileUtilities.readFileAsString(url);
|
||||
|
||||
if(!content || !content.length) return null;
|
||||
@ -80,6 +84,10 @@ export class FigureDownloader
|
||||
|
||||
url = url.replace('%className%', className);
|
||||
|
||||
const logDownloads = this._configuration.getBoolean('misc.log_download_urls');
|
||||
|
||||
if(logDownloads) console.log(`<Downloader> Downloading figure from ${url}`);
|
||||
|
||||
const buffer = await FileUtilities.readFileAsBuffer(url);
|
||||
|
||||
if(!buffer) return;
|
||||
|
@ -23,6 +23,10 @@ export class FigureMapDownloader
|
||||
|
||||
if(!url || !url.length) return null;
|
||||
|
||||
const logDownloads = this._configuration.getBoolean('misc.log_download_urls');
|
||||
|
||||
if(logDownloads) console.log(`<Downloader> Downloading figure map from ${url}`);
|
||||
|
||||
const content = await FileUtilities.readFileAsString(url);
|
||||
|
||||
if(!content || !content.length) return null;
|
||||
|
@ -104,6 +104,10 @@ export class FurnitureDownloader
|
||||
|
||||
if(!url || !url.length) return null;
|
||||
|
||||
const logDownloads = this._configuration.getBoolean('misc.log_download_urls');
|
||||
|
||||
if(logDownloads) console.log(`<Downloader> Downloading furniture data from ${url}`);
|
||||
|
||||
const content = await FileUtilities.readFileAsString(url);
|
||||
|
||||
if(!content || !content.length) return null;
|
||||
@ -120,6 +124,10 @@ export class FurnitureDownloader
|
||||
url = url.replace('%revision%', revision.toString());
|
||||
url = url.replace('%className%', className);
|
||||
|
||||
const logDownloads = this._configuration.getBoolean('misc.log_download_urls');
|
||||
|
||||
if(logDownloads) console.log(`<Downloader> Downloading furniture from ${url}`);
|
||||
|
||||
const buffer = await FileUtilities.readFileAsBuffer(url);
|
||||
|
||||
if(!buffer) return;
|
||||
|
@ -6,7 +6,8 @@ import { FileUtilities } from '../../utils/FileUtilities';
|
||||
export class FurnitureDataDownloader
|
||||
{
|
||||
constructor(private readonly _configuration: Configuration)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
public async download(callback: (content: string) => Promise<void>): Promise<void>
|
||||
{
|
||||
@ -23,6 +24,10 @@ export class FurnitureDataDownloader
|
||||
|
||||
if(!url || !url.length) return null;
|
||||
|
||||
const logDownloads = this._configuration.getBoolean('misc.log_download_urls');
|
||||
|
||||
if(logDownloads) console.log(`<Downloader> Downloading furniture data from ${url}`);
|
||||
|
||||
const content = await FileUtilities.readFileAsString(url);
|
||||
|
||||
if(!content || !content.length) return null;
|
||||
|
@ -23,6 +23,10 @@ export class ProductDataDownloader
|
||||
|
||||
if(!url || !url.length) return null;
|
||||
|
||||
const logDownloads = this._configuration.getBoolean('misc.log_download_urls');
|
||||
|
||||
if(logDownloads) console.log(`<Downloader> Downloading product data from ${url}`);
|
||||
|
||||
const content = await FileUtilities.readFileAsString(url);
|
||||
|
||||
if(!content || !content.length) return null;
|
||||
|
Loading…
Reference in New Issue
Block a user