GameSentenceMiner 2.15.12__py3-none-any.whl → 2.16.1__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.
- GameSentenceMiner/util/downloader/download_tools.py +44 -1
- GameSentenceMiner/web/static/css/kanji-grid.css +4 -1
- GameSentenceMiner/web/static/css/shared.css +1 -1
- GameSentenceMiner/web/templates/database.html +1 -1
- GameSentenceMiner/web/templates/index.html +13 -13
- GameSentenceMiner/web/templates/search.html +1 -1
- GameSentenceMiner/web/templates/stats.html +6 -7
- {gamesentenceminer-2.15.12.dist-info → gamesentenceminer-2.16.1.dist-info}/METADATA +1 -1
- {gamesentenceminer-2.15.12.dist-info → gamesentenceminer-2.16.1.dist-info}/RECORD +13 -13
- {gamesentenceminer-2.15.12.dist-info → gamesentenceminer-2.16.1.dist-info}/WHEEL +0 -0
- {gamesentenceminer-2.15.12.dist-info → gamesentenceminer-2.16.1.dist-info}/entry_points.txt +0 -0
- {gamesentenceminer-2.15.12.dist-info → gamesentenceminer-2.16.1.dist-info}/licenses/LICENSE +0 -0
- {gamesentenceminer-2.15.12.dist-info → gamesentenceminer-2.16.1.dist-info}/top_level.txt +0 -0
@@ -10,9 +10,37 @@ from GameSentenceMiner.util.downloader.Untitled_json import scenes
|
|
10
10
|
from GameSentenceMiner.util.configuration import get_app_directory, logger
|
11
11
|
from GameSentenceMiner.util.ffmpeg import get_ffmpeg_path, get_ffprobe_path
|
12
12
|
from GameSentenceMiner.obs import get_obs_path
|
13
|
+
import tempfile
|
13
14
|
|
14
15
|
script_dir = os.path.dirname(os.path.abspath(__file__))
|
15
16
|
|
17
|
+
def cleanup_temp_files(func):
|
18
|
+
def wrapper(*args, **kwargs):
|
19
|
+
temp_files = []
|
20
|
+
|
21
|
+
# Patch tempfile.NamedTemporaryFile to track created temp files
|
22
|
+
orig_named_tempfile = tempfile.NamedTemporaryFile
|
23
|
+
def tracked_named_tempfile(*a, **kw):
|
24
|
+
tmp = orig_named_tempfile(*a, **kw)
|
25
|
+
temp_files.append(tmp.name)
|
26
|
+
return tmp
|
27
|
+
tempfile.NamedTemporaryFile = tracked_named_tempfile
|
28
|
+
|
29
|
+
try:
|
30
|
+
result = func(*args, **kwargs)
|
31
|
+
finally:
|
32
|
+
# Restore original NamedTemporaryFile
|
33
|
+
tempfile.NamedTemporaryFile = orig_named_tempfile
|
34
|
+
# Remove tracked temp files
|
35
|
+
for f in temp_files:
|
36
|
+
try:
|
37
|
+
if os.path.exists(f):
|
38
|
+
os.remove(f)
|
39
|
+
except Exception:
|
40
|
+
pass
|
41
|
+
return result
|
42
|
+
return wrapper
|
43
|
+
|
16
44
|
def copy_obs_settings(src, dest):
|
17
45
|
|
18
46
|
if os.path.exists(src):
|
@@ -111,6 +139,9 @@ def download_obs_if_needed():
|
|
111
139
|
with open(os.path.join(scene_json_path, 'Untitled.json'), 'w') as scene_file:
|
112
140
|
scene_file.write(scenes)
|
113
141
|
logger.info(f"OBS extracted to {obs_path}.")
|
142
|
+
|
143
|
+
# remove zip
|
144
|
+
os.unlink(obs_installer)
|
114
145
|
else:
|
115
146
|
logger.error(f"Please install OBS manually from {obs_installer}")
|
116
147
|
|
@@ -118,9 +149,14 @@ def download_ffmpeg_if_needed():
|
|
118
149
|
ffmpeg_dir = os.path.join(get_app_directory(), 'ffmpeg')
|
119
150
|
ffmpeg_exe_path = get_ffmpeg_path()
|
120
151
|
ffprobe_exe_path = get_ffprobe_path()
|
121
|
-
|
152
|
+
python_dir = os.path.join(get_app_directory(), 'python')
|
153
|
+
ffmpeg_in_python = os.path.join(python_dir, "ffmpeg.exe")
|
154
|
+
|
122
155
|
if os.path.exists(ffmpeg_dir) and os.path.exists(ffmpeg_exe_path) and os.path.exists(ffprobe_exe_path):
|
123
156
|
logger.debug(f"FFmpeg already installed at {ffmpeg_dir}.")
|
157
|
+
if not os.path.exists(ffmpeg_in_python):
|
158
|
+
shutil.copy2(ffmpeg_exe_path, ffmpeg_in_python)
|
159
|
+
logger.info(f"Copied ffmpeg.exe to Python folder: {ffmpeg_in_python}")
|
124
160
|
return
|
125
161
|
|
126
162
|
if os.path.exists(ffmpeg_dir) and (not os.path.exists(ffmpeg_exe_path) or not os.path.exists(ffprobe_exe_path)):
|
@@ -155,6 +191,13 @@ def download_ffmpeg_if_needed():
|
|
155
191
|
target = open(os.path.join(ffmpeg_dir, filename), "wb")
|
156
192
|
with source, target:
|
157
193
|
shutil.copyfileobj(source, target)
|
194
|
+
|
195
|
+
# Copy ffmpeg.exe to the python folder
|
196
|
+
if os.path.exists(ffmpeg_exe_path):
|
197
|
+
shutil.copy2(ffmpeg_exe_path, ffmpeg_in_python)
|
198
|
+
logger.info(f"Copied ffmpeg.exe to Python folder: {ffmpeg_in_python}")
|
199
|
+
else:
|
200
|
+
logger.warning(f"ffmpeg.exe not found in {ffmpeg_dir}.")
|
158
201
|
logger.info(f"FFmpeg extracted to {ffmpeg_dir}.")
|
159
202
|
|
160
203
|
def download_ocenaudio_if_needed():
|
@@ -33,8 +33,9 @@
|
|
33
33
|
position: relative;
|
34
34
|
transition: all 0.2s ease;
|
35
35
|
font-family: "Noto Sans CJK JP", "Hiragino Sans", "Yu Gothic", "Meiryo", "Takao", "IPAexGothic", "IPAPGothic", "VL PGothic", "Koruri", sans-serif;
|
36
|
-
line-height:
|
36
|
+
line-height: 30px;
|
37
37
|
text-align: center;
|
38
|
+
vertical-align: middle;
|
38
39
|
}
|
39
40
|
|
40
41
|
.kanji-cell:hover {
|
@@ -86,6 +87,7 @@
|
|
86
87
|
width: 25px;
|
87
88
|
height: 25px;
|
88
89
|
font-size: 14px;
|
90
|
+
line-height: 25px;
|
89
91
|
}
|
90
92
|
|
91
93
|
.kanji-counter {
|
@@ -103,5 +105,6 @@
|
|
103
105
|
width: 22px;
|
104
106
|
height: 22px;
|
105
107
|
font-size: 12px;
|
108
|
+
line-height: 22px;
|
106
109
|
}
|
107
110
|
}
|