Skip to content

Comments

Remove broken vlc_control module and add shell-script based volume endpoints#96

Draft
Copilot wants to merge 4 commits intodevfrom
copilot/remove-unused-code-vlc-control
Draft

Remove broken vlc_control module and add shell-script based volume endpoints#96
Copilot wants to merge 4 commits intodevfrom
copilot/remove-unused-code-vlc-control

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

The vlc_control Python module was never installed, causing ERROR:root:Failed to import vlc_control: No module named 'vlc_control' on every startup. Remote.html requires volume control functionality.

Changes

Removed non-functional vlc_control integration

  • Import attempt and error logging for missing module
  • 8 broken API endpoints: /api/play, /api/stop, /api/next, /api/prev, /api/status, /api/volume/<value>, /api/volume_up, /api/volume_down

Added shell-script based volume control

  • /api/volume/<int:value> - Set absolute volume (0-512)
  • /api/volume_up - Increase volume
  • /api/volume_down - Decrease volume
  • VOLUME_SCRIPT = "/usr/local/bin/vlc-volume.sh" constant
  • MAX_VOLUME = 512 constant
  • Returns 501 (Not Implemented) when script not installed

Implementation follows existing /api/start_stream and /api/stop_stream pattern:

@app.route('/api/volume/<int:value>', methods=['POST'])
@login_required
def api_set_volume(value):
    v = max(0, min(MAX_VOLUME, int(value)))
    
    if not os.path.exists(VOLUME_SCRIPT):
        return jsonify({"ok": False, "error": "Volume control not available"}), 501
    
    subprocess.check_call(["sudo", VOLUME_SCRIPT, "set", str(v)], timeout=5)
    # ...

Volume control logic delegated to external script, enabling flexible implementation (VLC RC interface, system volume, etc).

Original prompt

This section details on the original issue you should resolve

<issue_title>Remove unused code for vlc control</issue_title>
<issue_description>Remove ERROR:root:Failed to import vlc_control: No module named 'vlc_control'

Traceback (most recent call last):

File "/app/app.py", line 27, in

import vlc_control</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: thehack904 <35552907+thehack904@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove unused code for vlc control Remove unused vlc_control module and non-functional API endpoints Feb 18, 2026
Copilot AI requested a review from thehack904 February 18, 2026 16:45
Copilot AI and others added 2 commits February 18, 2026 16:50
Co-authored-by: thehack904 <35552907+thehack904@users.noreply.github.com>
Co-authored-by: thehack904 <35552907+thehack904@users.noreply.github.com>
Copilot AI changed the title Remove unused vlc_control module and non-functional API endpoints Replace broken vlc_control endpoints with shell script-based volume control Feb 18, 2026
Copilot AI changed the title Replace broken vlc_control endpoints with shell script-based volume control Add shell script-based volume control endpoints for remote.html Feb 18, 2026
Copilot AI changed the title Add shell script-based volume control endpoints for remote.html Replace broken vlc_control module with shell script-based volume endpoints Feb 18, 2026
Copilot AI changed the title Replace broken vlc_control module with shell script-based volume endpoints Remove broken vlc_control module and add shell-script based volume endpoints Feb 18, 2026
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.

2 participants