chore(misc): tiny improvements (#233)

Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
serg06
2020-09-23 11:02:44 -04:00
committed by GitHub
parent 22fd22fe74
commit 8466f9f398
4 changed files with 25 additions and 3 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ The purpose of this bot is to get an Nvidia card. It tries multiple things to do
> :point_right: You may get false positives from time to time, so I apologize for that. The library currently waits for all calls to be completed before parsing, but sometimes this can have unknown behavior. Patience is a virtue :)
| | **Adorama** | **Amazon** | **ASUS** | **EVGA** | **Best Buy** | **B&H** | **Micro Center** | **Newegg** | **Nvidia** | **Office Depot** | **Zotac** |
| | **Adorama** | **Amazon** | **ASUS** | **B&H** | **Best Buy** | **EVGA** | **Micro Center** | **Newegg** | **Nvidia** | **Office Depot** | **Zotac** |
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| **3070**| | | | | | | | | | | |
| **3080** | `✔` | `✔` | `✔` | `✔` | `✔` | `✔` | `✔` | `✔` | `✔` | `✔` | `✔` |
@@ -112,9 +112,9 @@ Here is a list of variables that you can use to customize your newly copied `.en
| Amazon | `amazon`|
| Amazon (CA) | `amazon-ca`|
| ASUS | `asus` |
| B&H | `bandh`|
| Best Buy | `bestbuy`|
| Best Buy (CA) | `bestbuy-ca`|
| B&H | `bandh`|
| EVGA | `evga`|
| EVGA (EU) | `evga-eu`|
| Micro Center | `microcenter`|
+5
View File
@@ -14,6 +14,11 @@ puppeteer.use(adBlocker);
* Starts the bot.
*/
async function main() {
if (Stores.length === 0) {
Logger.error('No stores selected.');
return;
}
const args: string[] = [];
// Skip Chromium Linux Sandbox
+8
View File
@@ -4,7 +4,15 @@ import fs from 'fs';
import playerLib from 'play-sound';
const notificationSound = Config.notifications.playSound;
Logger.info('Searching for sound player...');
const player = playerLib();
if (player.player === null) {
Logger.warn('No sound player found.');
} else {
const playerName: string = player.player;
Logger.info(`Sound player found: ${playerName}`);
}
export function playSound() {
// Check if file exists
+10 -1
View File
@@ -9,6 +9,7 @@ import {BestBuyCa} from './bestbuy-ca';
import {Config} from '../../config';
import {Evga} from './evga';
import {EvgaEu} from './evga-eu';
import {Logger} from '../../logger';
import {MicroCenter} from './microcenter';
import {NewEgg} from './newegg';
import {NewEggCa} from './newegg-ca';
@@ -38,9 +39,17 @@ const masterList = new Map([
const list = new Map();
for (const name of Config.store.stores) {
list.set(name, masterList.get(name));
if (masterList.has(name)) {
list.set(name, masterList.get(name));
} else {
const logString = `No store named ${name}, skipping.`;
Logger.warn(logString);
}
}
const logString = `Selected stores: ${Array.from(list.keys()).join(', ')}`;
Logger.info(logString);
export const Stores = Array.from(list.values()) as Store[];
export * from './store';