1. 26 Sep, 2025 24 commits
  2. 26 Aug, 2025 5 commits
    • Stefy Lanza (nextime / spora )'s avatar
      feat: Add Migration_007 to ensure 'done' status in existing ENUM columns · 48e8d2b8
      Stefy Lanza (nextime / spora ) authored
      - Add Migration_007_AddDoneToStatusEnum class
      - Safely adds 'done' to existing status ENUM if not present
      - Handles databases created before 'done' status was added
      - Includes proper rollback support
      - Update README and CHANGELOG with migration details
      48e8d2b8
    • Stefy Lanza (nextime / spora )'s avatar
      Update · 61453eb5
      Stefy Lanza (nextime / spora ) authored
      61453eb5
    • Stefy Lanza (nextime / spora )'s avatar
      feat: Enhanced match active status logic with status='pending' requirement · a9643217
      Stefy Lanza (nextime / spora ) authored
      - Updated set_active() method to require status='pending' in addition to ZIP upload completion
      - Added comprehensive documentation for new active status criteria
      - Updated CHANGELOG.md with version 1.2.3 details
      - Enhanced README.md with active status requirements documentation
      
      Active status now requires:
      1. ZIP upload status = 'completed'
      2. ZIP checksum present
      3. Match status = 'pending'
      
      This provides more precise control over match activation workflow.
      a9643217
    • Stefy Lanza (nextime / spora )'s avatar
      feat: Add comprehensive match status system · c924ad24
      Stefy Lanza (nextime / spora ) authored
      - Add status column to matches table with 8 enum values (pending, scheduled, bet, ingame, cancelled, failed, paused, done)
      - Create Migration_006_AddStatusColumn for database schema updates
      - Update Match model to include status field with proper enum validation
      - Enhance match detail template to display status information
      - Improve configuration auto-migration system for persistent directories
      - Update README and CHANGELOG with version 1.2.3 documentation
      - Maintain backward compatibility with existing matches
      c924ad24
    • Stefy Lanza (nextime / spora )'s avatar
      feat: Add match status tracking system · f21d1725
      Stefy Lanza (nextime / spora ) authored
      - Add status column to matches table with enum values (pending, scheduled, bet, ingame, cancelled, failed, paused, done)
      - Implement database migration 006 for status tracking
      - Update Match model with status field and validation
      - Enhance match detail template to display status information
      - Update documentation (README and CHANGELOG) for v1.2.3
      - Enable comprehensive match lifecycle management
      f21d1725
  3. 21 Aug, 2025 8 commits
    • Stefy Lanza (nextime / spora )'s avatar
      Delete migrate_config.py · b7912d69
      Stefy Lanza (nextime / spora ) authored
      b7912d69
    • Stefy Lanza (nextime / spora )'s avatar
      Delete token · faed74dd
      Stefy Lanza (nextime / spora ) authored
      faed74dd
    • Stefy Lanza (nextime / spora )'s avatar
      Merge branch 'patch-2' into 'master' · e4b684d8
      Stefy Lanza (nextime / spora ) authored
      Delete prompt.txt
      
      See merge request !1
      e4b684d8
    • Moses's avatar
      Delete prompt.txt · 238f534f
      Moses authored
      238f534f
    • Stefy Lanza (nextime / spora )'s avatar
      Fix fixture parser fighter column mapping bug (v1.2.2) · f6514b18
      Stefy Lanza (nextime / spora ) authored
      - Fixed critical bug where both fighter1 and fighter2 were incorrectly sourced from fighter1 column during XLSX uploads
      - Enhanced FixtureParser.detect_required_columns() with fighter-specific matching logic in app/upload/fixture_parser.py
      - Added proper fighter number detection (1 or 2) to prevent cross-mapping during partial column matching
      - Fighter1 columns now correctly map to fighter1 database field, Fighter2 to fighter2 field
      - Prevents false positives where 'fighter2' column incorrectly matched 'fighter1' field
      - Root cause: Original partial matching used split()[0] causing both 'fighter 1' and 'fighter 2' to become 'fighter'
      - Solution: Implemented specific logic checking for both 'fighter' keyword AND number in column names
      - Updated documentation (README.md, CHANGELOG.md) with bug fix details and version bump to v1.2.2
      - Maintains backward compatibility with existing column naming conventions
      f6514b18
    • Stefy Lanza (nextime / spora )'s avatar
      Fix PyInstaller compatibility issues · 96664e04
      Stefy Lanza (nextime / spora ) authored
      - Fixed import error for get_persistent_directories (renamed to get_config_directory)
      - Fixed TypeError with classmethod call during class definition
      - Added config directory support to directory utilities
      - Enhanced configuration loading with proper function structure
      - Ensured all persistent directories are created during setup
      96664e04
    • Stefy Lanza (nextime / spora )'s avatar
      Add cross-platform persistent directories and authenticated ZIP downloads (v1.2.1) · 034ce1c1
      Stefy Lanza (nextime / spora ) authored
      ## Cross-Platform PyInstaller Support
      - Implemented persistent directory system for Windows (%APPDATA%), macOS (~/Library/Application Support), and Linux (/opt/MBetter)
      - Added PyInstaller environment detection and automatic directory path optimization
      - Created comprehensive directory utilities (app/utils/directories.py) with fallback mechanisms
      - Enhanced configuration system to use persistent mbetterd.conf instead of .env for PyInstaller deployments
      
      ## Configuration System Enhancement
      - Added configuration file migration system (migrate_config.py) for .env to mbetterd.conf transition
      - Enhanced config.py with persistent config file loading and priority system (env vars > config file > defaults)
      - Automatic config file discovery in persistent directories with fallback to local .env
      
      ## Authenticated ZIP Downloads
      - Added new /api/download/zip/<match_id> endpoint with hybrid JWT/API token authentication
      - Enhanced /api/updates endpoint to use authenticated download URLs instead of web routes
      - Implemented access control ensuring users can only download their own match files (or admin access)
      - Updated API routes to use persistent ZIP_UPLOADS_DIR for file serving
      
      ## Upload System Enhancement
      - Modified file upload handlers to use persistent directories (ZIP_UPLOADS_DIR, FIXTURES_DIR, TEMP_DIR)
      - Enhanced upload file paths to use appropriate persistent directories based on file type
      - Updated main routes for ZIP downloads to use persistent directory paths
      - Fixed PyInstaller temporary directory issues ensuring files persist between application restarts
      
      ## Documentation Updates
      - Updated README.md with PyInstaller features, cross-platform compatibility, and authenticated downloads
      - Enhanced CHANGELOG.md with comprehensive v1.2.1 release notes
      - Added migration utility documentation and deployment instructions
      - Updated version numbers and platform compatibility information
      
      ## Technical Improvements
      - Enhanced error handling and logging throughout persistent directory operations
      - Added comprehensive fallback mechanisms for various deployment scenarios
      - Improved path handling with proper cross-platform directory structures
      - Security enhancements for API file downloads with proper authentication validation
      034ce1c1
    • Stefy Lanza (nextime / spora )'s avatar
      Add /api/updates endpoint with fixture tracking and hybrid authentication (v1.2.0) · a27c1fa8
      Stefy Lanza (nextime / spora ) authored
      ## New Features
      - **New /api/updates endpoint**: Incremental fixture synchronization with optional timestamp filtering
        - Supports both GET (query params) and POST (JSON body) methods
        - Optional 'from' parameter for unix timestamp-based filtering
        - Returns fixtures updated after specified timestamp or last N fixtures
        - Includes ZIP download URLs in API response
        - Configurable default count via system settings
      
      - **Fixture active time tracking**: Automatic timestamp management
        - Added fixture_active_time column (BigInteger, indexed) to matches table
        - Automatic timestamp setting when all matches in fixture become active
        - Preserves original activation time (no overwrites)
      
      - **Hybrid authentication system**: Maximum compatibility
        - Supports JWT tokens (short-lived, from login) AND API tokens (long-lived, from web interface)
        - Tries JWT first, falls back to API tokens automatically
        - Multiple token header formats: Authorization Bearer, X-API-Token, query parameter
      
      - **SHA1-based ZIP file naming**: Consistent file naming
        - Uses SHA1 hash of (unix_timestamp + original_filename)
        - Applied across all upload methods for consistency
      
      ## Technical Implementation
      - **Database Migration_005**: Added fixture_active_time column with proper indexing
      - **System settings integration**: New api_updates_default_count setting (default: 10)
      - **Backfill utility**: backfill_fixture_times.py for existing fixture data migration
      - **Fallback mechanisms**: Graceful degradation for existing data without timestamps
      - **Query optimization**: Proper limits and ordering for both default and filtered queries
      
      ## Bug Fixes
      - Fixed logging import errors in models.py (get_logger function)
      - Python 2.7 compatibility fixes in migration scripts
      - Type conversion issues in SystemSettings.get_setting()
      
      ## Documentation
      - Created comprehensive CHANGELOG.md
      - Updated README.md with new endpoint documentation and examples
      - Added API usage examples for both GET and POST methods
      - Updated version to 1.2.0 with feature highlights
      
      ## Files Modified
      - app/api/routes.py: New /api/updates endpoint with hybrid auth
      - app/models.py: Added fixture tracking methods and backfill utility
      - app/database/migrations.py: Migration_005 for schema changes
      - backfill_fixture_times.py: Data migration utility for existing fixtures
      - README.md: Updated documentation and examples
      - CHANGELOG.md: Comprehensive change log following keep-a-changelog format
      a27c1fa8
  4. 18 Aug, 2025 3 commits
    • Stefy Lanza (nextime / spora )'s avatar
    • Stefy Lanza (nextime / spora )'s avatar
      Implement comprehensive fixture-level ZIP upload feature · ccb23745
      Stefy Lanza (nextime / spora ) authored
      USER REQUEST:
      'in the fixture details page of the web interface after the list of matches a file upload button with progress bar to upload a zip file that will be associated with all the matches that doesn't have already one'
      
      IMPLEMENTATION COMPLETED:
      
      1. Backend Route (app/upload/routes.py):
         - Added /upload/fixture/<fixture_id>/zip endpoint for fixture-level ZIP uploads
         - Filters matches by fixture_id and excludes those with existing ZIP files
         - Processes single ZIP upload and associates with all qualifying matches
         - Comprehensive error handling and database transaction management
         - Integration with existing file upload handler for large file support
      
      2. Frontend Template (app/templates/main/fixture_detail.html):
         - Added fixture upload component after match list as requested
         - Progress bar with real-time upload tracking
         - Status messages and visual feedback for user experience
         - Conditional display - only shows when matches without ZIP files exist
         - Informational content explaining the bulk upload functionality
      
      3. JavaScript Functionality:
         - AJAX upload with XMLHttpRequest for progress tracking
         - Real-time progress bar updates during file upload
         - Comprehensive error handling and recovery
         - Automatic file selection event handling
         - Status management with success/error states
      
      4. Template Logic:
         - Filters matches to show only those without ZIP files
         - Groups matches by fixture_id for bulk operations
         - Conditional rendering based on upload eligibility
         - Integration with existing match display structure
      
      TECHNICAL FEATURES:
      -  Bulk upload: One ZIP file associated with multiple matches
      -  Progress tracking: Real-time upload progress bar
      -  File filtering: Only affects matches without existing ZIP files
      -  Large file support: Up to 2GB with streaming capabilities
      -  Error handling: Network and upload error recovery
      -  User feedback: Clear status messages and visual indicators
      -  Database integrity: Transaction-based updates with rollback
      -  Memory optimization: Chunked upload processing
      
      TESTING VERIFICATION:
      - Route registration confirmed: POST /upload/fixture/<fixture_id>/zip
      - Template components verified: upload form, progress bar, status tracking
      - JavaScript functions confirmed: startFixtureUpload, updateFixtureProgress
      - File handler integration tested: large file support ready
      - Template logic verified: conditional display and match filtering
      
      The fixture-level ZIP upload feature is fully implemented and ready for use.
      ccb23745
    • Stefy Lanza (nextime / spora )'s avatar
      Fix admin settings UI issues: toggle switches and button text · ef8eb092
      Stefy Lanza (nextime / spora ) authored
      PROBLEMS FIXED:
      
      1. Toggle Switches Not Synced with Current Status:
         - Template was checking for string 'true' but SystemSettings returns boolean values
         - Updated all boolean checks to handle both boolean True and string 'true'
         - Fixed registration_enabled and maintenance_mode toggle switches
         - Fixed badge status displays in both quick settings cards and table
      
      2. Action Buttons Showing as Blue Rectangles Without Text:
         - Buttons only had icons (<i class='fas fa-edit'></i>) without visible text
         - Added visible text labels: 'Edit' and 'Delete' alongside icons
         - Added title attributes for better user experience and accessibility
         - Maintained icon + text combination for better UX
      
      TECHNICAL CHANGES:
      
      Template Updates (app/templates/main/admin_settings.html):
      - Line 40: Updated registration toggle check to handle both boolean and string
      - Line 48-49: Updated registration status badge logic
      - Line 67: Updated maintenance toggle check to handle both boolean and string
      - Line 75-76: Updated maintenance status badge logic
      - Line 113: Updated table value badge logic for boolean settings
      - Line 142-143: Added 'Edit' text to edit buttons with title attribute
      - Line 147-148: Added 'Delete' text to delete buttons with title attribute
      
      COMPATIBILITY:
      - Handles both boolean (True/False) and string ('true'/'false') values
      - Maintains backward compatibility with existing SystemSettings data
      - Works regardless of how the settings are stored or retrieved
      
      USER EXPERIENCE IMPROVEMENTS:
      - Toggle switches now correctly reflect the actual setting status
      - Action buttons are clearly labeled and accessible
      - Tooltips provide additional context for button actions
      - Consistent styling with Bootstrap 5 framework
      
      Both reported issues are now resolved and the admin settings interface should work correctly.
      ef8eb092