mirror of
https://github.com/billsonnn/nitro-converter.git
synced 2024-11-30 03:00:52 +01:00
Merge branch 'log-urls' into 'master'
add console.logs for download URLs as configuration option See merge request nitro/nitro-converter!5
This commit is contained in:
commit
0097f3bd69
@ -20,4 +20,5 @@
|
|||||||
"convert.effect": "1",
|
"convert.effect": "1",
|
||||||
"convert.furniture": "1",
|
"convert.furniture": "1",
|
||||||
"convert.pet": "1"
|
"convert.pet": "1"
|
||||||
|
"misc.log_download_urls": "0"
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,10 @@ export class EffectDownloader
|
|||||||
|
|
||||||
if(!url || !url.length) return null;
|
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);
|
const content = await FileUtilities.readFileAsString(url);
|
||||||
|
|
||||||
if(!content || !content.length) return null;
|
if(!content || !content.length) return null;
|
||||||
@ -78,6 +82,10 @@ export class EffectDownloader
|
|||||||
|
|
||||||
url = url.replace('%className%', className);
|
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);
|
const buffer = await FileUtilities.readFileAsBuffer(url);
|
||||||
|
|
||||||
if(!buffer) return;
|
if(!buffer) return;
|
||||||
|
@ -23,6 +23,10 @@ export class EffectMapDownloader
|
|||||||
|
|
||||||
if(!url || !url.length) return null;
|
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);
|
const content = await FileUtilities.readFileAsString(url);
|
||||||
|
|
||||||
if(!content || !content.length) return null;
|
if(!content || !content.length) return null;
|
||||||
|
@ -23,6 +23,10 @@ export class ExternalTextsDownloader
|
|||||||
|
|
||||||
if(!url || !url.length) return null;
|
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);
|
const content = await FileUtilities.readFileAsString(url);
|
||||||
|
|
||||||
if(!content || !content.length) return null;
|
if(!content || !content.length) return null;
|
||||||
|
@ -65,6 +65,10 @@ export class FigureDownloader
|
|||||||
|
|
||||||
if(!url || !url.length) return null;
|
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);
|
const content = await FileUtilities.readFileAsString(url);
|
||||||
|
|
||||||
if(!content || !content.length) return null;
|
if(!content || !content.length) return null;
|
||||||
@ -80,6 +84,10 @@ export class FigureDownloader
|
|||||||
|
|
||||||
url = url.replace('%className%', className);
|
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);
|
const buffer = await FileUtilities.readFileAsBuffer(url);
|
||||||
|
|
||||||
if(!buffer) return;
|
if(!buffer) return;
|
||||||
|
@ -23,6 +23,10 @@ export class FigureMapDownloader
|
|||||||
|
|
||||||
if(!url || !url.length) return null;
|
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);
|
const content = await FileUtilities.readFileAsString(url);
|
||||||
|
|
||||||
if(!content || !content.length) return null;
|
if(!content || !content.length) return null;
|
||||||
|
@ -104,6 +104,10 @@ export class FurnitureDownloader
|
|||||||
|
|
||||||
if(!url || !url.length) return null;
|
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);
|
const content = await FileUtilities.readFileAsString(url);
|
||||||
|
|
||||||
if(!content || !content.length) return null;
|
if(!content || !content.length) return null;
|
||||||
@ -120,6 +124,10 @@ export class FurnitureDownloader
|
|||||||
url = url.replace('%revision%', revision.toString());
|
url = url.replace('%revision%', revision.toString());
|
||||||
url = url.replace('%className%', className);
|
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);
|
const buffer = await FileUtilities.readFileAsBuffer(url);
|
||||||
|
|
||||||
if(!buffer) return;
|
if(!buffer) return;
|
||||||
|
@ -6,7 +6,8 @@ import { FileUtilities } from '../../utils/FileUtilities';
|
|||||||
export class FurnitureDataDownloader
|
export class FurnitureDataDownloader
|
||||||
{
|
{
|
||||||
constructor(private readonly _configuration: Configuration)
|
constructor(private readonly _configuration: Configuration)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public async download(callback: (content: string) => Promise<void>): Promise<void>
|
public async download(callback: (content: string) => Promise<void>): Promise<void>
|
||||||
{
|
{
|
||||||
@ -23,6 +24,10 @@ export class FurnitureDataDownloader
|
|||||||
|
|
||||||
if(!url || !url.length) return null;
|
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);
|
const content = await FileUtilities.readFileAsString(url);
|
||||||
|
|
||||||
if(!content || !content.length) return null;
|
if(!content || !content.length) return null;
|
||||||
|
@ -23,6 +23,10 @@ export class ProductDataDownloader
|
|||||||
|
|
||||||
if(!url || !url.length) return null;
|
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);
|
const content = await FileUtilities.readFileAsString(url);
|
||||||
|
|
||||||
if(!content || !content.length) return null;
|
if(!content || !content.length) return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user