v4.3 ui: 3D wooden bookshelf redesign, fix player cover aspect ratio, and smooth subtitle scroll
This commit is contained in:
@@ -6,6 +6,8 @@ from flask import Blueprint, request, jsonify
|
||||
from db import get_db
|
||||
from docx_processor import process_docx_to_markdown
|
||||
from ai_processor import process_document_smartly
|
||||
from thumbnail_generator import generate_docx_thumbnail
|
||||
from media_storage import save_pending_thumbnail
|
||||
from auth import login_required
|
||||
|
||||
docx_bp = Blueprint('docx', __name__)
|
||||
@@ -44,11 +46,27 @@ def upload_docx():
|
||||
|
||||
print(f"✅ Word document processed & reconstructed: {block_count} blocks ({text_count} text, {image_count} images)")
|
||||
|
||||
# --- v4.4: DOCX থেকে অটো থাম্বনেইল (embedded thumbnail / প্রথম ইমেজ) ---
|
||||
pending_thumbnail = None
|
||||
pending_thumbnail_format = None
|
||||
try:
|
||||
thumb_bytes, thumb_fmt = generate_docx_thumbnail(file_bytes, smart_blocks)
|
||||
if thumb_bytes:
|
||||
token = save_pending_thumbnail(thumb_bytes, thumb_fmt)
|
||||
if token:
|
||||
pending_thumbnail = token
|
||||
pending_thumbnail_format = thumb_fmt
|
||||
print(f" 🖼️ Auto-thumbnail generated: {token} ({len(thumb_bytes)} bytes)")
|
||||
except Exception as te:
|
||||
print(f" ⚠️ Thumbnail step skipped: {te}")
|
||||
|
||||
return jsonify({
|
||||
'success': True,
|
||||
'filename': doc_file.filename,
|
||||
'metadata': result.get('metadata', {}),
|
||||
'blocks': smart_blocks
|
||||
'blocks': smart_blocks,
|
||||
'pending_thumbnail': pending_thumbnail,
|
||||
'pending_thumbnail_format': pending_thumbnail_format
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user