Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Configuration, Status, Error handling #30

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

dailypush
Copy link

Give the app a status bar to make sure files are still working
Added a json file for easier configuration

Chad Edwards added 14 commits April 20, 2023 21:02
- Implement pruning of old files after a specified number of days
- Add optional feature to upload files to a network drive
- Update the configuration file to include new options
This commit introduces significant changes to the TwitchRecorder script, enhancing its capability to handle multiple Twitch usernames and record their streams simultaneously. Key updates include:

- Modified the loop_check method to remove the infinite loop, enabling the script to iterate over and check each username individually per execution cycle.
- Revised the run method to implement a main loop that iterates over all usernames, ensuring each user is checked and processed in turn.
- Enhanced error handling and logging in the check_user method to provide more detailed information about API request failures or other issues.
- Updated command-line argument parsing to correctly split and handle multiple usernames, ensuring they are processed as individual elements rather than a single concatenated string.
- Removed redundant and debugging print statements for cleaner code and efficient execution.

These changes improve the script's efficiency and usability, allowing for robust and concurrent recording of multiple Twitch streams.
This commit introduces a significant enhancement to the TwitchRecorder script by adding a configurable limit for the maximum number of concurrent stream recordings. This feature is particularly beneficial for running the script on systems with limited resources, such as a Raspberry Pi.

Changes include:
- Updated the config.json file to include a new field 'max_concurrent_recordings', allowing users to specify the maximum number of streams that can be recorded simultaneously.
- Modified the TwitchRecorder class to read this new setting from the config.json file, with a default value set to 2. This ensures backward compatibility for existing users who may not have this field in their configuration.
- Implemented logic in the script to monitor and limit the number of active recordings based on this configuration, thereby preventing excessive resource usage on constrained systems.
- Enhanced resource management by integrating psutil for system monitoring, enabling the script to make informed decisions about starting new recordings based on current CPU and memory usage.

This update provides users with greater control over the script’s performance and resource utilization, ensuring more stable and efficient operation on various hardware setups.
- Implement real-time CPU and memory usage checks before initiating new recording checks.
- Pause new recording checks if system resource usage is above predefined thresholds (50% CPU usage in this case).
- This enhancement aims to prevent overloading the system, ensuring stable and efficient operation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant