mirror of
https://github.com/denizsafak/abogen.git
synced 2026-09-20 11:40:57 +02:00
clean: dead code removal + unused imports
- executor: remove dead subtitle_writer stub (lines 121-125) - executor: replace getattr with direct field access on ResolvedVoice - service: remove duplicate split_pattern import - service: remove unused import time - planner: remove unused import os - adapters: remove unused import threading, time
This commit is contained in:
@@ -118,13 +118,8 @@ def execute_conversion(
|
|||||||
)
|
)
|
||||||
result.audio_path = audio_path
|
result.audio_path = audio_path
|
||||||
|
|
||||||
# Open subtitle writer for merged output
|
|
||||||
subtitle_writer: Optional[SubtitleWriter] = None
|
|
||||||
if subtitle_writer and audio_sink:
|
|
||||||
# This will be set below when we know subtitle mode
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Open subtitle writer if needed
|
# Open subtitle writer if needed
|
||||||
|
subtitle_writer: Optional[SubtitleWriter] = None
|
||||||
if request.subtitle_mode != "Disabled" and audio_sink:
|
if request.subtitle_mode != "Disabled" and audio_sink:
|
||||||
subtitle_writer = make_subtitle_writer(
|
subtitle_writer = make_subtitle_writer(
|
||||||
audio_path,
|
audio_path,
|
||||||
@@ -407,8 +402,8 @@ def _resolve_voice(
|
|||||||
return (
|
return (
|
||||||
resolved.provider,
|
resolved.provider,
|
||||||
resolved.voice,
|
resolved.voice,
|
||||||
getattr(resolved, "speed", request.speed),
|
resolved.speed,
|
||||||
getattr(resolved, "supertonic_steps", None),
|
resolved.supertonic_steps,
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
# Fallback to base voice
|
# Fallback to base voice
|
||||||
@@ -416,8 +411,8 @@ def _resolve_voice(
|
|||||||
return (
|
return (
|
||||||
resolved.provider,
|
resolved.provider,
|
||||||
resolved.voice,
|
resolved.voice,
|
||||||
getattr(resolved, "speed", request.speed),
|
resolved.speed,
|
||||||
getattr(resolved, "supertonic_steps", None),
|
resolved.supertonic_steps,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ This is Stage 2 of the conversion flow unification plan.
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Dict, List, Optional, Tuple
|
from typing import Any, Dict, List, Optional, Tuple
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ The service NEVER imports from PyQt or WebUI.
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import time
|
|
||||||
from typing import Any, Callable, Dict, Optional
|
from typing import Any, Callable, Dict, Optional
|
||||||
|
|
||||||
from abogen.application.conversion_executor import execute_conversion
|
from abogen.application.conversion_executor import execute_conversion
|
||||||
@@ -113,7 +112,6 @@ def _prepare_tts_context(
|
|||||||
compile_pronunciation_rules,
|
compile_pronunciation_rules,
|
||||||
merge_pronunciation_overrides,
|
merge_pronunciation_overrides,
|
||||||
)
|
)
|
||||||
from abogen.domain.split_pattern import get_split_pattern
|
|
||||||
|
|
||||||
# Get runtime normalization settings
|
# Get runtime normalization settings
|
||||||
normalization_settings = get_runtime_settings()
|
normalization_settings = get_runtime_settings()
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ Subtitle file/timestamp special paths remain in ConversionThread.run() early ret
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import threading
|
|
||||||
import time
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Callable, Dict, List, Optional
|
from typing import Any, Callable, Dict, List, Optional
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user