Closed verygoodlee closed 9 months ago
启动时第一集选择了字幕,播放列表的subtitle_priority参数也填写了,字幕都能成功加载,\ 从第一集往后切没啥问题,但是从后面切回第一集字幕没了。 原因是第一集的字幕加载方式用的JSON IPC,不是以启动参数加载的 https://github.com/kjtsune/embyToLocalPlayer/blob/5c5a99c5056ce03faff103221e338cce16fdb8b9/utils/players.py#L231-L233 启动参数--sub-file影响后面的集数是可以解决的,sub-files是一个List Options,利用-toggle操作的特性:不存在则添加,存在则删除。启动参数改为cmd.append(f'--sub-files-toggle={sub_file}') https://github.com/kjtsune/embyToLocalPlayer/blob/5c5a99c5056ce03faff103221e338cce16fdb8b9/utils/players.py#L195-L200 播放列表的字幕参数部分改为
subtitle_priority
JSON IPC
--sub-file
-toggle
cmd.append(f'--sub-files-toggle={sub_file}')
# 启动时选择的第一集的字幕,先给它加上,启动参数sub-files-toggle会把它删掉 first_ep_sub_file = data['sub_file'] or '' sub_file_cmd = f',sub-files-remove={first_ep_sub_file},sub-files-append={first_ep_sub_file}' if first_ep_sub_file else '' sub_file = ep['sub_file'] or '' sub_file_cmd = sub_file_cmd + (f',sub-files-append={sub_file}' if sub_file else '')
https://github.com/kjtsune/embyToLocalPlayer/blob/5c5a99c5056ce03faff103221e338cce16fdb8b9/utils/players.py#L260-L261
已更新,辛苦了
有个尴尬的问题是mpv.net好像不支持List Options操作,#22 应该也在影响范围内,\ 作者也发现这个问题了,可能未来会修复。 mpv-player/mpv/issues/13132
修了,先把mpv.net排除了。
启动时第一集选择了字幕,播放列表的
subtitle_priority
参数也填写了,字幕都能成功加载,\ 从第一集往后切没啥问题,但是从后面切回第一集字幕没了。 原因是第一集的字幕加载方式用的JSON IPC
,不是以启动参数加载的 https://github.com/kjtsune/embyToLocalPlayer/blob/5c5a99c5056ce03faff103221e338cce16fdb8b9/utils/players.py#L231-L233 启动参数--sub-file
影响后面的集数是可以解决的,sub-files是一个List Options,利用-toggle
操作的特性:不存在则添加,存在则删除。启动参数改为cmd.append(f'--sub-files-toggle={sub_file}')
https://github.com/kjtsune/embyToLocalPlayer/blob/5c5a99c5056ce03faff103221e338cce16fdb8b9/utils/players.py#L195-L200 播放列表的字幕参数部分改为https://github.com/kjtsune/embyToLocalPlayer/blob/5c5a99c5056ce03faff103221e338cce16fdb8b9/utils/players.py#L260-L261