浏览代码

修复蓝光 BDMV 下面会有一个 STREAM 文件夹,里面很多 m2ts 的视频组成,如果扫描视频的时候支持了 m2ts 格式,可能会误扫描的问题

Signed-off-by: allan716 <[email protected]>
allan716 3 年之前
父节点
当前提交
baedf948d7
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 0 2
      internal/pkg/downloader/downloader.go
  2. 5 0
      internal/pkg/my_util/util.go

+ 0 - 2
internal/pkg/downloader/downloader.go

@@ -37,8 +37,6 @@ type Downloader struct {
 	subTimelineFixerHelperEx *sub_timeline_fixer.SubTimelineFixerHelperEx // 字幕时间轴校正
 	downloaderLock           sync.Mutex                                   // 取消执行 task control 的 Lock
 	downloadQueue            *task_queue.TaskQueue                        // 需要下载的视频的队列
-	//supplierChecking         bool                                         // 正在检测字幕源有效性
-	//queueDownloading         bool                                         // 正在下载个视频的字幕
 }
 
 func NewDownloader(inSubFormatter ifaces.ISubFormatter, _settings *settings.Settings, log *logrus.Logger, downloadQueue *task_queue.TaskQueue) *Downloader {

+ 5 - 0
internal/pkg/my_util/util.go

@@ -204,6 +204,11 @@ func SearchMatchedVideoFile(l *logrus.Logger, dir string) ([]string, error) {
 				// 不是期望的视频后缀名则跳过
 				continue
 			} else {
+				// 这里还有一种情况,就是蓝光, BDMV 下面会有一个 STREAM 文件夹,里面很多 m2ts 的视频组成
+				if filepath.Base(filepath.Dir(fullPath)) == "STREAM" {
+					l.Debugln("SearchMatchedVideoFile, Skip BDMV.STREAM:", fullPath)
+					continue
+				}
 
 				// 跳过不符合的文件,比如 MAC OS 下可能有缓存文件,见 #138
 				fi, err := curFile.Info()