This repository has been archived by the owner on Apr 19, 2021. It is now read-only.
app.js -> Add ability to specify 3 'high priority' channels to watch #81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wanted to re-work this to watch Twitch.tv/warframe, and after poking through the code, I feel like it could work great. The only hiccup would be actually getting the specific channel that I want to watch, instead of the random channels.
The changes include several new routines:
ViewPriority -> This is now the main loop (instead of ViewRandomPage being the main loop). It allows checking for several high-priority streams to view before viewing any random channels.
ViewURL -> I moved all of the pertinent code from the ViewRandomPage routine into this new routine. This is what will allow specific channels to be watched, while keeping the total code smaller (and mostly the same)
CheckStreamerOnline -> This routine is mocked up, but I'll be honest that I am unsure of how to perform this check at the moment. This routine would return a boolean TRUE if the requested stream is online. The ViewPriority routine would then call the ViewURL to go to that stream.
SleepWatching -> This routine checks if there are any high priority streams running. If there is a higher priority stream running, it will stop sleeping and allow the ViewPriority loop to decide which page to go to next. If no high priority stream is running it will run out the sleep timer in 1 minute increments, checking for higher priorities each loop.
Since this new code will support up to three 'high priority' channels, and I know some people have data caps or other resources they want to be aware of , I also added in the ability to completely ignore the random streams. If enabled, it will ONLY check the specified channels. I have also added some safeguards to avoid refreshing the page if on a high priority stream, and if the 'ignore' function is turned on, but no high priority streams are available, it will refresh the browser and sit idle, and check every 2 minutes. This should save some resources for the end user's system, as well as save the data cost (if they care about it)
These are the commands to be added into the docker environment list:
#- IgnoreRandomChannels=TRUE #Disables viewing random channels and sits idle if no High-Priority channels are live