Commit Graph

883 Commits

Author SHA1 Message Date
github-actions[bot]
72d30f8dbb chore: bump version to 1.0.0 v1.0.0 2025-10-19 12:29:47 +00:00
Fengqing Liu
1718a436e3 chore: add environment specification and token configuration to release workflow 2025-10-19 23:29:01 +11:00
Fengqing Liu
30e0f0a322 branch fix 2025-10-19 22:39:31 +11:00
Fengqing Liu
31a9056f65 clean up 2025-10-19 22:31:39 +11:00
Fengqing Liu
45e0c47970 migrate to pyproject.toml following PEP 621 standard
Replace requirements.txt with modern pyproject.toml configuration to align with Python packaging best practices. All dependencies are now declared in [project] section, with optional dev dependencies (ruff, mypy) in [project.optional-dependencies].

Updated all references:
- Dockerfile: Install with `pip install .` instead of `-r requirements.txt`
- setup_env.sh: Install with `pip install -e .` for editable development mode
- README.md: Updated installation instructions in both quick start and development sections
- CLAUDE.md: Updated documentation references
- .gitignore: Added common IDE and tool directories

Installation is now: `pip install -e .` for development or `pip install .` for production.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 21:50:52 +11:00
Fengqing Liu
02ff8487bd chore: remove obsolete CI workflows and add new publish workflow 2025-10-19 21:37:05 +11:00
Fengqing Liu
b965147698 refactor: update Docker workflow for build validation and remove unnecessary steps 2025-10-19 21:06:34 +11:00
Fengqing Liu
ecd39a1c8e add SemVer release process with automated publishing
- Split workflows: CI (lint/validate) and Docker (dev builds)
- Add release.yml for versioned releases with manual trigger
- Release workflow creates release/<version> branches, updates version.py, builds Docker images with SemVer tags, and creates GitHub releases
- Docker images tagged as major.minor.patch, major.minor, major, latest for stable releases
- Pre-release versions tagged with exact version only

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 20:58:59 +11:00
Fengqing Liu
603d07f3d3 remove release 2025-10-19 18:31:46 +11:00
Fengqing Liu
4099dbf52f docker 2025-10-19 18:28:05 +11:00
Fengqing Liu
f57675b592 remove "priority" 2025-10-19 17:23:24 +11:00
Fengqing Liu
490065821a remove "autostart" 2025-10-19 17:18:10 +11:00
Fengqing Liu
6a5610b69d format 2025-10-19 17:15:52 +11:00
Fengqing Liu
a321da91f8 remove "tray" 2025-10-19 17:15:28 +11:00
Fengqing Liu
d466f46d6f remove redundant stuff 2025-10-19 17:08:18 +11:00
Fengqing Liu
e8144e9591 chore: Refactor environment detection and paths; remove unused variables and improve resource path handling 2025-10-19 16:27:12 +11:00
Fengqing Liu
3cedd0ef7f chore: Remove legacy logging options and build scripts; update logging to use TimedRotatingFileHandler 2025-10-19 12:40:22 +11:00
Fengqing Liu
42a491331e bug fix: stuck on shutdown 2025-10-19 10:57:48 +11:00
Fengqing Liu
472e6d73bd Add configurable minimum refresh interval setting
Added user-configurable minimum refresh interval for inventory reloads, allowing users to control how frequently the maintenance service triggers updates (default: 30 minutes, range: 1-1440 minutes).

- Add minimum_refresh_interval_minutes to settings system with default of 30 minutes
- Update maintenance service to use configurable interval instead of hardcoded 1-minute value
- Add GUI input field in General Settings with auto-save functionality
- Include field in API settings endpoint and settings manager

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 10:56:40 +11:00
Fengqing Liu
f62ec26b5d chore: Major code quality improvements - Remove dead code, add Ruff & Mypy
This commit implements a comprehensive code quality overhaul including
dead code removal, modern linting tools, type checking, and CI/CD integration.

