mirror of
				https://github.com/warengroup/eximiabots-radiox.git
				synced 2025-11-04 01:49:37 +00:00 
			
		
		
		
	Update Stations class
This commit is contained in:
		@@ -3,6 +3,7 @@ const fetch = (...args) => _importDynamic('node-fetch').then(({default: fetch})
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
module.exports = class Stations extends Array {
 | 
					module.exports = class Stations extends Array {
 | 
				
			||||||
    constructor() {
 | 
					    constructor() {
 | 
				
			||||||
 | 
					        super();
 | 
				
			||||||
        this.logger = require("../funcs/logger.js");
 | 
					        this.logger = require("../funcs/logger.js");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -15,12 +16,15 @@ module.exports = class Stations extends Array {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            if(list){
 | 
					            if(list){
 | 
				
			||||||
                this.logger('Stations');
 | 
					                this.logger('Stations');
 | 
				
			||||||
 | 
					                this.forEach(oldStation => {
 | 
				
			||||||
 | 
					                    if(list.findIndex(station => station.name == oldStation.name)) return;
 | 
				
			||||||
 | 
					                    delete this[this.findIndex(station => station.name == oldStation.name)];
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
                list.forEach(station => {
 | 
					                list.forEach(station => {
 | 
				
			||||||
                    console.log("- " + station.name);
 | 
					                    console.log("- " + station.name);
 | 
				
			||||||
 | 
					                    this.push(station);
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
                console.log("\n");
 | 
					                console.log("\n");
 | 
				
			||||||
 | 
					 | 
				
			||||||
                this = list;
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.logger('Stations', 'Successfully fetched list');
 | 
					            this.logger('Stations', 'Successfully fetched list');
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user