GameSentenceMiner 2.18.15__py3-none-any.whl → 2.18.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of GameSentenceMiner might be problematic. Click here for more details.

Files changed (34) hide show
  1. GameSentenceMiner/anki.py +8 -53
  2. GameSentenceMiner/ui/anki_confirmation.py +16 -2
  3. GameSentenceMiner/util/db.py +11 -7
  4. GameSentenceMiner/util/games_table.py +320 -0
  5. GameSentenceMiner/web/anki_api_endpoints.py +506 -0
  6. GameSentenceMiner/web/database_api.py +239 -117
  7. GameSentenceMiner/web/static/css/loading-skeleton.css +41 -0
  8. GameSentenceMiner/web/static/css/search.css +54 -0
  9. GameSentenceMiner/web/static/css/stats.css +76 -0
  10. GameSentenceMiner/web/static/js/anki_stats.js +304 -50
  11. GameSentenceMiner/web/static/js/database.js +44 -7
  12. GameSentenceMiner/web/static/js/heatmap.js +326 -0
  13. GameSentenceMiner/web/static/js/overview.js +20 -224
  14. GameSentenceMiner/web/static/js/search.js +190 -23
  15. GameSentenceMiner/web/static/js/stats.js +371 -1
  16. GameSentenceMiner/web/stats.py +188 -0
  17. GameSentenceMiner/web/templates/anki_stats.html +145 -58
  18. GameSentenceMiner/web/templates/components/date-range.html +19 -0
  19. GameSentenceMiner/web/templates/components/html-head.html +45 -0
  20. GameSentenceMiner/web/templates/components/js-config.html +37 -0
  21. GameSentenceMiner/web/templates/components/popups.html +15 -0
  22. GameSentenceMiner/web/templates/components/settings-modal.html +233 -0
  23. GameSentenceMiner/web/templates/database.html +13 -3
  24. GameSentenceMiner/web/templates/goals.html +9 -31
  25. GameSentenceMiner/web/templates/overview.html +16 -223
  26. GameSentenceMiner/web/templates/search.html +46 -0
  27. GameSentenceMiner/web/templates/stats.html +49 -311
  28. GameSentenceMiner/web/texthooking_page.py +4 -66
  29. {gamesentenceminer-2.18.15.dist-info → gamesentenceminer-2.18.16.dist-info}/METADATA +1 -1
  30. {gamesentenceminer-2.18.15.dist-info → gamesentenceminer-2.18.16.dist-info}/RECORD +34 -25
  31. {gamesentenceminer-2.18.15.dist-info → gamesentenceminer-2.18.16.dist-info}/WHEEL +0 -0
  32. {gamesentenceminer-2.18.15.dist-info → gamesentenceminer-2.18.16.dist-info}/entry_points.txt +0 -0
  33. {gamesentenceminer-2.18.15.dist-info → gamesentenceminer-2.18.16.dist-info}/licenses/LICENSE +0 -0
  34. {gamesentenceminer-2.18.15.dist-info → gamesentenceminer-2.18.16.dist-info}/top_level.txt +0 -0
@@ -1,29 +1,9 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
 
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>GSM - Goals</title>
8
- <!-- Include Chart.js from a CDN -->
9
- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
10
-
11
- <!-- Include html2canvas for screenshot functionality -->
12
- <script src="https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js"></script>
13
-
14
- <!-- Include shared theme styles -->
15
- {% include 'components/theme-styles.html' %}
16
-
17
- <!-- Include shared CSS -->
18
- <link rel="stylesheet" href="/static/css/shared.css">
19
-
20
- <!-- Include shared dashboard and popup CSS -->
21
- <link rel="stylesheet" href="/static/css/dashboard-shared.css">
22
- <link rel="stylesheet" href="/static/css/popups-shared.css">
23
-
24
- <!-- Include stats-specific CSS for goals -->
25
- <link rel="stylesheet" href="/static/css/stats.css">
26
- </head>
4
+ {% set page_title = 'GSM - Goals' %}
5
+ {% set page_specific_css = 'stats.css' %}
6
+ {% include 'components/html-head.html' %}
27
7
 