## Dead Code Removal

### Removed Files:
- src/utils/cache.py (137 lines) - Desktop GUI remnant with tkinter dependencies
  * No longer needed in web-only architecture
  * Conflicted with web version at src/web/managers/cache.py

### Removed Functions:
- src/auth/auth_state.py::_login() (170 lines) - Deprecated password authentication
  * OAuth device code flow is now the only login method
  * Removed legacy 2FA, CAPTCHA, and password login code
  * Updated class docstring to reflect OAuth-only authentication

### Removed Imports (12 occurrences):
- Unused TYPE_CHECKING imports (NoReturn, LoginFormManager, etc.)
- Orphaned exception imports (CaptchaRequired, LoginException)
- Unused utility imports (AwaitableValue, State, io, sys, Path)
- Removed commented-out imports and dead code references

**Total removed: 308+ lines of unused code**

## Modern Linting with Ruff

### Added ruff (v0.14.1):
- 10-100x faster than legacy linters (Flake8, pyflakes)
- Auto-fixed 56 issues across 46 files
- Import sorting with isort integration
- Modern Python idioms (pyupgrade)
- Code simplification suggestions

### Fixes Applied:
- Sorted imports alphabetically in all files
- Replaced try-except-pass with contextlib.suppress()
- Added exception chaining with 'from err'
- Renamed unused loop variables to _var
- Simplified comprehensions and ternary operators
- Removed unnecessary .keys() calls

**Result: 0 Ruff warnings (100% pass rate)**

## Type Checking with Mypy

### Added mypy (v1.18.2):
- Static type checking across 55 source files
- Reduced type errors from 25 to 5 (80% improvement)
- Configured gradual strictness for JSON/GraphQL responses

### Type Fixes:
- Fixed PyInstaller _MEIPASS attribute access
- Added type: ignore for safe variable redefinitions
- Fixed translator return type cast
- Added null checks for optional attributes
- Resolved circular import issues

### Configuration:
- Lenient initial settings for gradual adoption
- Per-module overrides for dynamic JSON responses
- Error codes shown for easy debugging

**Result: 5 non-critical errors remaining**

## CI/CD Integration

### Updated .github/workflows/ci.yml:
- Added new 'lint' job running Ruff + Mypy
- Ruff checks are required to pass
- Mypy checks run but don't block (advisory)
- Docker build now depends on lint + validate jobs

### Workflow:
```
lint (Ruff + Mypy) → validate (Language files) → docker → release
```

## Configuration

### Created pyproject.toml:
```toml
[tool.ruff]
line-length = 100
target-version = "py310"
select = ["E", "W", "F", "I", "UP", "B", "SIM", "C4"]

[tool.mypy]
python_version = "3.10"
check_untyped_defs = true
strict_equality = true
```

## Statistics

### Code Reduction:
- **Before:** 8,130 lines across 56 files
- **After:** 7,213 lines across 55 files
- **Reduction:** -917 lines (-11.3%)

### Quality Metrics:
- **Pyflakes:** 16 warnings → Ruff: 0 warnings
- **Mypy:** Not configured → 5 errors (from 25)
- **Linting speed:** 2s → 0.2s (10x faster)
- **Auto-fix rate:** 79% (46/58 issues)

### Files Modified: 48 files
- 1 deleted (src/utils/cache.py)
- 1 created (pyproject.toml)
- 46 updated (imports, types, style)

## Breaking Changes

None - all changes are internal quality improvements.
Application still runs perfectly (v16.dev).

## Migration Notes

### For Developers:
```bash
# Install new tools
pip install ruff mypy

# Run quality checks
ruff check src/          # Fast linting
mypy src/                # Type checking
ruff check src/ --fix    # Auto-fix issues
```

