mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-30 17:40:53 -07:00
fix(anki): regenerate sentence furigana from the final sentence (#268)
This commit is contained in:
+10
@@ -15,6 +15,7 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import { generateSentenceFurigana } from './core/services/tokenizer/sentence-furigana';
|
||||
import {
|
||||
app,
|
||||
BrowserWindow,
|
||||
@@ -5131,6 +5132,13 @@ function createMainWindow(): BrowserWindow {
|
||||
return window;
|
||||
}
|
||||
|
||||
function generateMiningSentenceFurigana(
|
||||
text: string,
|
||||
highlightedText?: string,
|
||||
): Promise<string | null> {
|
||||
return generateSentenceFurigana(text, highlightedText, getYomitanParserRuntimeDeps(), logger);
|
||||
}
|
||||
|
||||
function initializeOverlayRuntime(): void {
|
||||
initializeOverlayRuntimeHandler();
|
||||
if (!(appState.initialArgs && isHeadlessInitialCommand(appState.initialArgs))) {
|
||||
@@ -5140,6 +5148,7 @@ function initializeOverlayRuntime(): void {
|
||||
appState.ankiIntegration?.setKnownWordCacheUpdatedCallback(refreshCurrentSubtitleAnnotations);
|
||||
appState.ankiIntegration?.setSubtitleMiningContextConsumer(consumePendingSubtitleMiningContext);
|
||||
appState.ankiIntegration?.setMediaTimingReviewCallback(mediaTimingReviewRuntime.requestReview);
|
||||
appState.ankiIntegration?.setSentenceFuriganaGenerator(generateMiningSentenceFurigana);
|
||||
syncOverlayMpvSubtitleSuppression();
|
||||
}
|
||||
|
||||
@@ -6015,6 +6024,7 @@ const { registerIpcRuntimeHandlers } = composeIpcRuntimeHandlers({
|
||||
appState.ankiIntegration?.setMediaTimingReviewCallback(
|
||||
mediaTimingReviewRuntime.requestReview,
|
||||
);
|
||||
appState.ankiIntegration?.setSentenceFuriganaGenerator(generateMiningSentenceFurigana);
|
||||
},
|
||||
getKnownWordCacheStatePath: () => path.join(USER_DATA_PATH, 'known-words-cache.json'),
|
||||
getCachedMediaPath: (currentVideoPath, kind) =>
|
||||
|
||||
Reference in New Issue
Block a user