Skip to content

Conversation

@h9zdev
Copy link

@h9zdev h9zdev commented Nov 11, 2025

📝 Changelog

Version 2.0 (Modified by h9zdev)

🐛 Bug Fixes

  1. Cross-Platform Path Compatibility (mk14.py)

    • Issue: Hardcoded Linux path /var/www/html/mk14-supervision/static/cameras caused FileNotFoundError on Windows
    • Fix: Replaced with cross-platform path resolution using os.path.dirname(os.path.abspath(__file__))
    • Impact: Application now works on Windows, Linux, and macOS
  2. Jinja2 Template Syntax Error (templates/index.html)

    • Issue: Incorrect Python-style conditional expressions in Jinja2 template caused template rendering errors
    • Before: parseGEO("/mk14/static/cameras/{{ location if location.endswith('geojson') }}");
    • Fix: Replaced with proper Jinja2 {% if %} blocks
    • Impact: Templates now render correctly without JavaScript errors
  3. Missing Error Handling (mk14.py)

    • Issue: No error handling for missing directories or file system errors
    • Fix: Added directory existence check and try-except block in list_files() function
    • Impact: Application gracefully handles missing directories instead of crashing

✨ Improvements

  1. Debug Mode Enabled

    • Enabled Flask debug mode by default for better error visibility during development
    • Provides detailed error messages in browser for easier troubleshooting
  2. Enhanced Error Messages

    • Added informative error messages when directory operations fail
    • Better user experience when encountering file system issues
  3. Documentation Updates

    • Completely rewrote README.md with comprehensive documentation
    • Added installation instructions, usage guide, and configuration details
    • Added contributors section crediting all developers
    • Improved project structure documentation

📋 Code Changes Summary

File: mk14.py

  • Line 20-32: Enhanced list_files() function with error handling
  • Line 37-40: Fixed path resolution for cross-platform compatibility
  • Line 92: Enabled debug mode by default

File: templates/index.html

  • Line 181-187: Fixed Jinja2 template syntax for camera file loading

File: README.md

  • Complete rewrite with modern formatting
  • Added comprehensive documentation sections
  • Added changelog and contributors information

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