28
8
  <body>
29
9
 
@@ -354,7 +334,7 @@
354
334
  {% set chars_target_date = stats_config.character_count_target_date | default('') %}
355
335
  {% set games_target_date = stats_config.games_target_date | default('') %}
356
336
 
357
- {% set stats_config = {
337
+ {% set stats_config_vars = {
358
338
  'readingHoursTarget': hours_target,
359
339
  'characterCountTarget': chars_target,
360
340
  'gamesTarget': games_target,
@@ -363,13 +343,11 @@
363
343
  'gamesTargetDate': games_target_date
364
344
  } %}
365
345
 
366
- <!-- Inject stats config values for frontend -->
367
- <script>
368
- window.statsConfig = {{ stats_config | tojson }};
369
- </script>
370
- <!-- Include shared JavaScript first (required dependency for goals.js) -->
371
- <script src="/static/js/shared.js"></script>
372
- <script src="/static/js/goals.js"></script>
346
+ <!-- Include shared JavaScript configuration -->
347
+ {% set config_vars = stats_config_vars %}
348
+ {% set config_object_name = 'statsConfig' %}
349
+ {% set page_specific_js = 'goals.js' %}
350
+ {% include 'components/js-config.html' %}
373
351
 
374
352
  </body>
375
353
 
@@ -1,29 +1,9 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
 
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>GSM Overview</title>
8
- <!-- Include Chart.js from a CDN -->
9
- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
10
-
11
- <!-- Include html2canvas for screenshot functionality -->
12
- <script src="https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js"></script>
13
-
14
- <!-- Include shared theme styles -->
15
- {% include 'components/theme-styles.html' %}
16
-
17
- <!-- Include shared CSS -->
18
- <link rel="stylesheet" href="/static/css/shared.css">
19
-
20
- <!-- Include shared dashboard and popup CSS -->
21
- <link rel="stylesheet" href="/static/css/dashboard-shared.css">
22
- <link rel="stylesheet" href="/static/css/popups-shared.css">
23
-
24
- <!-- Include overview-specific CSS -->
25
- <link rel="stylesheet" href="/static/css/overview.css">
26
- </head>
4
+ {% set page_title = 'GSM Overview' %}
5
+ {% set page_specific_css = 'overview.css' %}
6
+ {% include 'components/html-head.html' %}
27
7
 
28
8
  <body>
29
9
 
@@ -33,40 +13,11 @@
33
13
  <!-- Include shared navigation -->
34
14
  {% include 'components/navigation.html' %}
35
15
 
36
- <div class="dashboard-card date-range">
37
- <div class="dashboard-card-header">
38
- <h3 class="dashboard-card-title">
39
- <span class="dashboard-card-icon">📅</span>
40
- Date Range
41
- </h3>
42
- </div>
43
-
44
- <div class="dashboard-date-range">
45
- <div class="dashboard-date-item tooltip" data-tooltip="Select the start date for your stats">
46
- <label for="fromDate">From</label>
47
- <input type="date" id="fromDate" class="dashboard-date-input">
48
- </div>
49
- <div class="dashboard-date-item tooltip" data-tooltip="Select the end date for your stats">
50
- <label for="toDate">To</label>
51
- <input type="date" id="toDate" class="dashboard-date-input">
52
- </div>
53
- </div>
54
- </div>
55
-
56
- <div id="dateErrorPopup" class="dashboard-popup hidden">
57
- <div class="dashboard-popup-content">
58
- <div class="dashboard-popup-icon">⚠️</div>
59
- <div class="dashboard-popup-message">"From" date cannot be later than "To" date.</div>
60
- <button id="closePopupBtn" class="dashboard-popup-btn">OK</button>
61
- </div>
62
- </div>
16
+ <!-- Include shared date range component -->
17
+ {% include 'components/date-range.html' %}
63
18
 
64
- <div id="noDataPopup" class="no-data-popup hidden">
65
- <div class="no-data-content">
66
- <p>No data found for the selected range.</p>
67
- <button id="closeNoDataPopup">OK</button>
68
- </div>
69
- </div>
19
+ <!-- Include shared popup components -->
20
+ {% include 'components/popups.html' %}
70
21
 
71
22
  <!-- Dashboard Statistics Sections -->
72
23
  <div class="dashboard-container">
@@ -261,165 +212,8 @@
261
212
  <h2>Activity Heatmap</h2>
262
213
  <div id="heatmapContainer"></div>
263
214
  </div>
264
- <!-- Settings Modal -->
265
- <div id="settingsModal" class="modal">
266
- <div class="modal-content">
267
- <div class="modal-header">
268
- <h3>Statistics Settings</h3>
269
- <span class="close-btn" id="closeSettingsModal">&times;</span>
270
- </div>
271
- <div class="modal-body">
272
- <p style="color: var(--text-secondary); margin-bottom: 20px;">
273
- Configure how reading time and sessions are calculated for your statistics.
274
- </p>
275
- <form id="settingsForm">
276
- <div style="margin-bottom: 20px;">
277
- <label for="afkTimer"
278
- style="display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-primary);">
279
- AFK Timer (seconds)
280
- </label>
281
- <input type="number" id="afkTimer" name="afk_timer_seconds"
282
- style="padding: 10px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--bg-tertiary); color: var(--text-primary); font-size: 14px;"
283
- placeholder="120">
284
- <small
285
- style="color: var(--text-tertiary); font-size: 12px; margin-top: 4px; display: block;">
286
- Maximum time between activities that still counts as active reading
287
- </small>
288
- </div>
289
-
290
- <div style="margin-bottom: 20px;">
291
- <label for="sessionGap"
292
- style="display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-primary);">
293
- Session Gap (seconds)
294
- </label>
295
- <input type="number" id="sessionGap" name="session_gap_seconds"
296
- style="padding: 10px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--bg-tertiary); color: var(--text-primary); font-size: 14px;"
297
- placeholder="3600">
298
- <small
299
- style="color: var(--text-tertiary); font-size: 12px; margin-top: 4px; display: block;">
300
- Time gap that triggers a new reading session
301
- </small>
302
- </div>
303
-
304
- <div style="margin-bottom: 20px;">
305
- <label for="streakRequirement"
306
- style="display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-primary);">
307
- Streak Requirement (hours)
308
- </label>
309
- <input type="number" id="streakRequirement" name="streak_requirement_hours" min="0.01"
310
- max="24" step="0.01"
311
- style="padding: 10px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--bg-tertiary); color: var(--text-primary); font-size: 14px;"
312
- placeholder="1.0">
313
- <small
314
- style="color: var(--text-tertiary); font-size: 12px; margin-top: 4px; display: block;">
315
- Minimum hours of reading activity required to maintain streak (0.01-24 hours)
316
- </small>
317
- </div>
318
-
319
- <!-- Reading Goals Section -->
320
- <div style="margin-bottom: 20px; padding-top: 20px; border-top: 1px solid var(--border-color);">
321
- <label
322
- style="display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-primary);">
323
- Reading Goals Configuration
324
- </label>
325
- <p style="color: var(--text-secondary); margin-bottom: 20px; font-size: 14px;">
326
- Set your long-term reading targets for tracking progress and projections.
327
- </p>
328
-
329
- <div style="margin-bottom: 15px;">
330
- <label for="readingHoursTarget"
331
- style="display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-primary);">
332
- Reading Hours Target
333
- </label>
334
- <input type="number" id="readingHoursTarget" name="reading_hours_target" min="1"
335
- max="10000"
336
- style="padding: 10px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--bg-tertiary); color: var(--text-primary); font-size: 14px;"
337
- placeholder="1500">
338
- <small
339
- style="color: var(--text-tertiary); font-size: 12px; margin-top: 4px; display: block;">
340
- Total reading hours goal (1-10,000 hours) - Default: 1500 hours based on TMW N1
341
- achievement
342
- </small>
343
- </div>
344
-
345
- <div style="margin-bottom: 15px;">
346
- <label for="characterCountTarget"
347
- style="display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-primary);">
348
- Character Count Target
349
- </label>
350
- <input type="number" id="characterCountTarget" name="character_count_target" min="1000"
351
- max="1000000000"
352
- style="padding: 10px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--bg-tertiary); color: var(--text-primary); font-size: 14px;"
353
- placeholder="25000000">
354
- <small
355
- style="color: var(--text-tertiary); font-size: 12px; margin-top: 4px; display: block;">
356
- Total characters read goal (1,000-1,000,000,000) - Default: 25 million characters
357
- </small>
358
- </div>
359
-
360
- <div style="margin-bottom: 15px;">
361
- <label for="gamesTarget"
362
- style="display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-primary);">
363
- Games/Visual Novels Target
364
- </label>
365
- <input type="number" id="gamesTarget" name="games_target" min="1" max="1000"
366
- style="width: 90%; padding: 10px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--bg-tertiary); color: var(--text-primary); font-size: 14px;"
367
- placeholder="100">
368
- <small
369
- style="color: var(--text-tertiary); font-size: 12px; margin-top: 4px; display: block;">
370
- Number of games/visual novels to complete (1-1,000) - Default: 100 based on Refold
371
- standards
372
- </small>
373
- </div>
374
- </div>
375
-
376
- <!-- Import ExStatic Lines Section -->
377
- <div style="margin-bottom: 20px; padding-top: 20px; border-top: 1px solid var(--border-color);">
378
- <label
379
- style="display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-primary);">
380
- Import ExStatic Lines
381
- </label>
382
- <div style="margin-bottom: 10px;">
383
- <input type="file" id="exstaticFile" accept=".csv"
384
- style="width: 90%; padding: 10px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--bg-tertiary); color: var(--text-primary); font-size: 14px;">
385
- <small
386
- style="color: var(--text-tertiary); font-size: 12px; margin-top: 4px; display: block;">
387
- Select an ExStatic CSV file to import reading data into GSM
388
- </small>
389
- </div>
390
- <button type="button" id="importExstaticBtn"
391
- style="width: 90%; padding: 10px; background: #666; color: white; border: none; border-radius: 5px; font-size: 14px; cursor: not-allowed; margin-bottom: 10px;"
392
- disabled>
393
- Import ExStatic Lines
394
- </button>
395
- <div id="importProgress" style="display: none; margin-bottom: 10px;">
396
- <div
397
- style="background: var(--bg-tertiary); border-radius: 5px; overflow: hidden; height: 20px; position: relative;">
398
- <div id="importProgressBar"
399
- style="background: var(--primary-color); height: 100%; width: 0%; transition: width 0.3s ease;">
400
- </div>
401
- <span id="importProgressText"
402
- style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 12px; color: var(--text-primary);">0%</span>
403
- </div>
404
- </div>
405
- <div id="importStatus"
406
- style="display: none; padding: 10px; border-radius: 5px; font-size: 14px;"></div>
407
- </div>
408
- </form>
409
-
410
- <div id="settingsError"
411
- style="display: none; background: var(--danger-color); color: white; padding: 10px; border-radius: 5px; margin-bottom: 15px; font-size: 14px;">
412
- </div>
413
- <div id="settingsSuccess"
414
- style="display: none; background: var(--success-color); color: white; padding: 10px; border-radius: 5px; margin-bottom: 15px; font-size: 14px;">
415
- </div>
416
- </div>
417
- <div class="modal-footer">
418
- <button id="cancelSettingsBtn" class="cancel-btn">Cancel</button>
419
- <button id="saveSettingsBtn" class="confirm-delete-btn">Save Settings</button>
420
- </div>
421
- </div>
422
- </div>
215
+ <!-- Include shared settings modal -->
216
+ {% include 'components/settings-modal.html' %}
423
217
  </div>
424
218
 
425
219
 
@@ -431,7 +225,7 @@
431
225
  {% set games_target = stats_config.games_target | default(100) %}
432
226
  {% set heatmap_year = 'all' %}
433
227
 
434
- {% set stats_config = {
228
+ {% set stats_config_vars = {
435
229
  'afkTimerSeconds': afk_timer,
436
230
  'sessionGapSeconds': session_gap,
437
231
  'streakRequirementHours': streak_req,
@@ -441,13 +235,12 @@
441
235
  'heatmapDisplayYear': heatmap_year
442
236
  } %}
443
237
 
444
- <!-- Inject stats config values for frontend -->
445
- <script>
446
- window.statsConfig = {{ stats_config | tojson }};
447
- </script>
448
- <!-- Include shared JavaScript first (required dependency for overview.js) -->
449
- <script src="/static/js/shared.js"></script>
450
- <script src="/static/js/overview.js"></script>
238
+ <!-- Include shared JavaScript configuration -->
239
+ {% set config_vars = stats_config_vars %}
240
+ {% set config_object_name = 'statsConfig' %}
241
+ {% set include_heatmap_js = true %}
242
+ {% set page_specific_js = 'overview.js' %}
243
+ {% include 'components/js-config.html' %}
451
244
 
452
245
  </body>
453
246
 
@@ -67,6 +67,19 @@
67
67
  <div class="search-stats">
68
68
  <span id="searchStats">Ready to search</span>
69
69
  <span id="searchTime"></span>
70
+ <div class="results-controls">
71
+ <div class="filter-group" style="margin-right: 12px;">
72
+ <label class="filter-label">Results per page:</label>
73
+ <select id="pageSizeFilter" class="filter-select">
74
+ <option value="20">20</option>
75
+ <option value="50">50</option>
76
+ <option value="100">100</option>
77
+ <option value="200">200</option>
78
+ </select>
79
+ </div>
80
+ <button id="selectAllBtn" class="action-btn secondary" style="margin-right: 8px;" disabled>Select All</button>
81
+ <button id="deleteLinesBtn" class="delete-btn" disabled>Delete Selected</button>
82
+ </div>
70
83
  </div>
71
84
  </div>
72
85
 
@@ -103,6 +116,39 @@
103
116
  </div>
104
117
  </div>
105
118
 
119
+ <!-- Delete Confirmation Modal -->
120
+ <div id="deleteConfirmationModal" class="modal">
121
+ <div class="modal-content">
122
+ <div class="modal-header">
123
+ <h3>Confirm Deletion</h3>
124
+ <span class="close-btn" data-action="closeModal" data-modal="deleteConfirmationModal">&times;</span>
125
+ </div>
126
+ <div class="modal-body">
127
+ <p class="warning-text" id="deleteConfirmationMessage"></p>
128
+ </div>
129
+ <div class="modal-footer">
130
+ <button class="action-btn cancel-btn" data-action="closeModal" data-modal="deleteConfirmationModal">Cancel</button>
131
+ <button class="action-btn danger" id="confirmDeleteBtn">Delete</button>
132
+ </div>
133
+ </div>
134
+ </div>
135
+
136
+ <!-- Message Modal (for success/info messages) -->
137
+ <div id="messageModal" class="modal">
138
+ <div class="modal-content">
139
+ <div class="modal-header">
140
+ <h3 id="messageModalTitle">Message</h3>
141
+ <span class="close-btn" data-action="closeModal" data-modal="messageModal">&times;</span>
142
+ </div>
143
+ <div class="modal-body">
144
+ <p id="messageModalText"></p>
145
+ </div>
146
+ <div class="modal-footer">
147
+ <button class="action-btn ok-btn" data-action="closeModal" data-modal="messageModal">OK</button>
148
+ </div>
149
+ </div>
150
+ </div>
151
+
106
152
  <!-- Include shared JavaScript first (required dependency for search.js) -->
107
153
  <script src="/static/js/shared.js"></script>
108
154
  <script src="/static/js/search.js"></script>