ttmp32gme Module

Main Flask application for ttmp32gme.

Overview

Flask web server providing UI and HTTP API for ttmp32gme.

Key Functions

get_db(): Get/create DBHandler singleton

fetch_config(): Load configuration from database

main(): Entry point - parses args, starts server

Routes

Pages: / (upload), /library, /print, /help, /config

API: /api/upload, /api/albums, /api/create_gme, /api/copy_to_tiptoi, /api/delete_album, /api/config, /api/tiptoi_status

Assets: /images/<filename> - Serve OID images

Command Line

python -m ttmp32gme.ttmp32gme [OPTIONS]

Options:
  --port, -p PORT         Server port (default: 10020)
  --host HOST            Server host (default: 127.0.0.1)
  --database DATABASE    Custom database path
  --library LIBRARY      Custom library path
  --verbose, -v          Increase verbosity (-v for INFO, -vv for DEBUG)
  --version              Show version

Configuration

  • host: Server address (127.0.0.1)

  • port: Server port (10020)

  • library_path: Album storage directory

  • audio_format: MP3 or OGG

  • pen_language: TipToi language

Main ttmp32gme Flask application.

ttmp32gme.ttmp32gme.get_db()[source]

Get database handler.

ttmp32gme.ttmp32gme.fetch_config()[source]

Fetch configuration from database.

Return type:

Dict[str, Any]

ttmp32gme.ttmp32gme.save_config(config_params)[source]

Save configuration to database.

Return type:

tuple[Dict[str, Any], str]

ttmp32gme.ttmp32gme.get_navigation(url)[source]

Generate navigation HTML.

Return type:

str

ttmp32gme.ttmp32gme.index()[source]

Upload page.

ttmp32gme.ttmp32gme.upload_post()[source]

Handle file uploads.

ttmp32gme.ttmp32gme.library()[source]

Library page.

ttmp32gme.ttmp32gme.library_post()[source]

Handle library operations.

ttmp32gme.ttmp32gme.print_page()[source]

Print page.

ttmp32gme.ttmp32gme.print_post()[source]

Handle print operations.

ttmp32gme.ttmp32gme.pdf_page()[source]

PDF generation page.

ttmp32gme.ttmp32gme.config_page()[source]

Configuration page.

ttmp32gme.ttmp32gme.config_post()[source]

Handle configuration updates.

ttmp32gme.ttmp32gme.help_page()[source]

Help page.

ttmp32gme.ttmp32gme.get_logs()[source]

Get recent log entries.

ttmp32gme.ttmp32gme.set_log_level()[source]

Set the log level dynamically.

ttmp32gme.ttmp32gme.serve_dynamic_image(filename)[source]

Serve dynamically generated images (OID codes, covers, etc.).

ttmp32gme.ttmp32gme.download_gme(oid)[source]

Download GME file for an album.

ttmp32gme.ttmp32gme.download_oid_images()[source]

Download all OID images as a ZIP file.

ttmp32gme.ttmp32gme.main()[source]

Main entry point.