Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -206,9 +206,6 @@ def process_reviews_streamlit(app_store_urls: str, play_store_urls: str,
|
|
| 206 |
status_text.text("🤖 Processing reviews with AI models...")
|
| 207 |
progress_bar.progress(30)
|
| 208 |
|
| 209 |
-
# Reset processing status for latest reviews
|
| 210 |
-
pipeline.db.reset_processing_status(limit=review_limit)
|
| 211 |
-
|
| 212 |
reviews = pipeline.db.get_pending_reviews(limit=review_limit)
|
| 213 |
total_reviews = len(reviews)
|
| 214 |
|
|
@@ -503,6 +500,38 @@ def main():
|
|
| 503 |
st.rerun()
|
| 504 |
else:
|
| 505 |
st.info("👈 Enter URLs below to start")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 506 |
|
| 507 |
# Main content - Input or Results
|
| 508 |
if not st.session_state.processing_complete:
|
|
|
|
| 206 |
status_text.text("🤖 Processing reviews with AI models...")
|
| 207 |
progress_bar.progress(30)
|
| 208 |
|
|
|
|
|
|
|
|
|
|
| 209 |
reviews = pipeline.db.get_pending_reviews(limit=review_limit)
|
| 210 |
total_reviews = len(reviews)
|
| 211 |
|
|
|
|
| 500 |
st.rerun()
|
| 501 |
else:
|
| 502 |
st.info("👈 Enter URLs below to start")
|
| 503 |
+
|
| 504 |
+
# Database Management Section
|
| 505 |
+
st.markdown("---")
|
| 506 |
+
st.markdown("### 🗄️ Database Management")
|
| 507 |
+
|
| 508 |
+
# Show current database stats
|
| 509 |
+
try:
|
| 510 |
+
from database_enhanced import EnhancedDatabase
|
| 511 |
+
db = EnhancedDatabase()
|
| 512 |
+
db.connect()
|
| 513 |
+
cursor = db.conn.execute("SELECT COUNT(*) FROM reviews")
|
| 514 |
+
count = cursor.fetchone()[0]
|
| 515 |
+
db.close()
|
| 516 |
+
|
| 517 |
+
st.metric("Total Reviews in DB", count)
|
| 518 |
+
|
| 519 |
+
if count > 0:
|
| 520 |
+
st.caption(f"💡 Database contains {count} reviews from previous analyses")
|
| 521 |
+
except:
|
| 522 |
+
st.metric("Total Reviews in DB", 0)
|
| 523 |
+
|
| 524 |
+
# Reset Database Button
|
| 525 |
+
if st.button("🗑️ Reset Database", type="secondary", use_container_width=True,
|
| 526 |
+
help="Delete all reviews and start fresh. Useful when switching between different apps."):
|
| 527 |
+
import os
|
| 528 |
+
if os.path.exists("review_database.db"):
|
| 529 |
+
os.remove("review_database.db")
|
| 530 |
+
st.success("✅ Database deleted! Ready for fresh analysis.")
|
| 531 |
+
time.sleep(1)
|
| 532 |
+
st.rerun()
|
| 533 |
+
else:
|
| 534 |
+
st.info("ℹ️ No database found to delete")
|
| 535 |
|
| 536 |
# Main content - Input or Results
|
| 537 |
if not st.session_state.processing_complete:
|