index.html 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Audiobookshelf Recommendations</title>
  7. <link rel="stylesheet" href="/static/css/style.css">
  8. </head>
  9. <body>
  10. <div class="container">
  11. <header>
  12. <h1>Audiobookshelf Recommendations</h1>
  13. <p class="subtitle">AI-powered book recommendations based on your listening history</p>
  14. </header>
  15. <div class="actions">
  16. <button onclick="syncLibrary()" class="btn btn-primary">Sync with Audiobookshelf</button>
  17. <button onclick="generateRecommendations()" class="btn btn-secondary">Generate New Recommendations</button>
  18. </div>
  19. <div id="message" class="message hidden"></div>
  20. <section class="section">
  21. <h2>Your Recommendations</h2>
  22. <div id="recommendations-container">
  23. {% if recommendations %}
  24. <div class="recommendations-grid">
  25. {% for rec in recommendations %}
  26. <div class="recommendation-card">
  27. <h3>{{ rec.title }}</h3>
  28. <p class="author">by {{ rec.author }}</p>
  29. <p class="description">{{ rec.description }}</p>
  30. <div class="reason">
  31. <strong>Why this book:</strong>
  32. <p>{{ rec.reason }}</p>
  33. </div>
  34. {% if rec.genres %}
  35. <div class="genres">
  36. {% for genre in rec.genres.split(',') if rec.genres else [] %}
  37. <span class="genre-tag">{{ genre.strip() }}</span>
  38. {% endfor %}
  39. </div>
  40. {% endif %}
  41. </div>
  42. {% endfor %}
  43. </div>
  44. {% else %}
  45. <p class="empty-state">No recommendations yet. Sync your library and generate recommendations!</p>
  46. {% endif %}
  47. </div>
  48. </section>
  49. <section class="section">
  50. <h2>Recent Listening History</h2>
  51. <div id="history-container">
  52. {% if books %}
  53. <div class="history-list">
  54. {% for item in books %}
  55. <div class="history-item">
  56. <div class="book-info">
  57. <h3>{{ item.book.title }}</h3>
  58. <p class="author">by {{ item.book.author }}</p>
  59. </div>
  60. <div class="progress-info">
  61. {% if item.session.is_finished %}
  62. <span class="status finished">Finished</span>
  63. {% else %}
  64. <span class="status in-progress">In Progress ({{ (item.session.progress * 100) | round | int }}%)</span>
  65. {% endif %}
  66. </div>
  67. </div>
  68. {% endfor %}
  69. </div>
  70. {% else %}
  71. <p class="empty-state">No listening history found. Click "Sync with Audiobookshelf" to load your data.</p>
  72. {% endif %}
  73. </div>
  74. </section>
  75. </div>
  76. <script src="/static/js/app.js"></script>
  77. </body>
  78. </html>