mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-23 11:11:11 +01:00
- **Backend Refactor:** - Merged route and operation files for regex and format. - Updated directory structure and consolidated utility functions. - Removed unnecessary app.py, using `__init__.py` for app creation. - **Git Integration:** - Enhanced git cloning and merging methods, ensuring accurate local file updates. - Implemented comprehensive git status fetching with improved file status display and error handling. - Added branch management features, including branch creation, checkout, deletion, and associated UI improvements. - Integrated loading indicators and fun messages for better user feedback during git operations. - **Settings Manager Enhancements:** - Expanded Git status display, including connected repository link, branch information, and detailed change listings. - Added revert functionality for individual files and all changes, with conditional UI updates based on file statuses. - Integrated `react-toastify` for alert notifications with improved styling. - Improved file name parsing, handling of file paths, and consistent API request structure. - Added UI components for a smooth tab transition and enhanced settings layout. - **General Improvements:** - Revised sanitization logic for less aggressive handling, particularly for regex101 links. - Refactored backend logic to improve performance, specifically optimizing git status checks. - Implemented dynamic retrieval of default branches and enhanced handling of IDs in files. **fixes, refactors, and additional features included**: - Bug fixes for branch handling, git status accuracy, and file name adjustments. - Improved error handling, logging, and user feedback across various components.
28 lines
767 B
Python
28 lines
767 B
Python
from flask import Flask
|
|
from flask_cors import CORS
|
|
from .regex import bp as regex_bp
|
|
from .format import bp as format_bp
|
|
from .settings import bp as settings_bp
|
|
import os
|
|
|
|
REGEX_DIR = os.path.join('data', 'db', 'regex_patterns')
|
|
FORMAT_DIR = os.path.join('data', 'db', 'custom_formats')
|
|
|
|
def create_app():
|
|
app = Flask(__name__)
|
|
CORS(app, resources={r"/*": {"origins": "*"}})
|
|
|
|
# Initialize directories to avoid issues with non-existing directories
|
|
initialize_directories()
|
|
|
|
# Register Blueprints
|
|
app.register_blueprint(regex_bp)
|
|
app.register_blueprint(format_bp)
|
|
app.register_blueprint(settings_bp)
|
|
|
|
return app
|
|
|
|
def initialize_directories():
|
|
os.makedirs(REGEX_DIR, exist_ok=True)
|
|
os.makedirs(FORMAT_DIR, exist_ok=True)
|