Skip to content

Dev#36

Merged
Ogunaru merged 21 commits intomainfrom
dev
Nov 19, 2025
Merged

Dev#36
Ogunaru merged 21 commits intomainfrom
dev

Conversation

@Ogunaru
Copy link
Member

@Ogunaru Ogunaru commented Oct 20, 2025

This pull request introduces several improvements and refactorings across the codebase, focusing on modularizing the BOOTH crawling logic, enhancing error handling and user notifications, and improving database and configuration management. The most significant changes are the refactoring of the crawling logic for maintainability, the addition of new features such as the "FBX only" flag, and improvements to error messaging and notification behavior.

Refactoring and Modularization:

  • Refactored the BOOTH crawling logic in booth_checker/booth.py to use modular helper functions (_crawling_base, _extract_download_info) and selector dictionaries, improving code readability and maintainability. The crawling functions now support more flexible and reusable extraction logic.

Feature Additions and Enhancements:

  • Added the fbx_only flag to both the database schema (booth_items table) and the Discord command interface, enabling users to specify if only FBX file changes should be tracked. This includes updates to the database methods, Discord command definitions, and related data handling. [1] [2] [3] [4] [5] [6]
  • Updated the version file creation in shared.py to include a new fbx-files field, preparing for future support of FBX-specific tracking.

Error Handling and User Notifications:

  • Improved error handling and user notification logic in booth_discord/booth_discord.py: error messages now more clearly explain the likely cause (such as session cookie expiration), and users are notified only after persistent errors, reducing unnecessary alerts. Logging has been enhanced for better traceability.
  • Clarified the exception message in booth_discord/booth.py when a product is not found or not purchased.

Database and Code Quality Improvements:

  • Improved database logic in booth_discord/booth_sqlite.py by simplifying duplicate checks and result handling, and moving imports to avoid circular dependencies. [1] [2] [3]
  • Minor improvements to logging messages for item addition and deletion in Discord commands for clarity. [1] [2]

Configuration and Utility Updates:

  • Added a dry_run flag to the sample configuration file for easier testing and deployment.
  • Refactored S3 upload logic into a class (S3Uploader) in cloudflare.py for better encapsulation and usability.

These changes collectively enhance the maintainability, usability, and reliability of the BOOTH checker and Discord bot system.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds FBX-only tracking and refactors crawling/notification flows, extending database schema, versioning structure, and changelog generation to support selective FBX diffing.

  • Add fbx_only flag across DB schema, Discord command, and processing flow
  • Extend version files with fbx-files and implement FBX-only changelog/summary path
  • Improve error messages and internal logging

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
booth_discord/booth_sqlite.py Adds fbx_only column and updates item insertion to store it
booth_discord/booth_discord.py Adds fbx_only parameter to the Discord command and passes it to DB insertion
booth_discord/booth.py Clarifies not found/not purchased exception message
booth_checker/shared.py Initializes version files with fbx-files field
booth_checker/booth_sqlite.py Updates SELECT to include fbx_only for checker consumption
booth_checker/main.py Wires FBX-only processing, version-file handling, and changelog generation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Ogunaru Ogunaru merged commit 8b1e350 into main Nov 19, 2025
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