Browse Source

修复获取一个连续剧字幕的bug

Signed-off-by: allan716 <[email protected]>
allan716 3 years ago
parent
commit
d69d07146c
2 changed files with 8 additions and 5 deletions
  1. 3 0
      internal/backend/controllers/v1/video_list_v2.go
  2. 5 5
      pkg/search/search.go

+ 3 - 0
internal/backend/controllers/v1/video_list_v2.go

@@ -243,6 +243,9 @@ func (cb *ControllerBase) OneSeriesSubs(c *gin.Context) {
 			subUrl := path_helper.ChangePhysicalPathToSharePath(subFPath, seriesInfo.MainRootDirFPath, desUrl)
 			subUrl := path_helper.ChangePhysicalPathToSharePath(subFPath, seriesInfo.MainRootDirFPath, desUrl)
 			seasonInfo.OneVideoInfos[i].SubUrlList = append(seasonInfo.OneVideoInfos[i].SubUrlList, subUrl)
 			seasonInfo.OneVideoInfos[i].SubUrlList = append(seasonInfo.OneVideoInfos[i].SubUrlList, subUrl)
 		}
 		}
+
+		videoUrl := path_helper.ChangePhysicalPathToSharePath(videoInfo.VideoFPath, seriesInfo.MainRootDirFPath, desUrl)
+		seasonInfo.OneVideoInfos[i].VideoUrl = videoUrl
 	}
 	}
 
 
 	c.JSON(http.StatusOK, seasonInfo)
 	c.JSON(http.StatusOK, seasonInfo)

+ 5 - 5
pkg/search/search.go

@@ -211,11 +211,11 @@ func SeriesAllEpsAndSubtitles(l *logrus.Logger, dir string) (*backend.SeasonInfo
 	// 交叉比对,找到对应的字幕
 	// 交叉比对,找到对应的字幕
 	for pathKey, videos := range pathVideoMap {
 	for pathKey, videos := range pathVideoMap {
 
 
-		nowPathSubs, found := pathSubsMap[pathKey]
-		if found == false {
-			// 没有找到对应的字幕
-			continue
-		}
+		nowPathSubs, _ := pathSubsMap[pathKey]
+		//if found == false {
+		//	// 没有找到对应的字幕
+		//	continue
+		//}
 		for _, oneVideo := range videos {
 		for _, oneVideo := range videos {
 
 
 			videoName := strings.ReplaceAll(filepath.Base(oneVideo), filepath.Ext(oneVideo), "")
 			videoName := strings.ReplaceAll(filepath.Base(oneVideo), filepath.Ext(oneVideo), "")