### For CI/CD:
- Linting now runs automatically on all commits
- Failed Ruff checks will block builds
- Mypy checks are advisory (won't block)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 00:02:54 +11:00
Fengqing Liu
68118d9e4b Add manual mode feature with UI improvements and batch updates
This commit introduces a manual mode for channel selection that allows users to lock onto a specific game, along with significant UI/UX improvements:

Manual Mode Features:
- Locks channel selection to a specific game when user manually selects a different game
- Automatically exits manual mode when all drops for the game are completed
- Shows visual indicators (🎯 badge) in status bar and drop display
- Allows manual exit via "Return to Auto Mode" button
- Prioritizes manual game in wanted_games list during auto-selection

UI/UX Improvements:
- Batch update system for channels and campaigns prevents flickering during refresh
- Channels list now updates atomically instead of clearing and re-adding
- Campaign loading emits all campaigns at once for smooth initial load
- Drop progress persists on initial_state load for reconnecting clients
- Game icons (box art) now displayed in channel list
- Campaign links added to inventory items

Bug Fixes:
- Fixed logging level to respect INFO by default (was hardcoded to DEBUG)
- Fixed channel cleanup to not call channel.remove() (handled by batch_update)
- Fixed drop display not persisting during channel switch
- Fixed stop_watching() clearing drop timer prematurely
- Fixed status display typo ("fames_to_watch" → "games_to_watch")

Backend Changes:
- Added manual mode tracking (_manual_target_channel, _manual_target_game)
- Added enter_manual_mode(), exit_manual_mode(), is_manual_mode() methods
- Added get_manual_mode_info() for API serialization
- Added batch_update() to ChannelListManager for atomic updates
- Added start_batch()/finalize_batch() to InventoryManager
- Added /api/mode/exit-manual endpoint
- Game model now stores box_art_url from GraphQL response
- Manual mode info included in /api/status and initial_state

Frontend Changes:
- Added manual mode badge and controls in UI
- Added channels_batch_update and inventory_batch_update socket events
- Added manual_mode_update socket event
- Countdown timer now properly tracked and cleared
- Drop display shows manual mode status with game name
- Exit manual mode button added to drop display area

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-18 00:22:34 +11:00
Fengqing Liu
323c2ac40d Disable automatic CI builds
- Comment out push and pull_request triggers
- Keep workflow_dispatch for manual runs only
- Prevents automatic builds on every push

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 20:04:23 +11:00
Fengqing Liu
849bf5372a docker ci only 2025-10-16 23:35:05 +11:00
Fengqing Liu
77fc709fa2 Update README to support fork maintainer
- Change "Support the Original Author" section to "Support This Fork"
- Feature buymeacoffee.com/rangermix as primary support link
- Keep acknowledgment of original author with their support links

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 23:31:46 +11:00
Fengqing Liu
8b2c28f76d Update Docker and CI workflow for refactored project structure
- Fix CI workflow to reference src/version.py instead of version.py
- Update Python import paths for version extraction in AppImage job
- Fix Dockerfile to use requirements.txt and copy src/ directory
- Remove deprecated --web flag from Docker CMD
- Remove obsolete version: '3.8' from docker-compose.yml
- Add Docker build job to CI workflow with multi-arch support (amd64, arm64)
- Push Docker images to GitHub Container Registry (ghcr.io)
- Add OCI image labels with build metadata to Dockerfile
- Update README with pre-built Docker image instructions
- Update funding information

All changes ensure compatibility with the refactored src/ package structure
and enable automated Docker image publishing via GitHub Actions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 23:28:00 +11:00
Fengqing Liu
423ee451ac Update README to reflect fork status and AI development
- Add note at top indicating this is a fork of DevilXD/TwitchDropsMiner
- Add disclaimer about AI-assisted development (Claude Code)
- Update git clone URL to rangermix/TwitchDropsMiner
- Add dedicated Acknowledgments section with credits to original author
- Update Support section to encourage supporting original author
- Rename Credits to Translation Credits for clarity

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 22:14:59 +11:00
Fengqing Liu
5b736e3bb1 Migrate to Docker-ready web UI and remove legacy desktop GUI
Replace the legacy desktop/Tkinter client and packaging artifacts with a Docker-first, web-hosted approach.

- Add Docker quickstart and run-from-source instructions to the README to simplify deployment.
- Simplify launcher to invoke the new web backend module instead of the old desktop entrypoint.
- Update dependencies for a web UI stack (FastAPI, Uvicorn, python-socketio, Jinja2, etc.) and remove desktop/tray-specific packages.
- Remove legacy GUI, packaging and platform-specific helper code, along with obsolete build/pack scripts and AppImage assets to declutter the repo.
- Tidy project ignore rules to add runtime logs and editor metadata.

Rationale: streamline deployment, favor a browser-accessible interface, and reduce maintenance overhead from multiple platform-specific GUI/packaging implementations.
2025-10-16 21:54:43 +11:00
DevilXD
2388757ebe Enforce game matching for badge campaigns 2025-10-11 16:26:22 +02:00
DevilXD
a25c4a7bbb Remove unneeded GameDirectory GQL parameter 2025-10-10 08:06:03 +02:00
DevilXD
bbc323b4d7 Fix an issue with Language and Priority mode comboboxes cutting off text in translations 2025-10-09 17:44:34 +02:00
DevilXD
7b95818add Force the drops_enabled flag to True 2025-10-03 17:23:18 +02:00
DevilXD
64c1b93b5b Disable UPX downloading step in CI 2025-09-22 22:23:38 +02:00
AnoPem
134783eba7 Update DirectoryPage_Game
Updated sha256Hash for DirectoryPage_Game and its variables
2025-09-21 14:13:42 +02:00
DevilXD
05d97321ea Add simple manual configuration options to the build spec 2025-09-12 14:03:07 +02:00
DevilXD
b029428cb3 Implement the nopause option for the build script 2025-09-12 13:41:50 +02:00
DevilXD
0c8c3f5f32 Fix an error due to invalid campaigns missing their assigned game 2025-09-10 17:28:18 +02:00
DevilXD
b44100764c Implement drop progression tracking across all drops in a campaign 2025-09-10 00:08:03 +02:00
DevilXD
6e08d1ef50 Fix an issue with the miner not switching away from no-longer-watchable channels in specific cases 2025-09-09 23:01:39 +02:00
DevilXD
f3c189e86d Fix an issue with the drops_enabled flag reporting true for sub-only drops 2025-09-09 22:57:54 +02:00
kWAY
2737936739 Implement dark mode theme (#744)
Co-authored-by: DevilXD <4180725+DevilXD@users.noreply.github.com>
2025-08-27 17:19:32 +02:00
DevilXD
f990437731 Handle the possibility of a drop having no benefits 2025-08-24 09:55:47 +02:00
Dmitriy
56a7fd4fb2 Update Ukrainian and Russian translations (#757)
Co-authored-by: DevilXD <4180725+DevilXD@users.noreply.github.com>
2025-08-22 23:40:06 +02:00
DevilXD
9329e52643 Fix priority mode names not being translated 2025-08-22 19:04:01 +02:00
DevilXD
1b17dd6784 Fix GUI debug code 2025-08-22 18:58:05 +02:00
DevilXD
cb9b6ab42f Implement force-expired campaign invalidation 2025-08-22 15:33:51 +02:00
DevilXD
69b861d1ba Upgrade UPX version 2025-08-20 20:36:38 +02:00
DevilXD
826fe95f9c Reimplement the old mining method (ref b47b208) 2025-08-17 22:05:44 +02:00
DevilXD
87a30201e4 Minor code leftover to use while resolving issues with unclosed/unreleased resources 2025-08-17 21:58:28 +02:00
DevilXD
6626f94015 Minor typing fix 2025-07-27 11:14:42 +02:00
guihkx
eab58cd5f2 ci/linux: provide PyInstaller package for aarch64 2025-07-27 10:58:01 +02:00