Skip to content

Commit

Permalink
添加SDH后缀,用来标识评分最高的字幕
Browse files Browse the repository at this point in the history
  • Loading branch information
ibeyond committed Aug 9, 2021
1 parent 432c9f5 commit 4fa85e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,13 @@ func (d Downloader) writeSubFile2VideoPath(videoFileFullPath string, finalSubFil
// Plex字幕处理
if d.reqParam.PlexConfig == true {
// 生成字幕文件名 Video.zh.ext
plexSub := path.Join(videoRootPath, strings.ReplaceAll(filepath.Base(videoFileFullPath), filepath.Ext(videoFileFullPath), "")+".zh"+finalSubFile.Ext)
plexSub := path.Join(videoRootPath,
strings.ReplaceAll(filepath.Base(videoFileFullPath), filepath.Ext(videoFileFullPath), "")+".zh"+finalSubFile.Ext)
// 将默认字幕设置为Plex的zh字幕文件
if setDefault == true {
// 为了标识最佳字幕,给字幕名字添加上SDH后缀(Plex支持该文件)
plexSub := path.Join(videoRootPath,
strings.ReplaceAll(filepath.Base(videoFileFullPath), filepath.Ext(videoFileFullPath), "")+".zh.sdh"+finalSubFile.Ext)
if pkg.IsFile(plexSub) == true {
_ = os.Remove(plexSub)
}
Expand Down

0 comments on commit 4fa85e3

Please sign in to comment.