feat: translate subtitles with an OpenAI-compatible LLM

This commit is contained in:
tri committed 2026-10-27 22:43:03 +07:00
1 parent 48cac86d60
commit 4665bf632a
21 files changed
+1877 -5

No files matched your search

+43 -1
View File
@@ -1,7 +1,40 @@
# Subtitle parsing and extraction, kept apart from the app so autotests can link it.
add_library(qtpotato_subtitles STATIC
subtitles/subtitleparser.cpp
subtitles/subtitleparser.h
subtitles/subtitleextractor.cpp
subtitles/subtitleextractor.h
)
target_include_directories(qtpotato_subtitles PUBLIC subtitles)
target_link_libraries(qtpotato_subtitles PUBLIC
Qt6::Core
KF6::I18n
PRIVATE
PkgConfig::FFMPEG
)
add_executable(qtpotato
main.cpp
mpv/mpvitem.cpp
mpv/mpvitem.h
translate/apikeystore.cpp
translate/apikeystore.h
translate/llmclient.cpp
translate/llmclient.h
translate/translationservice.cpp
translate/translationservice.h
)
kconfig_target_kcfg_file(qtpotato
FILE ${CMAKE_CURRENT_SOURCE_DIR}/settings/qtpotatosettings.kcfg
CLASS_NAME QtPotatoSettings
MUTATORS
NOTIFIERS
DEFAULT_VALUE_GETTERS
GENERATE_PROPERTIES
GENERATE_MOC
SINGLETON
QML_REGISTRATION
)
ecm_add_qml_module(qtpotato
@@ -12,22 +45,31 @@ ecm_target_qml_sources(qtpotato SOURCES
qml/Main.qml
qml/PlayerPage.qml
qml/SubtitlePopup.qml
qml/SettingsPage.qml
)
target_include_directories(qtpotato PRIVATE mpv)
target_include_directories(qtpotato PRIVATE mpv translate)
target_compile_definitions(qtpotato PRIVATE QTPOTATO_VERSION_STRING="${PROJECT_VERSION}")
target_link_libraries(qtpotato PRIVATE
qtpotato_subtitles
Qt6::Gui
Qt6::Qml
Qt6::Quick
Qt6::QuickControls2
Qt6::Widgets
Qt6::Network
Qt6::Concurrent
KF6::I18n
KF6::I18nQml
KF6::CoreAddons
KF6::Crash
KF6::ConfigCore
KF6::ConfigGui
MpvQt::MpvQt
QCoro6::Core
QCoro6::Network
qt6keychain
)
install(TARGETS qtpotato ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})