Skip to content

Commit

Permalink
fixed: auto selected external subtitle #65
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonflylee committed Aug 29, 2024
1 parent 1941170 commit 8bfc33d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/src/activity/player_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,16 @@ PlayerView::PlayerView(const jellyfin::Item& item) : itemId(item.Id) {
break;
case MpvEventEnum::MPV_LOADED: {
auto& svr = AppConfig::instance().getUrl();
bool external = false;
// 移除其他备用链接
for (auto& s : this->stream.MediaStreams) {
if (s.Type == jellyfin::streamTypeSubtitle) {
if (s.DeliveryUrl.size() > 0 && (s.IsExternal || this->playMethod == jellyfin::methodTranscode)) {
std::string url = svr + s.DeliveryUrl;
mpv.command("sub-add", url.c_str(), "auto", s.DisplayTitle.c_str());
external = true;
mpv.command("sub-add", url.c_str(), "select", s.DisplayTitle.c_str());
}
}
}
if (PlayerSetting::selectedSubtitle > 0 || external) {
if (PlayerSetting::selectedSubtitle > 0) {
mpv.setInt("sid", PlayerSetting::selectedSubtitle);
}
if (DanmakuCore::PLUGIN_ACTIVE) {
Expand Down

0 comments on commit 8bfc33d

Please sign in to comment.