Refactor voice list handling to use KookitConfig constants

- Replaced references to officialVoiceList and azureTTSVoiceList with KookitConfig.OfficialVoiceList and KookitConfig.AzureTTSVoiceList respectively in handleFetchPlugins function.
This commit is contained in:
troyeguo committed 2026-07-14 08:08:15 +08:00
1 parent f51790c9d3
commit 04ab4ce038
3 files changed
+5 -3741

No files matched your search

File diff suppressed because one or more lines are too long.
File diff suppressed because it is too large. Load diff
+4 -4
View File
@@ -1,5 +1,6 @@
import {
ConfigService,
KookitConfig,
TokenService,
} from "../../assets/lib/kookit-extra-browser.min";
import BookModel from "../../models/Book";
@@ -18,7 +19,6 @@ import {
import toast from "react-hot-toast";
import BookUtil from "../../utils/file/bookUtil";
import i18n from "../../i18n";
import { azureTTSVoiceList, officialVoiceList } from "../../constants/ttsList";
import { langToName } from "../../utils/common";
import { resetReaderRequest } from "../../utils/request/reader";
import { resetThirdpartyRequest } from "../../utils/request/thirdparty";
@@ -443,7 +443,7 @@ export function handleFetchPlugins() {
);
pluginList.push(sumPlugin);
let sortedVoiceList = [
...officialVoiceList.map((item) => {
...KookitConfig.OfficialVoiceList.map((item) => {
return {
...item,
label:
@@ -458,7 +458,7 @@ export function handleFetchPlugins() {
: i18n.t("Male voice")),
};
}),
...azureTTSVoiceList.map((item) => {
...KookitConfig.AzureTTSVoiceList.map((item) => {
return {
...item,
label:
@@ -498,7 +498,7 @@ export function handleFetchPlugins() {
dispatch(handlePlugins(pluginList));
} else if (isAuthed) {
let sortedVoiceList = [
...azureTTSVoiceList.map((item) => {
...KookitConfig.AzureTTSVoiceList.map((item) => {
return {
...item,
label: