Skip to content
This repository has been archived by the owner on Apr 13, 2020. It is now read-only.

Rethinking server/player.js #3

Open
SamuelWitke opened this issue May 8, 2018 · 0 comments
Open

Rethinking server/player.js #3

SamuelWitke opened this issue May 8, 2018 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@SamuelWitke
Copy link
Owner

The project is currently using kue to handle job priority and process.

So a work around to handle removing active songs for each project I have to

let exitActivJob = {};
let timeOutPlayer = {};
...
        exitActivJob[`${projects}`] = () => {
            done();
        };
...
 timeOutPlayer[`${projects}`] = setTimeout( async () => {
if(job.state('active') && song.song.uri === active && exitActivJob[`${projects}`] && timeOutPlayer[`${projects}`]){
                        exitActivJob[`${projects}`]();
                        exitActivJob[`${projects}`]=undefined;
                        clearTimeout(timeOutPlayer[`${projects}`]);
                        timeOutPlayer[`${projects}`] = undefined
}

This is a hack that works when only one active user but if anyone has a better suggestion please let me know.

@SamuelWitke SamuelWitke added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant