Переглянути джерело

调整项目结构

Signed-off-by: allan716 <[email protected]>
allan716 3 роки тому
батько
коміт
829e106b13
100 змінених файлів з 639 додано та 565 видалено
  1. 2 1
      cmd/GetCAPTCHA/backend/git_helper.go
  2. 6 5
      internal/backend/controllers/base/change_pwd.go
  3. 6 5
      internal/backend/controllers/base/check_cron.go
  4. 2 1
      internal/backend/controllers/base/controller_base.go
  5. 5 4
      internal/backend/controllers/base/login.go
  6. 1 1
      internal/backend/controllers/base/logout.go
  7. 7 6
      internal/backend/controllers/base/path_things.go
  8. 2 1
      internal/backend/controllers/base/proxy.go
  9. 5 4
      internal/backend/controllers/base/setup.go
  10. 1 1
      internal/backend/controllers/base/system_status.go
  11. 19 18
      internal/backend/controllers/v1/api.go
  12. 1 1
      internal/backend/controllers/v1/controller_base.go
  13. 5 4
      internal/backend/controllers/v1/daemon_things.go
  14. 16 15
      internal/backend/controllers/v1/jobs_things.go
  15. 2 1
      internal/backend/controllers/v1/settings.go
  16. 11 10
      internal/backend/controllers/v1/video_list.go
  17. 2 1
      internal/backend/middle/auth.go
  18. 12 11
      internal/backend/ws_helper/client.go
  19. 2 1
      pkg/cache_center/download_file_info.go
  20. 2 2
      pkg/cache_center/download_file_info_test.go
  21. 7 6
      pkg/decode/decode.go
  22. 2 1
      pkg/decode/decode_test.go
  23. 17 16
      pkg/downloader/cache_info.go
  24. 2 1
      pkg/downloader/download_processer.go
  25. 16 15
      pkg/downloader/downloader.go
  26. 4 3
      pkg/downloader/downloader_things.go
  27. 2 1
      pkg/emby_api/emby_api.go
  28. 2 1
      pkg/ffmpeg_helper/audio_info.go
  29. 2 1
      pkg/ffmpeg_helper/ffmpeg_helper.go
  30. 2 2
      pkg/ffmpeg_helper/ffmpeg_info.go
  31. 1 1
      pkg/ffmpeg_helper/subtitile_info.go
  32. 3 2
      pkg/hot_fix/hot_fix_hub.go
  33. 2 1
      pkg/hot_fix/hot_fix_hub_test.go
  34. 0 0
      pkg/ifaces/iHotFix.go
  35. 0 0
      pkg/ifaces/iMediaSystem.go
  36. 1 1
      pkg/ifaces/iSubFormatter.go
  37. 1 1
      pkg/ifaces/iSubParser.go
  38. 2 2
      pkg/ifaces/iSupplier.go
  39. 3 2
      pkg/imdb_helper/imdb.go
  40. 2 1
      pkg/imdb_helper/imdb_test.go
  41. 126 125
      pkg/language/ISOLanguage.go
  42. 2 1
      pkg/language/my_language.go
  43. 2 2
      pkg/language/whatlanggo.go
  44. 3 2
      pkg/log_helper/log_hub.go
  45. 41 40
      pkg/logic/emby_helper/embyhelper.go
  46. 3 2
      pkg/logic/file_downloader/downloader_hub.go
  47. 1 1
      pkg/logic/mark_system/markingsystem.go
  48. 4 3
      pkg/logic/movie_helper/moviehelper.go
  49. 2 1
      pkg/logic/pre_download_process/pre_download_proces.go
  50. 3 2
      pkg/logic/pre_job/pro_job.go
  51. 8 7
      pkg/logic/scan_played_video_subinfo/scan_played_video_subinfo.go
  52. 6 5
      pkg/logic/series_helper/seriesHelper.go
  53. 2 1
      pkg/logic/sub_parser/ass/ass.go
  54. 2 1
      pkg/logic/sub_parser/ass/ass_test.go
  55. 2 1
      pkg/logic/sub_parser/srt/srt.go
  56. 2 1
      pkg/logic/sub_parser/srt/srt_test.go
  57. 4 3
      pkg/logic/sub_supplier/a4k/a4k.go
  58. 3 3
      pkg/logic/sub_supplier/assrt/assrt.go
  59. 5 4
      pkg/logic/sub_supplier/csf/csf.go
  60. 8 7
      pkg/logic/sub_supplier/shooter/shooter.go
  61. 5 4
      pkg/logic/sub_supplier/subSupplierHub.go
  62. 16 15
      pkg/logic/sub_supplier/subhd/subhd.go
  63. 2 1
      pkg/logic/sub_supplier/subhd/subhd_test.go
  64. 7 6
      pkg/logic/sub_supplier/xunlei/xunlei.go
  65. 16 15
      pkg/logic/sub_supplier/zimuku/zimuku.go
  66. 2 1
      pkg/logic/sub_timeline_fixer/SubTimelineFixerHelperEx.go
  67. 2 1
      pkg/my_util/util.go
  68. 1 1
      pkg/settings/advanced_settings.go
  69. 3 1
      pkg/settings/chs_cht_changer.go
  70. 1 1
      pkg/settings/emby_settings.go
  71. 8 8
      pkg/settings/supplier_settings.go
  72. 2 1
      pkg/something_static/something_static.go
  73. 2 1
      pkg/sub_file_hash/sub_file_hash.go
  74. 12 11
      pkg/sub_formatter/emby/emby.go
  75. 3 2
      pkg/sub_formatter/emby/emby_test.go
  76. 11 10
      pkg/sub_formatter/normal/normal.go
  77. 3 2
      pkg/sub_formatter/normal/normal_test.go
  78. 39 38
      pkg/sub_formatter/old/old.go
  79. 4 3
      pkg/sub_formatter/sub_format_changer.go
  80. 3 1
      pkg/sub_helper/dialogue_merger.go
  81. 4 3
      pkg/sub_helper/sub_helper.go
  82. 5 4
      pkg/sub_parser_hub/subParserHub.go
  83. 2 1
      pkg/sub_timeline_fixer/pipeline.go
  84. 30 29
      pkg/task_queue/get.go
  85. 20 21
      pkg/task_queue/task_queue.go
  86. 18 18
      pkg/task_queue/task_queue_test.go
  87. 3 1
      pkg/types/backend/reply_all_jobs.go
  88. 0 0
      pkg/types/backend/reply_check_auth.go
  89. 0 0
      pkg/types/backend/reply_check_emby_path.go
  90. 0 0
      pkg/types/backend/reply_check_path.go
  91. 0 0
      pkg/types/backend/reply_check_proxy.go
  92. 0 0
      pkg/types/backend/reply_common.go
  93. 0 0
      pkg/types/backend/reply_job_log.go
  94. 0 0
      pkg/types/backend/reply_job_status.go
  95. 3 1
      pkg/types/backend/reply_job_things.go
  96. 0 0
      pkg/types/backend/reply_login.go
  97. 0 0
      pkg/types/backend/reply_movie_list.go
  98. 0 0
      pkg/types/backend/reply_refresh_video_list.go
  99. 3 1
      pkg/types/backend/reply_running_log.go
  100. 0 0
      pkg/types/backend/reply_series_list.go

+ 2 - 1
cmd/GetCAPTCHA/backend/git_helper.go

@@ -5,8 +5,9 @@ import (
 	"os"
 	"time"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+
 	"github.com/allanpk716/ChineseSubFinder/cmd/GetCAPTCHA/backend/config"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/something_static"
 	"github.com/go-git/go-git/v5"

+ 6 - 5
internal/backend/controllers/base/change_pwd.go

@@ -3,7 +3,8 @@ package base
 import (
 	"net/http"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
+	backend2 "github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/common"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"
 	"github.com/gin-gonic/gin"
@@ -17,7 +18,7 @@ func (cb ControllerBase) ChangePwdHandler(c *gin.Context) {
 		cb.ErrorProcess(c, "ChangePwdHandler", err)
 	}()
 
-	changePwd := backend.ReqChangePwd{}
+	changePwd := backend2.ReqChangePwd{}
 	err = c.ShouldBindJSON(&changePwd)
 	if err != nil {
 		return
@@ -25,13 +26,13 @@ func (cb ControllerBase) ChangePwdHandler(c *gin.Context) {
 
 	if settings.GetSettings().UserInfo.Username == "" || settings.GetSettings().UserInfo.Password == "" {
 		// 配置文件中的账号和密码任意一个未空,提示用户需要进行 setup 流程
-		c.JSON(http.StatusNoContent, backend.ReplyCommon{Message: "You need do `Setup`"})
+		c.JSON(http.StatusNoContent, backend2.ReplyCommon{Message: "You need do `Setup`"})
 		return
 	}
 
 	if settings.GetSettings().UserInfo.Password != changePwd.OrgPwd {
 		// 原始的密码不对
-		c.JSON(http.StatusNoContent, backend.ReplyCommon{Message: "Org Password Error"})
+		c.JSON(http.StatusNoContent, backend2.ReplyCommon{Message: "Org Password Error"})
 	} else {
 		// 同意修改密码
 		settings.GetSettings().UserInfo.Password = changePwd.NewPwd
@@ -41,6 +42,6 @@ func (cb ControllerBase) ChangePwdHandler(c *gin.Context) {
 		}
 		// 修改密码成功后,会清理 AccessToken,强制要求重写登录
 		common.SetAccessToken("")
-		c.JSON(http.StatusOK, backend.ReplyCommon{Message: "ok, need ReLogin"})
+		c.JSON(http.StatusOK, backend2.ReplyCommon{Message: "ok, need ReLogin"})
 	}
 }

+ 6 - 5
internal/backend/controllers/base/check_cron.go

@@ -1,10 +1,11 @@
 package base
 
 import (
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
+	"net/http"
+
+	backend2 "github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
 	"github.com/gin-gonic/gin"
 	"github.com/robfig/cron/v3"
-	"net/http"
 )
 
 func (cb ControllerBase) CheckCronHandler(c *gin.Context) {
@@ -14,7 +15,7 @@ func (cb ControllerBase) CheckCronHandler(c *gin.Context) {
 		cb.ErrorProcess(c, "CheckCronHandler", err)
 	}()
 
-	checkCron := backend.ReqCheckCron{}
+	checkCron := backend2.ReqCheckCron{}
 	err = c.ShouldBindJSON(&checkCron)
 	if err != nil {
 		return
@@ -22,9 +23,9 @@ func (cb ControllerBase) CheckCronHandler(c *gin.Context) {
 
 	_, err2 := cron.ParseStandard(checkCron.ScanInterval)
 	if err2 != nil {
-		c.JSON(http.StatusOK, backend.ReplyCommon{Message: err2.Error()})
+		c.JSON(http.StatusOK, backend2.ReplyCommon{Message: err2.Error()})
 		return
 	} else {
-		c.JSON(http.StatusOK, backend.ReplyCommon{Message: "ok"})
+		c.JSON(http.StatusOK, backend2.ReplyCommon{Message: "ok"})
 	}
 }

+ 2 - 1
internal/backend/controllers/base/controller_base.go

@@ -3,7 +3,8 @@ package base
 import (
 	"net/http"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/file_downloader"
 	"github.com/gin-gonic/gin"
 )

+ 5 - 4
internal/backend/controllers/base/login.go

@@ -3,7 +3,8 @@ package base
 import (
 	"net/http"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
+	backend2 "github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/common"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"
@@ -25,20 +26,20 @@ func (cb ControllerBase) LoginHandler(c *gin.Context) {
 
 	if settings.GetSettings().UserInfo.Username == "" || settings.GetSettings().UserInfo.Password == "" {
 		// 配置文件中的账号和密码任意一个未空,提示用户需要进行 setup 流程
-		c.JSON(http.StatusNoContent, backend.ReplyCommon{Message: "You need do `Setup`"})
+		c.JSON(http.StatusNoContent, backend2.ReplyCommon{Message: "You need do `Setup`"})
 		return
 	}
 
 	if settings.GetSettings().UserInfo.Username != nowUserInfo.Username ||
 		settings.GetSettings().UserInfo.Password != nowUserInfo.Password {
 		// 账号密码不匹配
-		c.JSON(http.StatusBadRequest, backend.ReplyCommon{Message: "Username or Password Error"})
+		c.JSON(http.StatusBadRequest, backend2.ReplyCommon{Message: "Username or Password Error"})
 		return
 	} else {
 		// 用户账号密码匹配
 		nowAccessToken := my_util.GenerateAccessToken()
 		common.SetAccessToken(nowAccessToken)
-		c.JSON(http.StatusOK, backend.ReplyLogin{AccessToken: nowAccessToken,
+		c.JSON(http.StatusOK, backend2.ReplyLogin{AccessToken: nowAccessToken,
 			Settings: *settings.GetSettings().GetNoPasswordSettings()})
 		return
 	}

+ 1 - 1
internal/backend/controllers/base/logout.go

@@ -1,9 +1,9 @@
 package base
 
 import (
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
 	"net/http"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
 	"github.com/allanpk716/ChineseSubFinder/pkg/common"
 	"github.com/gin-gonic/gin"
 )

+ 7 - 6
internal/backend/controllers/base/path_things.go

@@ -3,7 +3,8 @@ package base
 import (
 	"net/http"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
+	backend2 "github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/emby_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"
@@ -17,18 +18,18 @@ func (cb ControllerBase) CheckPathHandler(c *gin.Context) {
 		cb.ErrorProcess(c, "CheckPathHandler", err)
 	}()
 
-	reqCheckPath := backend.ReqCheckPath{}
+	reqCheckPath := backend2.ReqCheckPath{}
 	err = c.ShouldBindJSON(&reqCheckPath)
 	if err != nil {
 		return
 	}
 
 	if my_util.IsDir(reqCheckPath.Path) == true {
-		c.JSON(http.StatusOK, backend.ReplyCheckPath{
+		c.JSON(http.StatusOK, backend2.ReplyCheckPath{
 			Valid: true,
 		})
 	} else {
-		c.JSON(http.StatusOK, backend.ReplyCheckPath{
+		c.JSON(http.StatusOK, backend2.ReplyCheckPath{
 			Valid: false,
 		})
 	}
@@ -41,7 +42,7 @@ func (cb *ControllerBase) CheckEmbyPathHandler(c *gin.Context) {
 		cb.ErrorProcess(c, "CheckEmbyPathHandler", err)
 	}()
 
-	reqCheckPath := backend.ReqCheckEmbyPath{}
+	reqCheckPath := backend2.ReqCheckEmbyPath{}
 	err = c.ShouldBindJSON(&reqCheckPath)
 	if err != nil {
 		return
@@ -71,7 +72,7 @@ func (cb *ControllerBase) CheckEmbyPathHandler(c *gin.Context) {
 		return
 	}
 
-	c.JSON(http.StatusOK, backend.ReplyCheckEmbyPath{
+	c.JSON(http.StatusOK, backend2.ReplyCheckEmbyPath{
 		MediaList: outList,
 	})
 }

+ 2 - 1
internal/backend/controllers/base/proxy.go

@@ -3,6 +3,8 @@ package base
 import (
 	"net/http"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+
 	subSupplier "github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_supplier"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_supplier/assrt"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_supplier/csf"
@@ -10,7 +12,6 @@ import (
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_supplier/subhd"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_supplier/xunlei"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
 	"github.com/gin-gonic/gin"
 )
 

+ 5 - 4
internal/backend/controllers/base/setup.go

@@ -3,7 +3,8 @@ package base
 import (
 	"net/http"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
+	backend2 "github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"
 	"github.com/gin-gonic/gin"
 )
@@ -15,7 +16,7 @@ func (cb ControllerBase) SetupHandler(c *gin.Context) {
 		cb.ErrorProcess(c, "SetupHandler", err)
 	}()
 
-	setupInfo := backend.ReqSetupInfo{}
+	setupInfo := backend2.ReqSetupInfo{}
 	err = c.ShouldBindJSON(&setupInfo)
 	if err != nil {
 		return
@@ -28,7 +29,7 @@ func (cb ControllerBase) SetupHandler(c *gin.Context) {
 
 	if found == true {
 		// 存在则反馈无需初始化
-		c.JSON(http.StatusNoContent, backend.ReplyCommon{Message: "already setup"})
+		c.JSON(http.StatusNoContent, backend2.ReplyCommon{Message: "already setup"})
 		return
 	} else {
 		// 需要创建用户,因为上述判断了没有用户存在,所以就默认直接新建了
@@ -36,7 +37,7 @@ func (cb ControllerBase) SetupHandler(c *gin.Context) {
 		if err != nil {
 			return
 		}
-		c.JSON(http.StatusOK, backend.ReplyCommon{Message: "ok"})
+		c.JSON(http.StatusOK, backend2.ReplyCommon{Message: "ok"})
 		return
 	}
 }

+ 1 - 1
internal/backend/controllers/base/system_status.go

@@ -1,9 +1,9 @@
 package base
 
 import (
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
 	"net/http"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
 	"github.com/allanpk716/ChineseSubFinder/pkg/global_value"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"
 	"github.com/gin-gonic/gin"

+ 19 - 18
internal/backend/controllers/v1/api.go

@@ -6,11 +6,12 @@ import (
 	"net/http"
 	"path/filepath"
 
+	backend2 "github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	TTaskqueue "github.com/allanpk716/ChineseSubFinder/pkg/types/task_queue"
+
 	"github.com/allanpk716/ChineseSubFinder/internal/dao"
 	"github.com/allanpk716/ChineseSubFinder/internal/models"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	TTaskqueue "github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/gin-gonic/gin"
@@ -24,7 +25,7 @@ func (cb *ControllerBase) AddJobHandler(c *gin.Context) {
 		cb.ErrorProcess(c, "AddJobHandler", err)
 	}()
 
-	videoListAdd := backend.ReqVideoListAdd{}
+	videoListAdd := backend2.ReqVideoListAdd{}
 	err = c.ShouldBindJSON(&videoListAdd)
 	if err != nil {
 		return
@@ -35,7 +36,7 @@ func (cb *ControllerBase) AddJobHandler(c *gin.Context) {
 		// 这里视频文件得要存在
 		if my_util.IsFile(videoListAdd.PhysicalVideoFileFullPath) == false {
 
-			c.JSON(http.StatusOK, backend.ReplyJobThings{
+			c.JSON(http.StatusOK, backend2.ReplyJobThings{
 				Message: "physical video file not found",
 			})
 			return
@@ -72,12 +73,12 @@ func (cb *ControllerBase) AddJobHandler(c *gin.Context) {
 		return
 	}
 	if bok == false {
-		c.JSON(http.StatusOK, backend.ReplyJobThings{
+		c.JSON(http.StatusOK, backend2.ReplyJobThings{
 			JobID:   nowJob.Id,
 			Message: "job is already in queue",
 		})
 	} else {
-		c.JSON(http.StatusOK, backend.ReplyJobThings{
+		c.JSON(http.StatusOK, backend2.ReplyJobThings{
 			JobID:   nowJob.Id,
 			Message: "ok",
 		})
@@ -94,7 +95,7 @@ func (cb *ControllerBase) GetJobStatusHandler(c *gin.Context) {
 
 	jobID := c.DefaultQuery("job_id", "")
 	if jobID == "" {
-		c.JSON(http.StatusOK, backend.ReplyJobThings{
+		c.JSON(http.StatusOK, backend2.ReplyJobThings{
 			Message: "job_id is empty",
 		})
 		return
@@ -102,14 +103,14 @@ func (cb *ControllerBase) GetJobStatusHandler(c *gin.Context) {
 
 	found, nowOneJob := cb.cronHelper.DownloadQueue.GetOneJobByID(jobID)
 	if found == false {
-		c.JSON(http.StatusOK, backend.ReplyJobThings{
+		c.JSON(http.StatusOK, backend2.ReplyJobThings{
 			JobID:   jobID,
 			Message: "job not found",
 		})
 		return
 	}
 
-	c.JSON(http.StatusOK, backend.ReplyJobThings{
+	c.JSON(http.StatusOK, backend2.ReplyJobThings{
 		JobID:     jobID,
 		JobStatus: nowOneJob.JobStatus,
 		Message:   "ok",
@@ -124,7 +125,7 @@ func (cb *ControllerBase) AddVideoPlayedInfoHandler(c *gin.Context) {
 		cb.ErrorProcess(c, "AddVideoPlayedInfoHandler", err)
 	}()
 
-	videoPlayedInfo := backend.ReqVideoPlayedInfo{}
+	videoPlayedInfo := backend2.ReqVideoPlayedInfo{}
 	err = c.ShouldBindJSON(&videoPlayedInfo)
 	if err != nil {
 		return
@@ -132,7 +133,7 @@ func (cb *ControllerBase) AddVideoPlayedInfoHandler(c *gin.Context) {
 	// 这里视频文件得要存在
 	if my_util.IsFile(videoPlayedInfo.PhysicalVideoFileFullPath) == false {
 
-		c.JSON(http.StatusOK, backend.ReplyJobThings{
+		c.JSON(http.StatusOK, backend2.ReplyJobThings{
 			Message: "physical video file not found",
 		})
 		return
@@ -142,7 +143,7 @@ func (cb *ControllerBase) AddVideoPlayedInfoHandler(c *gin.Context) {
 	subFileFullPath := filepath.Join(videoDirFPath, videoPlayedInfo.SubName)
 	if my_util.IsFile(subFileFullPath) == false {
 
-		c.JSON(http.StatusOK, backend.ReplyJobThings{
+		c.JSON(http.StatusOK, backend2.ReplyJobThings{
 			Message: "sub file not found",
 		})
 		return
@@ -163,7 +164,7 @@ func (cb *ControllerBase) AddVideoPlayedInfoHandler(c *gin.Context) {
 		dao.GetDb().Save(&videoPlayedInfos[0])
 	}
 
-	c.JSON(http.StatusOK, backend.ReplyJobThings{
+	c.JSON(http.StatusOK, backend2.ReplyJobThings{
 		Message: "ok",
 	})
 }
@@ -176,7 +177,7 @@ func (cb *ControllerBase) DelVideoPlayedInfoHandler(c *gin.Context) {
 		cb.ErrorProcess(c, "DelVideoPlayedInfoHandler", err)
 	}()
 
-	videoPlayedInfo := backend.ReqVideoPlayedInfo{}
+	videoPlayedInfo := backend2.ReqVideoPlayedInfo{}
 	err = c.ShouldBindJSON(&videoPlayedInfo)
 	if err != nil {
 		return
@@ -184,7 +185,7 @@ func (cb *ControllerBase) DelVideoPlayedInfoHandler(c *gin.Context) {
 	// 这里视频文件得要存在
 	if my_util.IsFile(videoPlayedInfo.PhysicalVideoFileFullPath) == false {
 
-		c.JSON(http.StatusOK, backend.ReplyJobThings{
+		c.JSON(http.StatusOK, backend2.ReplyJobThings{
 			Message: "physical video file not found",
 		})
 		return
@@ -194,7 +195,7 @@ func (cb *ControllerBase) DelVideoPlayedInfoHandler(c *gin.Context) {
 	dao.GetDb().Where("physical_video_file_full_path = ?", videoPlayedInfo.PhysicalVideoFileFullPath).Find(&videoPlayedInfos)
 	if len(videoPlayedInfos) == 0 {
 		// 没有则也返回成功
-		c.JSON(http.StatusOK, backend.ReplyJobThings{
+		c.JSON(http.StatusOK, backend2.ReplyJobThings{
 			Message: "ok",
 		})
 		return
@@ -202,7 +203,7 @@ func (cb *ControllerBase) DelVideoPlayedInfoHandler(c *gin.Context) {
 	} else {
 		// 有则更新,因为这个物理路径是主键,所以不用担心会查询出多个
 		dao.GetDb().Delete(&videoPlayedInfos[0])
-		c.JSON(http.StatusOK, backend.ReplyJobThings{
+		c.JSON(http.StatusOK, backend2.ReplyJobThings{
 			Message: "ok",
 		})
 		return

+ 1 - 1
internal/backend/controllers/v1/controller_base.go

@@ -1,10 +1,10 @@
 package v1
 
 import (
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
 	"net/http"
 
 	"github.com/allanpk716/ChineseSubFinder/internal/backend/controllers/base"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
 	"github.com/allanpk716/ChineseSubFinder/pkg/lock"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/cron_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/sub_formatter"

+ 5 - 4
internal/backend/controllers/v1/daemon_things.go

@@ -3,7 +3,8 @@ package v1
 import (
 	"net/http"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
+	backend2 "github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"
 	"github.com/gin-gonic/gin"
 )
@@ -21,7 +22,7 @@ func (cb ControllerBase) DaemonStartHandler(c *gin.Context) {
 		}()
 	}
 
-	c.JSON(http.StatusOK, backend.ReplyCommon{
+	c.JSON(http.StatusOK, backend2.ReplyCommon{
 		Message: "ok",
 	})
 }
@@ -39,7 +40,7 @@ func (cb ControllerBase) DaemonStopHandler(c *gin.Context) {
 		}()
 	}
 
-	c.JSON(http.StatusOK, backend.ReplyCommon{
+	c.JSON(http.StatusOK, backend2.ReplyCommon{
 		Message: "ok",
 	})
 }
@@ -51,7 +52,7 @@ func (cb ControllerBase) DaemonStatusHandler(c *gin.Context) {
 		cb.ErrorProcess(c, "DaemonStatusHandler", err)
 	}()
 
-	c.JSON(http.StatusOK, backend.ReplyJobStatus{
+	c.JSON(http.StatusOK, backend2.ReplyJobStatus{
 		Status: cb.cronHelper.CronRunningStatusString(),
 	})
 }

+ 16 - 15
internal/backend/controllers/v1/jobs_things.go

@@ -8,9 +8,10 @@ import (
 	"os"
 	"path/filepath"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
+	backend2 "github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	task_queue3 "github.com/allanpk716/ChineseSubFinder/pkg/types/task_queue"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/global_value"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	task_queue2 "github.com/allanpk716/ChineseSubFinder/pkg/task_queue"
@@ -30,13 +31,13 @@ func (cb ControllerBase) JobsListHandler(c *gin.Context) {
 	}
 
 	if bok == false {
-		c.JSON(http.StatusOK, backend.ReplyAllJobs{
-			AllJobs: make([]task_queue.OneJob, 0),
+		c.JSON(http.StatusOK, backend2.ReplyAllJobs{
+			AllJobs: make([]task_queue3.OneJob, 0),
 		})
 		return
 	}
 
-	c.JSON(http.StatusOK, backend.ReplyAllJobs{
+	c.JSON(http.StatusOK, backend2.ReplyAllJobs{
 		AllJobs: allJobs,
 	})
 }
@@ -48,7 +49,7 @@ func (cb ControllerBase) ChangeJobStatusHandler(c *gin.Context) {
 		cb.ErrorProcess(c, "JobsListHandler", err)
 	}()
 
-	desJobStatus := backend.ReqChangeJobStatus{}
+	desJobStatus := backend2.ReqChangeJobStatus{}
 	err = c.ShouldBindJSON(&desJobStatus)
 	if err != nil {
 		return
@@ -56,7 +57,7 @@ func (cb ControllerBase) ChangeJobStatusHandler(c *gin.Context) {
 
 	bok, nowOneJob := cb.cronHelper.DownloadQueue.GetOneJobByID(desJobStatus.Id)
 	if bok == false {
-		c.JSON(http.StatusOK, backend.ReplyCommon{Message: "job not found"})
+		c.JSON(http.StatusOK, backend2.ReplyCommon{Message: "job not found"})
 		return
 	}
 
@@ -71,10 +72,10 @@ func (cb ControllerBase) ChangeJobStatusHandler(c *gin.Context) {
 		nowOneJob.TaskPriority = task_queue2.LowTaskPriorityLevel
 	}
 	// 默认只能把任务改变为这两种状态
-	if desJobStatus.JobStatus == task_queue.Waiting || desJobStatus.JobStatus == task_queue.Ignore {
+	if desJobStatus.JobStatus == task_queue3.Waiting || desJobStatus.JobStatus == task_queue3.Ignore {
 		nowOneJob.JobStatus = desJobStatus.JobStatus
 	} else {
-		nowOneJob.JobStatus = task_queue.Waiting
+		nowOneJob.JobStatus = task_queue3.Waiting
 	}
 
 	bok, err = cb.cronHelper.DownloadQueue.Update(nowOneJob)
@@ -83,11 +84,11 @@ func (cb ControllerBase) ChangeJobStatusHandler(c *gin.Context) {
 	}
 
 	if bok == false {
-		c.JSON(http.StatusOK, backend.ReplyCommon{Message: "update job status failed"})
+		c.JSON(http.StatusOK, backend2.ReplyCommon{Message: "update job status failed"})
 		return
 	}
 
-	c.JSON(http.StatusOK, backend.ReplyCommon{Message: "ok"})
+	c.JSON(http.StatusOK, backend2.ReplyCommon{Message: "ok"})
 }
 
 func (cb ControllerBase) JobLogHandler(c *gin.Context) {
@@ -97,7 +98,7 @@ func (cb ControllerBase) JobLogHandler(c *gin.Context) {
 		cb.ErrorProcess(c, "JobLogHandler", err)
 	}()
 
-	reqJobLog := backend.ReqJobLog{}
+	reqJobLog := backend2.ReqJobLog{}
 	err = c.ShouldBindJSON(&reqJobLog)
 	if err != nil {
 		return
@@ -116,7 +117,7 @@ func (cb ControllerBase) JobLogHandler(c *gin.Context) {
 		}
 		defer fi.Close()
 
-		ReplyJobLog := backend.ReplyJobLog{}
+		ReplyJobLog := backend2.ReplyJobLog{}
 		ReplyJobLog.OneLine = make([]string, 0)
 		br := bufio.NewReader(fi)
 		for {
@@ -131,7 +132,7 @@ func (cb ControllerBase) JobLogHandler(c *gin.Context) {
 		return
 	} else {
 		// 不存在
-		c.JSON(http.StatusOK, backend.ReplyCommon{Message: "job log not found"})
+		c.JSON(http.StatusOK, backend2.ReplyCommon{Message: "job log not found"})
 		return
 	}
 }

+ 2 - 1
internal/backend/controllers/v1/settings.go

@@ -3,7 +3,8 @@ package v1
 import (
 	"net/http"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/common"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"
 	"github.com/gin-gonic/gin"

+ 11 - 10
internal/backend/controllers/v1/video_list.go

@@ -6,9 +6,10 @@ import (
 	"net/http"
 	"time"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	TTaskqueue "github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
+	backend2 "github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	TTaskqueue "github.com/allanpk716/ChineseSubFinder/pkg/types/task_queue"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/video_scan_and_refresh_helper"
 	"github.com/gin-gonic/gin"
@@ -26,7 +27,7 @@ func (cb *ControllerBase) RefreshVideoListStatusHandler(c *gin.Context) {
 		status = "stopped"
 	}
 
-	c.JSON(http.StatusOK, backend.ReplyRefreshVideoList{
+	c.JSON(http.StatusOK, backend2.ReplyRefreshVideoList{
 		Status:     status,
 		ErrMessage: cb.videoScanAndRefreshHelperErrMessage})
 	return
@@ -41,7 +42,7 @@ func (cb *ControllerBase) RefreshVideoListHandler(c *gin.Context) {
 
 	if cb.videoScanAndRefreshHelperLocker.Lock() == false {
 		// 已经在执行,跳过
-		c.JSON(http.StatusOK, backend.ReplyRefreshVideoList{
+		c.JSON(http.StatusOK, backend2.ReplyRefreshVideoList{
 			Status: "running"})
 		return
 	}
@@ -84,7 +85,7 @@ func (cb *ControllerBase) RefreshVideoListHandler(c *gin.Context) {
 		cb.cronHelper.Downloader.SetMovieAndSeasonInfo(MovieInfos, SeasonInfos)
 	}()
 
-	c.JSON(http.StatusOK, backend.ReplyRefreshVideoList{
+	c.JSON(http.StatusOK, backend2.ReplyRefreshVideoList{
 		Status: "running"})
 	return
 }
@@ -96,7 +97,7 @@ func (cb *ControllerBase) VideoListAddHandler(c *gin.Context) {
 		cb.ErrorProcess(c, "VideoListAddHandler", err)
 	}()
 
-	videoListAdd := backend.ReqVideoListAdd{}
+	videoListAdd := backend2.ReqVideoListAdd{}
 	err = c.ShouldBindJSON(&videoListAdd)
 	if err != nil {
 		return
@@ -139,7 +140,7 @@ func (cb *ControllerBase) VideoListAddHandler(c *gin.Context) {
 			return
 		}
 		if bok == false {
-			c.JSON(http.StatusOK, backend.ReplyJobThings{
+			c.JSON(http.StatusOK, backend2.ReplyJobThings{
 				JobID:   oneJob.Id,
 				Message: "update job status failed",
 			})
@@ -147,7 +148,7 @@ func (cb *ControllerBase) VideoListAddHandler(c *gin.Context) {
 		}
 	}
 
-	c.JSON(http.StatusOK, backend.ReplyJobThings{
+	c.JSON(http.StatusOK, backend2.ReplyJobThings{
 		JobID:   oneJob.Id,
 		Message: "ok",
 	})
@@ -162,7 +163,7 @@ func (cb *ControllerBase) VideoListHandler(c *gin.Context) {
 
 	outMovieInfos, outSeasonInfo := cb.cronHelper.Downloader.GetMovieInfoAndSeasonInfo()
 
-	c.JSON(http.StatusOK, backend.ReplyVideoList{
+	c.JSON(http.StatusOK, backend2.ReplyVideoList{
 		MovieInfos:  outMovieInfos,
 		SeasonInfos: outSeasonInfo,
 	})

+ 2 - 1
internal/backend/middle/auth.go

@@ -4,7 +4,8 @@ import (
 	"net/http"
 	"strings"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/common"
 	"github.com/gin-gonic/gin"
 )

+ 12 - 11
internal/backend/ws_helper/client.go

@@ -7,7 +7,8 @@ import (
 	"sync"
 	"time"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend/ws"
+	ws2 "github.com/allanpk716/ChineseSubFinder/pkg/types/backend/ws"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/common"
 	"github.com/gorilla/websocket"
 	"github.com/sirupsen/logrus"
@@ -98,7 +99,7 @@ func (c *Client) readPump() {
 			return
 		}
 
-		revMessage := ws.BaseMessage{}
+		revMessage := ws2.BaseMessage{}
 		err = json.Unmarshal(message, &revMessage)
 		if err != nil {
 			c.log.Debugln("readPump.BaseMessage.parse", err)
@@ -107,12 +108,12 @@ func (c *Client) readPump() {
 
 		if c.authed == false {
 			// 如果没有经过认证,那么第一条一定需要判断是认证的消息
-			if revMessage.Type != ws.Auth.String() {
+			if revMessage.Type != ws2.Auth.String() {
 				// 提掉线
 				return
 			}
 			// 认证
-			login := ws.Login{}
+			login := ws2.Login{}
 			err = json.Unmarshal([]byte(revMessage.Data), &login)
 			if err != nil {
 				c.log.Debugln("readPump.Login.parse", err)
@@ -122,18 +123,18 @@ func (c *Client) readPump() {
 			if login.Token != common.GetAccessToken() {
 				// 登录 Token 不对
 				// 发送 token 失败的消息
-				outBytes, err := AuthReply(ws.AuthError)
+				outBytes, err := AuthReply(ws2.AuthError)
 				if err != nil {
 					c.log.Debugln("readPump.AuthReply", err)
 					return
 				}
 				c.send <- outBytes
 				// 直接退出可能会导致发送的队列没有清空,这里单独判断一条特殊的命令,收到 Write 线程就退出
-				c.send <- ws.CloseThisConnect
+				c.send <- ws2.CloseThisConnect
 
 			} else {
 				// Token 通过
-				outBytes, err := AuthReply(ws.AuthOk)
+				outBytes, err := AuthReply(ws2.AuthOk)
 				if err != nil {
 					c.log.Debugln("readPump.AuthReply", err)
 					return
@@ -168,7 +169,7 @@ func (c *Client) writePump() {
 		select {
 		case message, ok := <-c.send:
 
-			if bytes.Equal(message, ws.CloseThisConnect) == true {
+			if bytes.Equal(message, ws2.CloseThisConnect) == true {
 				return
 			}
 
@@ -219,18 +220,18 @@ func (c *Client) writePump() {
 }
 
 // AuthReply 生成认证通过的回复数据
-func AuthReply(inType ws.AuthMessage) ([]byte, error) {
+func AuthReply(inType ws2.AuthMessage) ([]byte, error) {
 
 	var err error
 	var outData, outBytes []byte
-	outData, err = json.Marshal(&ws.Reply{
+	outData, err = json.Marshal(&ws2.Reply{
 		Message: inType.String(),
 	})
 	if err != nil {
 		return nil, err
 	}
 
-	outBytes, err = ws.NewBaseMessage(ws.CommonReply.String(), string(outData)).Bytes()
+	outBytes, err = ws2.NewBaseMessage(ws2.CommonReply.String(), string(outData)).Bytes()
 	if err != nil {
 		return nil, err
 	}

+ 2 - 1
pkg/cache_center/download_file_info.go

@@ -7,7 +7,8 @@ import (
 	"path/filepath"
 	"time"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/cache_center/models"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 )

+ 2 - 2
pkg/cache_center/download_file_info_test.go

@@ -1,10 +1,10 @@
 package cache_center
 
 import (
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
 	"testing"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
 	"github.com/allanpk716/ChineseSubFinder/pkg/log_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"
 )

+ 7 - 6
pkg/decode/decode.go

@@ -9,8 +9,9 @@ import (
 	"strings"
 	"time"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types"
-	common2 "github.com/allanpk716/ChineseSubFinder/internal/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+
 	"github.com/beevik/etree"
 	PTN "github.com/middelink/go-parse-torrent-name"
 )
@@ -268,7 +269,7 @@ func GetVideoNfoInfo4Movie(movieFileFullPath string) (types.VideoNfoInfo, error)
 	}
 	// 根据找到的开始解析
 	if movieNameNfoFPath == "" && movieXmlFPath == "" && nfoFilePath == "" {
-		return videoNfoInfo, common2.NoMetadataFile
+		return videoNfoInfo, common.NoMetadataFile
 	}
 	// 优先分析 movieName.nfo 文件
 	if movieNameNfoFPath != "" {
@@ -296,7 +297,7 @@ func GetVideoNfoInfo4Movie(movieFileFullPath string) (types.VideoNfoInfo, error)
 		}
 	}
 
-	return videoNfoInfo, common2.NoMetadataFile
+	return videoNfoInfo, common.NoMetadataFile
 }
 
 // GetVideoNfoInfo4SeriesDir 从一个连续剧的根目录获取 IMDB info
@@ -326,7 +327,7 @@ func GetVideoNfoInfo4SeriesDir(seriesDir string) (types.VideoNfoInfo, error) {
 	}
 	// 根据找到的开始解析
 	if nfoFilePath == "" {
-		return imdbInfo, common2.NoMetadataFile
+		return imdbInfo, common.NoMetadataFile
 	}
 	return getVideoNfoInfo(nfoFilePath, "tvshow")
 }
@@ -555,7 +556,7 @@ func IsFakeBDMVWorked(fakseVideFPath string) (bool, string, string) {
 	CERDir := filepath.Join(rootDir, "CERTIFICATE")
 	BDMVDir := filepath.Join(rootDir, "BDMV")
 	STREAMDir := filepath.Join(BDMVDir, "STREAM")
-	idBDMVFPath := filepath.Join(CERDir, common2.FileBDMV)
+	idBDMVFPath := filepath.Join(CERDir, common.FileBDMV)
 
 	if IsDir(CERDir) == true && IsDir(BDMVDir) == true && IsFile(idBDMVFPath) == true {
 		return true, idBDMVFPath, STREAMDir

+ 2 - 1
pkg/decode/decode_test.go

@@ -5,7 +5,8 @@ import (
 	"reflect"
 	"testing"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/unit_test_helper"
 )
 

+ 17 - 16
pkg/downloader/cache_info.go

@@ -3,23 +3,24 @@ package downloader
 import (
 	"path/filepath"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
+	backend2 "github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/task_queue"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_folder"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/strcut_json"
 	"github.com/allanpk716/ChineseSubFinder/pkg/sub_helper"
 )
 
-func (d *Downloader) SetMovieAndSeasonInfo(movieInfos []backend.MovieInfo, seasonInfos []backend.SeasonInfo) {
+func (d *Downloader) SetMovieAndSeasonInfo(movieInfos []backend2.MovieInfo, seasonInfos []backend2.SeasonInfo) {
 	d.cacheLocker.Lock()
 	defer d.cacheLocker.Unlock()
 
 	d.setMovieAndSeasonInfo(movieInfos, seasonInfos)
 }
 
-func (d *Downloader) GetMovieInfoAndSeasonInfo() ([]backend.MovieInfo, []backend.SeasonInfo) {
+func (d *Downloader) GetMovieInfoAndSeasonInfo() ([]backend2.MovieInfo, []backend2.SeasonInfo) {
 	// 需要把本实例中的缓存 map 转换到 Web 传递的结构体中
 	d.cacheLocker.Lock()
 	defer d.cacheLocker.Unlock()
@@ -75,7 +76,7 @@ func (d *Downloader) UpdateInfo(job task_queue.OneJob) {
 	}
 }
 
-func (d *Downloader) setMovieAndSeasonInfo(movieInfos []backend.MovieInfo, seasonInfos []backend.SeasonInfo, skip ...bool) {
+func (d *Downloader) setMovieAndSeasonInfo(movieInfos []backend2.MovieInfo, seasonInfos []backend2.SeasonInfo, skip ...bool) {
 	// 需要把 Web 传递的结构体 转换到 本实例中的缓存 map
 
 	// 清空
@@ -135,16 +136,16 @@ func (d *Downloader) setMovieAndSeasonInfo(movieInfos []backend.MovieInfo, seaso
 	}
 }
 
-func (d *Downloader) getMovieInfoAndSeasonInfo(AllorFrontorEnd int) ([]backend.MovieInfo, []backend.SeasonInfo) {
+func (d *Downloader) getMovieInfoAndSeasonInfo(AllorFrontorEnd int) ([]backend2.MovieInfo, []backend2.SeasonInfo) {
 
-	outMovieInfos := make([]backend.MovieInfo, 0)
-	outSeasonInfo := make([]backend.SeasonInfo, 0)
+	outMovieInfos := make([]backend2.MovieInfo, 0)
+	outSeasonInfo := make([]backend2.SeasonInfo, 0)
 	// AllorFrontorEnd == 0, 全部, AllorFrontorEnd == 1, MovieInfo, AllorFrontorEnd == 2, SeasonInfo
 	if AllorFrontorEnd == 0 || AllorFrontorEnd == 1 {
 
 		for _, movieInfo := range d.movieInfoMap {
 
-			nowMovieInfo := backend.MovieInfo{
+			nowMovieInfo := backend2.MovieInfo{
 				Name:                     movieInfo.Name,
 				DirRootUrl:               movieInfo.DirRootUrl,
 				VideoFPath:               movieInfo.VideoFPath,
@@ -161,16 +162,16 @@ func (d *Downloader) getMovieInfoAndSeasonInfo(AllorFrontorEnd int) ([]backend.M
 
 		for _, seasonInfo := range d.seasonInfoMap {
 
-			nowSeasonInfo := backend.SeasonInfo{
+			nowSeasonInfo := backend2.SeasonInfo{
 				Name:          seasonInfo.Name,
 				RootDirPath:   seasonInfo.RootDirPath,
 				DirRootUrl:    seasonInfo.DirRootUrl,
-				OneVideoInfos: make([]backend.OneVideoInfo, 0),
+				OneVideoInfos: make([]backend2.OneVideoInfo, 0),
 			}
 
 			for _, oneVideoInfo := range seasonInfo.OneVideoInfoMap {
 
-				nowOneVideoInfo := backend.OneVideoInfo{
+				nowOneVideoInfo := backend2.OneVideoInfo{
 
 					Name:                     oneVideoInfo.Name,
 					VideoFPath:               oneVideoInfo.VideoFPath,
@@ -191,7 +192,7 @@ func (d *Downloader) getMovieInfoAndSeasonInfo(AllorFrontorEnd int) ([]backend.M
 	return outMovieInfos, outSeasonInfo
 }
 
-func (d *Downloader) saveVideoListCache(movieInfos []backend.MovieInfo, seasonInfos []backend.SeasonInfo) error {
+func (d *Downloader) saveVideoListCache(movieInfos []backend2.MovieInfo, seasonInfos []backend2.SeasonInfo) error {
 
 	// 缓存下来
 	cacheCenterFolder, err := my_folder.GetRootCacheCenterFolder()
@@ -230,8 +231,8 @@ func (d *Downloader) loadVideoListCache() error {
 	movieInfosFileName := filepath.Join(cacheCenterFolder, "movie_infos.json")
 	seasonInfosFileName := filepath.Join(cacheCenterFolder, "season_infos.json")
 
-	movieInfos := make([]backend.MovieInfo, 0)
-	seasonInfos := make([]backend.SeasonInfo, 0)
+	movieInfos := make([]backend2.MovieInfo, 0)
+	seasonInfos := make([]backend2.SeasonInfo, 0)
 
 	if my_util.IsFile(movieInfosFileName) == true {
 		err = strcut_json.ToStruct(movieInfosFileName, &movieInfos)

+ 2 - 1
pkg/downloader/download_processer.go

@@ -5,9 +5,10 @@ import (
 	"fmt"
 	"path/filepath"
 
+	taskQueue2 "github.com/allanpk716/ChineseSubFinder/pkg/types/task_queue"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/series_helper"
 
-	taskQueue2 "github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/sub_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/task_queue"

+ 16 - 15
pkg/downloader/downloader.go

@@ -5,6 +5,10 @@ import (
 	"fmt"
 	"sync"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/ifaces"
+	common2 "github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	taskQueue2 "github.com/allanpk716/ChineseSubFinder/pkg/types/task_queue"
+
 	embyHelper "github.com/allanpk716/ChineseSubFinder/pkg/logic/emby_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/file_downloader"
 	markSystem "github.com/allanpk716/ChineseSubFinder/pkg/logic/mark_system"
@@ -17,9 +21,6 @@ import (
 
 	"github.com/allanpk716/ChineseSubFinder/pkg/global_value"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/ifaces"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	taskQueue2 "github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
 	"github.com/allanpk716/ChineseSubFinder/pkg/log_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_folder"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
@@ -67,13 +68,13 @@ func NewDownloader(inSubFormatter ifaces.ISubFormatter, fileDownloader *file_dow
 
 	var sitesSequence = make([]string, 0)
 	// TODO 这里写固定了抉择字幕的顺序
-	sitesSequence = append(sitesSequence, common.SubSiteZiMuKu)
-	sitesSequence = append(sitesSequence, common.SubSiteSubHd)
-	sitesSequence = append(sitesSequence, common.SubSiteChineseSubFinder)
-	sitesSequence = append(sitesSequence, common.SubSiteAssrt)
-	sitesSequence = append(sitesSequence, common.SubSiteA4K)
-	sitesSequence = append(sitesSequence, common.SubSiteShooter)
-	sitesSequence = append(sitesSequence, common.SubSiteXunLei)
+	sitesSequence = append(sitesSequence, common2.SubSiteZiMuKu)
+	sitesSequence = append(sitesSequence, common2.SubSiteSubHd)
+	sitesSequence = append(sitesSequence, common2.SubSiteChineseSubFinder)
+	sitesSequence = append(sitesSequence, common2.SubSiteAssrt)
+	sitesSequence = append(sitesSequence, common2.SubSiteA4K)
+	sitesSequence = append(sitesSequence, common2.SubSiteShooter)
+	sitesSequence = append(sitesSequence, common2.SubSiteXunLei)
 	downloader.mk = markSystem.NewMarkingSystem(downloader.log, sitesSequence, downloader.settings.AdvancedSettings.SubTypePriority)
 
 	// 初始化,字幕校正的实例
@@ -206,7 +207,7 @@ func (d *Downloader) QueueDownloader() {
 	// --------------------------------------------------
 	// 这个任务如果是 series 那么需要考虑是否原始存入的信息是缺失的,需要补全
 	{
-		if oneJob.VideoType == common.Series && (oneJob.SeriesRootDirPath == "" || oneJob.Season <= 0 || oneJob.Episode <= 0) {
+		if oneJob.VideoType == common2.Series && (oneJob.SeriesRootDirPath == "" || oneJob.Season <= 0 || oneJob.Episode <= 0) {
 			// 连续剧的时候需要额外提交信息
 			epsVideoNfoInfo, err := decode.GetVideoNfoInfo4OneSeriesEpisode(oneJob.VideoFPath)
 			if err != nil {
@@ -285,7 +286,7 @@ func (d *Downloader) QueueDownloader() {
 	{
 		if oneJob.TaskPriority > task_queue.HighTaskPriorityLevel {
 			// 优先级大于 3,那么就不是很急的任务,才需要判断
-			if oneJob.VideoType == common.Movie {
+			if oneJob.VideoType == common2.Movie {
 				if d.subSupplierHub.MovieNeedDlSub(oneJob.VideoFPath, false) == false {
 					// 需要标记忽略
 					oneJob.JobStatus = taskQueue2.Ignore
@@ -301,7 +302,7 @@ func (d *Downloader) QueueDownloader() {
 					d.log.Infoln("MovieNeedDlSub == false, Ignore This Job")
 					return
 				}
-			} else if oneJob.VideoType == common.Series {
+			} else if oneJob.VideoType == common2.Series {
 
 				bNeedDlSub, seriesInfo, err := d.subSupplierHub.SeriesNeedDlSub(oneJob.SeriesRootDirPath,
 					false, false)
@@ -386,11 +387,11 @@ func (d *Downloader) QueueDownloader() {
 			}
 		}()
 
-		if oneJob.VideoType == common.Movie {
+		if oneJob.VideoType == common2.Movie {
 			// 电影
 			// 具体的下载逻辑 func()
 			done <- d.movieDlFunc(d.ctx, oneJob, downloadCounter)
-		} else if oneJob.VideoType == common.Series {
+		} else if oneJob.VideoType == common2.Series {
 			// 连续剧
 			// 具体的下载逻辑 func()
 			done <- d.seriesDlFunc(d.ctx, oneJob, downloadCounter)

+ 4 - 3
pkg/downloader/downloader_things.go

@@ -6,9 +6,10 @@ import (
 	"os"
 	"path/filepath"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/series"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/series"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/change_file_encode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/chs_cht_changer"
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"

+ 2 - 1
pkg/emby_api/emby_api.go

@@ -6,7 +6,8 @@ import (
 	"sync"
 	"time"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/emby"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/emby"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"
 	"github.com/go-resty/resty/v2"
 	"github.com/panjf2000/ants/v2"

+ 2 - 1
pkg/ffmpeg_helper/audio_info.go

@@ -3,7 +3,8 @@ package ffmpeg_helper
 import (
 	"fmt"
 
-	language2 "github.com/allanpk716/ChineseSubFinder/internal/types/language"
+	language2 "github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/language"
 )
 

+ 2 - 1
pkg/ffmpeg_helper/ffmpeg_helper.go

@@ -8,7 +8,8 @@ import (
 	"os/exec"
 	"path/filepath"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/language"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/ass"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/srt"

+ 2 - 2
pkg/ffmpeg_helper/ffmpeg_info.go

@@ -1,12 +1,12 @@
 package ffmpeg_helper
 
 import (
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
 	"os"
 	"path/filepath"
 	"strings"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_folder"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/sub_helper"

+ 1 - 1
pkg/ffmpeg_helper/subtitile_info.go

@@ -2,8 +2,8 @@ package ffmpeg_helper
 
 import (
 	"fmt"
+	language2 "github.com/allanpk716/ChineseSubFinder/pkg/types/language"
 
-	language2 "github.com/allanpk716/ChineseSubFinder/internal/types/language"
 	"github.com/allanpk716/ChineseSubFinder/pkg/language"
 )
 

+ 3 - 2
pkg/hot_fix/hot_fix_hub.go

@@ -4,10 +4,11 @@ import (
 	"errors"
 	"fmt"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/ifaces"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types"
+
 	"github.com/allanpk716/ChineseSubFinder/internal/dao"
-	"github.com/allanpk716/ChineseSubFinder/internal/ifaces"
 	"github.com/allanpk716/ChineseSubFinder/internal/models"
-	"github.com/allanpk716/ChineseSubFinder/internal/types"
 	"github.com/sirupsen/logrus"
 )
 

+ 2 - 1
pkg/hot_fix/hot_fix_hub_test.go

@@ -4,9 +4,10 @@ import (
 	"path/filepath"
 	"testing"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/types"
+
 	"github.com/allanpk716/ChineseSubFinder/internal/dao"
 	"github.com/allanpk716/ChineseSubFinder/internal/models"
-	"github.com/allanpk716/ChineseSubFinder/internal/types"
 	"github.com/allanpk716/ChineseSubFinder/pkg/log_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/unit_test_helper"
 )

+ 0 - 0
internal/ifaces/iHotFix.go → pkg/ifaces/iHotFix.go


+ 0 - 0
internal/ifaces/iMediaSystem.go → pkg/ifaces/iMediaSystem.go


+ 1 - 1
internal/ifaces/iSubFormatter.go → pkg/ifaces/iSubFormatter.go

@@ -1,7 +1,7 @@
 package ifaces
 
 import (
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/language"
 )
 
 // ISubFormatter 如果新增了更多的字幕命名格式化的实现,需要找所有以下 to do 去增加实现

+ 1 - 1
internal/ifaces/iSubParser.go → pkg/ifaces/iSubParser.go

@@ -1,7 +1,7 @@
 package ifaces
 
 import (
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
 )
 
 type ISubParser interface {

+ 2 - 2
internal/ifaces/iSupplier.go → pkg/ifaces/iSupplier.go

@@ -1,9 +1,9 @@
 package ifaces
 
 import (
-	"github.com/allanpk716/ChineseSubFinder/internal/types/series"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/series"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
 	"github.com/sirupsen/logrus"
 )
 

+ 3 - 2
pkg/imdb_helper/imdb.go

@@ -5,11 +5,12 @@ import (
 	"strconv"
 	"strings"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/types"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+
 	"github.com/StalkR/imdb"
 	"github.com/allanpk716/ChineseSubFinder/internal/dao"
 	"github.com/allanpk716/ChineseSubFinder/internal/models"
-	"github.com/allanpk716/ChineseSubFinder/internal/types"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/notify_center"

+ 2 - 1
pkg/imdb_helper/imdb_test.go

@@ -3,7 +3,8 @@ package imdb_helper
 import (
 	"testing"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/log_helper"
 )
 

+ 126 - 125
pkg/language/ISOLanguage.go

@@ -2,81 +2,82 @@ package language
 
 import (
 	"fmt"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
 	"strings"
+
+	language2 "github.com/allanpk716/ChineseSubFinder/pkg/types/language"
 )
 
 // ISOString2SupportLang 从语言缩写字符串转换为内部的 MyLanguage 类型
 // 1. 支持 ISO 639-1、639-2/B、639-2/T、639-3
 // 2. 支持中文的多种变种编码
 // https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
-func ISOString2SupportLang(isoString string) language.MyLanguage {
+func ISOString2SupportLang(isoString string) language2.MyLanguage {
 
 	lowerString := strings.ToLower(isoString)
 
 	// 639-1
 	switch lowerString {
-	case language.ISO_639_1_Chinese:
-		return language.ChineseSimple
-	case language.ISO_639_1_English:
-		return language.English
-	case language.ISO_639_1_Korean:
-		return language.Korean
-	case language.ISO_639_1_Japanese:
-		return language.Japanese
+	case language2.ISO_639_1_Chinese:
+		return language2.ChineseSimple
+	case language2.ISO_639_1_English:
+		return language2.English
+	case language2.ISO_639_1_Korean:
+		return language2.Korean
+	case language2.ISO_639_1_Japanese:
+		return language2.Japanese
 	}
 	// 639-2/B
 	switch lowerString {
-	case language.ISO_639_2B_Chinese:
-		return language.ChineseSimple
-	case language.ISO_639_2B_English:
-		return language.English
-	case language.ISO_639_2B_Japanese:
-		return language.Japanese
-	case language.ISO_639_2B_Korean:
-		return language.Korean
+	case language2.ISO_639_2B_Chinese:
+		return language2.ChineseSimple
+	case language2.ISO_639_2B_English:
+		return language2.English
+	case language2.ISO_639_2B_Japanese:
+		return language2.Japanese
+	case language2.ISO_639_2B_Korean:
+		return language2.Korean
 	}
 	// 639-2/T
 	switch lowerString {
-	case language.ISO_639_2T_Chinese:
-		return language.ChineseSimple
-	case language.ISO_639_2T_English:
-		return language.English
-	case language.ISO_639_2T_Japanese:
-		return language.Japanese
-	case language.ISO_639_2T_Korean:
-		return language.Korean
+	case language2.ISO_639_2T_Chinese:
+		return language2.ChineseSimple
+	case language2.ISO_639_2T_English:
+		return language2.English
+	case language2.ISO_639_2T_Japanese:
+		return language2.Japanese
+	case language2.ISO_639_2T_Korean:
+		return language2.Korean
 	}
 	// 639-3
 	switch lowerString {
-	case language.ISO_639_3_Chinese:
-		return language.ChineseSimple
-	case language.ISO_639_3_English:
-		return language.English
-	case language.ISO_639_3_Korean:
-		return language.Korean
-	case language.ISO_639_3_Japanese:
-		return language.Japanese
+	case language2.ISO_639_3_Chinese:
+		return language2.ChineseSimple
+	case language2.ISO_639_3_English:
+		return language2.English
+	case language2.ISO_639_3_Korean:
+		return language2.Korean
+	case language2.ISO_639_3_Japanese:
+		return language2.Japanese
 	}
 	// 中文编码变种
 	switch lowerString {
-	case language.ChineseISO_Hans:
-		return language.ChineseSimple
-	case language.ChineseISO_Hant:
-		return language.ChineseTraditional
-	case language.ChineseISO_CN:
-		return language.ChineseSimple
-	case language.ChineseISO_TW:
-		return language.ChineseTraditional
-	case language.ChineseISO_SG,
-		language.ChineseISO_MY:
-		return language.ChineseSimple
-	case language.ChineseISO_HK,
-		language.ChineseISO_MO:
-		return language.ChineseTraditional
-	}
-
-	return language.Unknown
+	case language2.ChineseISO_Hans:
+		return language2.ChineseSimple
+	case language2.ChineseISO_Hant:
+		return language2.ChineseTraditional
+	case language2.ChineseISO_CN:
+		return language2.ChineseSimple
+	case language2.ChineseISO_TW:
+		return language2.ChineseTraditional
+	case language2.ChineseISO_SG,
+		language2.ChineseISO_MY:
+		return language2.ChineseSimple
+	case language2.ChineseISO_HK,
+		language2.ChineseISO_MO:
+		return language2.ChineseTraditional
+	}
+
+	return language2.Unknown
 }
 
 // IsSupportISOString 是否是受支持的语言,中、英、日、韩
@@ -87,34 +88,34 @@ func IsSupportISOString(isoString string) bool {
 	lowerString := strings.ToLower(isoString)
 
 	switch lowerString {
-	case language.ISO_639_1_Chinese, language.ISO_639_1_English, language.ISO_639_1_Korean, language.ISO_639_1_Japanese:
+	case language2.ISO_639_1_Chinese, language2.ISO_639_1_English, language2.ISO_639_1_Korean, language2.ISO_639_1_Japanese:
 		// 639-1
 		return true
 	}
 	switch lowerString {
-	case language.ISO_639_2B_Chinese, language.ISO_639_2B_English, language.ISO_639_2B_Japanese, language.ISO_639_2B_Korean:
+	case language2.ISO_639_2B_Chinese, language2.ISO_639_2B_English, language2.ISO_639_2B_Japanese, language2.ISO_639_2B_Korean:
 		// 639-2/B
 		return true
 	}
 	switch lowerString {
-	case language.ISO_639_2T_Chinese, language.ISO_639_2T_English, language.ISO_639_2T_Japanese, language.ISO_639_2T_Korean:
+	case language2.ISO_639_2T_Chinese, language2.ISO_639_2T_English, language2.ISO_639_2T_Japanese, language2.ISO_639_2T_Korean:
 		// 639-2/T
 		return true
 	}
 	switch lowerString {
-	case language.ISO_639_3_Chinese, language.ISO_639_3_English, language.ISO_639_3_Korean, language.ISO_639_3_Japanese:
+	case language2.ISO_639_3_Chinese, language2.ISO_639_3_English, language2.ISO_639_3_Korean, language2.ISO_639_3_Japanese:
 		// 639-3
 		return true
 	}
 	switch lowerString {
-	case language.ChineseISO_Hans,
-		language.ChineseISO_Hant,
-		language.ChineseISO_CN,
-		language.ChineseISO_TW,
-		language.ChineseISO_SG,
-		language.ChineseISO_MY,
-		language.ChineseISO_HK,
-		language.ChineseISO_MO:
+	case language2.ChineseISO_Hans,
+		language2.ChineseISO_Hant,
+		language2.ChineseISO_CN,
+		language2.ChineseISO_TW,
+		language2.ChineseISO_SG,
+		language2.ChineseISO_MY,
+		language2.ChineseISO_HK,
+		language2.ChineseISO_MO:
 		// 中文编码变种
 		return true
 	}
@@ -130,34 +131,34 @@ func IsSupportISOChineseString(isoString string) bool {
 	lowerString := strings.ToLower(isoString)
 
 	switch lowerString {
-	case language.ISO_639_1_Chinese:
+	case language2.ISO_639_1_Chinese:
 		// 639-1
 		return true
 	}
 	switch lowerString {
-	case language.ISO_639_2B_Chinese:
+	case language2.ISO_639_2B_Chinese:
 		// 639-2/B
 		return true
 	}
 	switch lowerString {
-	case language.ISO_639_2T_Chinese:
+	case language2.ISO_639_2T_Chinese:
 		// 639-2/T
 		return true
 	}
 	switch lowerString {
-	case language.ISO_639_3_Chinese:
+	case language2.ISO_639_3_Chinese:
 		// 639-3
 		return true
 	}
 	switch lowerString {
-	case language.ChineseISO_Hans,
-		language.ChineseISO_Hant,
-		language.ChineseISO_CN,
-		language.ChineseISO_TW,
-		language.ChineseISO_SG,
-		language.ChineseISO_MY,
-		language.ChineseISO_HK,
-		language.ChineseISO_MO:
+	case language2.ChineseISO_Hans,
+		language2.ChineseISO_Hant,
+		language2.ChineseISO_CN,
+		language2.ChineseISO_TW,
+		language2.ChineseISO_SG,
+		language2.ChineseISO_MY,
+		language2.ChineseISO_HK,
+		language2.ChineseISO_MO:
 		// 中文编码变种
 		return true
 	}
@@ -166,45 +167,45 @@ func IsSupportISOChineseString(isoString string) bool {
 }
 
 // MyLang2ISO_639_1_String 内置的语言转换到 ISO_639-1_codes 标准
-func MyLang2ISO_639_1_String(myLanguage language.MyLanguage) string {
+func MyLang2ISO_639_1_String(myLanguage language2.MyLanguage) string {
 
 	switch myLanguage {
-	case language.ChineseSimple,
-		language.ChineseTraditional,
-		language.ChineseSimpleEnglish,
-		language.ChineseTraditionalEnglish,
-		language.ChineseSimpleJapanese,
-		language.ChineseTraditionalJapanese,
-		language.ChineseSimpleKorean,
-		language.ChineseTraditionalKorean:
-		return language.ISO_639_1_Chinese
-	case language.English:
-		return language.ISO_639_1_English
-	case language.Japanese:
-		return language.ISO_639_1_Japanese
-	case language.Korean:
-		return language.ISO_639_1_Korean
+	case language2.ChineseSimple,
+		language2.ChineseTraditional,
+		language2.ChineseSimpleEnglish,
+		language2.ChineseTraditionalEnglish,
+		language2.ChineseSimpleJapanese,
+		language2.ChineseTraditionalJapanese,
+		language2.ChineseSimpleKorean,
+		language2.ChineseTraditionalKorean:
+		return language2.ISO_639_1_Chinese
+	case language2.English:
+		return language2.ISO_639_1_English
+	case language2.Japanese:
+		return language2.ISO_639_1_Japanese
+	case language2.Korean:
+		return language2.ISO_639_1_Korean
 	default:
-		return language.MathLangChnUnknown
+		return language2.MathLangChnUnknown
 	}
 }
 
 // MyLang2ChineseISO 中文语言编码变种,见 ISOLanguage.go 文件,这里区分简体、繁体等,如果语言是非中文则这里是空
-func MyLang2ChineseISO(myLanguage language.MyLanguage) string {
+func MyLang2ChineseISO(myLanguage language2.MyLanguage) string {
 	switch myLanguage {
-	case language.ChineseSimple,
-		language.ChineseSimpleEnglish,
-		language.ChineseSimpleJapanese,
-		language.ChineseSimpleKorean:
-		return language.ChineseISO_Hans
-
-	case language.ChineseTraditional,
-		language.ChineseTraditionalEnglish,
-		language.ChineseTraditionalJapanese,
-		language.ChineseTraditionalKorean:
-		return language.ChineseISO_Hant
-
-	case language.English, language.Japanese, language.Korean:
+	case language2.ChineseSimple,
+		language2.ChineseSimpleEnglish,
+		language2.ChineseSimpleJapanese,
+		language2.ChineseSimpleKorean:
+		return language2.ChineseISO_Hans
+
+	case language2.ChineseTraditional,
+		language2.ChineseTraditionalEnglish,
+		language2.ChineseTraditionalJapanese,
+		language2.ChineseTraditionalKorean:
+		return language2.ChineseISO_Hant
+
+	case language2.English, language2.Japanese, language2.Korean:
 		return ""
 	default:
 		return ""
@@ -218,30 +219,30 @@ func ISOSupportRegexRule() string {
 		return isoISORegString
 	}
 
-	isoISORegString = language.RegISORuleFront
+	isoISORegString = language2.RegISORuleFront
 
-	isoISORegString += addISORegSubLangString(language.ChineseISO_Hans)
-	isoISORegString += addISORegSubLangString(language.ChineseISO_Hant)
-	isoISORegString += addISORegSubLangString(language.ChineseISO_CN)
-	isoISORegString += addISORegSubLangString(language.ChineseISO_TW)
-	isoISORegString += addISORegSubLangString(language.ChineseISO_SG)
-	isoISORegString += addISORegSubLangString(language.ChineseISO_MY)
-	isoISORegString += addISORegSubLangString(language.ChineseISO_HK)
-	isoISORegString += addISORegSubLangString(language.ChineseISO_MO)
+	isoISORegString += addISORegSubLangString(language2.ChineseISO_Hans)
+	isoISORegString += addISORegSubLangString(language2.ChineseISO_Hant)
+	isoISORegString += addISORegSubLangString(language2.ChineseISO_CN)
+	isoISORegString += addISORegSubLangString(language2.ChineseISO_TW)
+	isoISORegString += addISORegSubLangString(language2.ChineseISO_SG)
+	isoISORegString += addISORegSubLangString(language2.ChineseISO_MY)
+	isoISORegString += addISORegSubLangString(language2.ChineseISO_HK)
+	isoISORegString += addISORegSubLangString(language2.ChineseISO_MO)
 
-	isoISORegString += addISORegSubLangString(language.ISO_639_1_Chinese)
-	isoISORegString += addISORegSubLangString(language.ISO_639_1_English)
-	isoISORegString += addISORegSubLangString(language.ISO_639_1_Korean)
-	isoISORegString += addISORegSubLangString(language.ISO_639_1_Japanese)
+	isoISORegString += addISORegSubLangString(language2.ISO_639_1_Chinese)
+	isoISORegString += addISORegSubLangString(language2.ISO_639_1_English)
+	isoISORegString += addISORegSubLangString(language2.ISO_639_1_Korean)
+	isoISORegString += addISORegSubLangString(language2.ISO_639_1_Japanese)
 
-	isoISORegString += addISORegSubLangString(language.ISO_639_2T_Chinese)
-	isoISORegString += addISORegSubLangString(language.ISO_639_2T_English)
-	isoISORegString += addISORegSubLangString(language.ISO_639_2T_Korean)
-	isoISORegString += addISORegSubLangString(language.ISO_639_2T_Japanese)
+	isoISORegString += addISORegSubLangString(language2.ISO_639_2T_Chinese)
+	isoISORegString += addISORegSubLangString(language2.ISO_639_2T_English)
+	isoISORegString += addISORegSubLangString(language2.ISO_639_2T_Korean)
+	isoISORegString += addISORegSubLangString(language2.ISO_639_2T_Japanese)
 
-	isoISORegString += addISORegSubLangString(language.ISO_639_2B_Chinese)
+	isoISORegString += addISORegSubLangString(language2.ISO_639_2B_Chinese)
 
-	isoISORegString += language.RegISORuleEnd
+	isoISORegString += language2.RegISORuleEnd
 
 	return isoISORegString
 }

+ 2 - 1
pkg/language/my_language.go

@@ -1,8 +1,9 @@
 package language
 
 import (
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
 	"strings"
+
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/language"
 )
 
 // LangConverter4Sub_Supplier 语言转换器,给字幕的提供者实例解析使用(xunlei、zimuku等)

+ 2 - 2
pkg/language/whatlanggo.go

@@ -2,8 +2,8 @@ package language
 
 import (
 	"github.com/abadojack/whatlanggo"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
 )
 
 // WhichChineseType 是简体中文(1)还是繁体中文(2),如果都不是,那么是 0

+ 3 - 2
pkg/log_helper/log_hub.go

@@ -8,8 +8,9 @@ import (
 	"sync"
 	"time"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/log_hub"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/log_hub"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/global_value"
 	"github.com/huandu/go-clone"
 	"github.com/sirupsen/logrus"

+ 41 - 40
pkg/logic/emby_helper/embyhelper.go

@@ -9,10 +9,11 @@ import (
 	"sync"
 	"time"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types"
-	common2 "github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/emby"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	emby2 "github.com/allanpk716/ChineseSubFinder/pkg/types/emby"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+
 	embyHelper "github.com/allanpk716/ChineseSubFinder/pkg/emby_api"
 	"github.com/allanpk716/ChineseSubFinder/pkg/imdb_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
@@ -41,14 +42,14 @@ func NewEmbyHelper(_log *logrus.Logger, _settings *settings.Settings) *EmbyHelpe
 }
 
 // GetRecentlyAddVideoListWithNoChineseSubtitle 获取最近新添加的视频,且没有中文字幕的
-func (em *EmbyHelper) GetRecentlyAddVideoListWithNoChineseSubtitle(needForcedScanAndDownSub ...bool) ([]emby.EmbyMixInfo, map[string][]emby.EmbyMixInfo, error) {
+func (em *EmbyHelper) GetRecentlyAddVideoListWithNoChineseSubtitle(needForcedScanAndDownSub ...bool) ([]emby2.EmbyMixInfo, map[string][]emby2.EmbyMixInfo, error) {
 
 	filterMovieList, filterSeriesList, err := em.GetRecentlyAddVideoList()
 	if err != nil {
 		return nil, nil, err
 	}
-	var noSubMovieList, noSubSeriesList []emby.EmbyMixInfo
-	var seriesMap = make(map[string][]emby.EmbyMixInfo)
+	var noSubMovieList, noSubSeriesList []emby2.EmbyMixInfo
+	var seriesMap = make(map[string][]emby2.EmbyMixInfo)
 
 	if len(needForcedScanAndDownSub) > 0 && needForcedScanAndDownSub[0] == true {
 		// 强制扫描,无需过滤
@@ -70,7 +71,7 @@ func (em *EmbyHelper) GetRecentlyAddVideoListWithNoChineseSubtitle(needForcedSca
 			_, ok := seriesMap[info.VideoFolderName]
 			if ok == false {
 				// 不存在则新建初始化
-				seriesMap[info.VideoFolderName] = make([]emby.EmbyMixInfo, 0)
+				seriesMap[info.VideoFolderName] = make([]emby2.EmbyMixInfo, 0)
 			}
 			seriesMap[info.VideoFolderName] = append(seriesMap[info.VideoFolderName], info)
 		}
@@ -106,7 +107,7 @@ func (em *EmbyHelper) GetRecentlyAddVideoListWithNoChineseSubtitle(needForcedSca
 			_, ok := seriesMap[info.VideoFolderName]
 			if ok == false {
 				// 不存在则新建初始化
-				seriesMap[info.VideoFolderName] = make([]emby.EmbyMixInfo, 0)
+				seriesMap[info.VideoFolderName] = make([]emby2.EmbyMixInfo, 0)
 			}
 			seriesMap[info.VideoFolderName] = append(seriesMap[info.VideoFolderName], info)
 		}
@@ -117,7 +118,7 @@ func (em *EmbyHelper) GetRecentlyAddVideoListWithNoChineseSubtitle(needForcedSca
 }
 
 // GetRecentlyAddVideoList 获取最近新添加的视频
-func (em *EmbyHelper) GetRecentlyAddVideoList() ([]emby.EmbyMixInfo, []emby.EmbyMixInfo, error) {
+func (em *EmbyHelper) GetRecentlyAddVideoList() ([]emby2.EmbyMixInfo, []emby2.EmbyMixInfo, error) {
 	// 获取最近的影片列表
 	items, err := em.EmbyApi.GetRecentlyItems()
 	if err != nil {
@@ -174,7 +175,7 @@ func (em *EmbyHelper) GetVideoIDPlayedMap() map[string]bool {
 
 	videoIDPlayedMap := make(map[string]bool)
 	// 获取有那些用户
-	var userIds emby.EmbyUsers
+	var userIds emby2.EmbyUsers
 	userIds, err := em.EmbyApi.GetUserIdList()
 	if err != nil {
 		em.log.Errorln("IsVideoIDPlayed - GetUserIdList error:", err)
@@ -203,9 +204,9 @@ func (em *EmbyHelper) GetVideoIDPlayedMap() map[string]bool {
 func (em *EmbyHelper) GetPlayedItemsSubtitle() (map[string]string, map[string]string, error) {
 
 	// 这个用户看过那些视频
-	var userPlayedItemsList = make([]emby.UserPlayedItems, 0)
+	var userPlayedItemsList = make([]emby2.UserPlayedItems, 0)
 	// 获取有那些用户
-	var userIds emby.EmbyUsers
+	var userIds emby2.EmbyUsers
 	userIds, err := em.EmbyApi.GetUserIdList()
 	if err != nil {
 		return nil, nil, err
@@ -218,10 +219,10 @@ func (em *EmbyHelper) GetPlayedItemsSubtitle() (map[string]string, map[string]st
 		}
 		// 相同的视频项目,需要判断是否已经看过了,看过的需要排除
 		// 项目是否相同可以通过 Id 判断
-		oneUserPlayedItems := emby.UserPlayedItems{
+		oneUserPlayedItems := emby2.UserPlayedItems{
 			UserName: item.Name,
 			UserID:   item.Id,
-			Items:    make([]emby.EmbyRecentlyItem, 0),
+			Items:    make([]emby2.EmbyRecentlyItem, 0),
 		}
 		for _, recentlyItem := range tmpRecItems.Items {
 
@@ -336,7 +337,7 @@ func (em *EmbyHelper) RefreshEmbySubList() (bool, error) {
 func (em *EmbyHelper) IsVideoPlayed(videoID string) (bool, error) {
 
 	// 获取有那些用户
-	var userIds emby.EmbyUsers
+	var userIds emby2.EmbyUsers
 	userIds, err := em.EmbyApi.GetUserIdList()
 	if err != nil {
 		return false, err
@@ -413,7 +414,7 @@ func (em *EmbyHelper) findMappingPath(fileFPathWithEmby string, isMovieOrSeries
 }
 
 // getVideoIMDBId 从视频的内部 ID 找到 IMDB id
-func (em *EmbyHelper) getMoreVideoInfo(videoID string, isMovieOrSeries bool) (*emby.EmbyMixInfo, error) {
+func (em *EmbyHelper) getMoreVideoInfo(videoID string, isMovieOrSeries bool) (*emby2.EmbyMixInfo, error) {
 
 	if isMovieOrSeries == true {
 		// 电影的情况
@@ -427,7 +428,7 @@ func (em *EmbyHelper) getMoreVideoInfo(videoID string, isMovieOrSeries bool) (*e
 			return nil, err
 		}
 
-		mixInfo := emby.EmbyMixInfo{IMDBId: info.ProviderIds.Imdb, Ancestors: ancs, VideoInfo: info}
+		mixInfo := emby2.EmbyMixInfo{IMDBId: info.ProviderIds.Imdb, Ancestors: ancs, VideoInfo: info}
 
 		return &mixInfo, nil
 	} else {
@@ -465,14 +466,14 @@ func (em *EmbyHelper) getMoreVideoInfo(videoID string, isMovieOrSeries bool) (*e
 			return nil, err
 		}
 
-		mixInfo := emby.EmbyMixInfo{IMDBId: nowSeriesIMDBID, Ancestors: ancs, VideoInfo: info}
+		mixInfo := emby2.EmbyMixInfo{IMDBId: nowSeriesIMDBID, Ancestors: ancs, VideoInfo: info}
 
 		return &mixInfo, nil
 	}
 }
 
 // 根据 IMDB ID 自动转换路径
-func (em *EmbyHelper) autoFindMappingPathWithMixInfoByIMDBId(mixInfo *emby.EmbyMixInfo, isMovieOrSeries bool) bool {
+func (em *EmbyHelper) autoFindMappingPathWithMixInfoByIMDBId(mixInfo *emby2.EmbyMixInfo, isMovieOrSeries bool) bool {
 
 	if mixInfo.IMDBId == "" {
 		em.log.Debugln("autoFindMappingPathWithMixInfoByIMDBId", " mixInfo.IMDBId == \"\"")
@@ -483,7 +484,7 @@ func (em *EmbyHelper) autoFindMappingPathWithMixInfoByIMDBId(mixInfo *emby.EmbyM
 	localIMDBInfo, err := imdb_helper.GetVideoIMDBInfoFromLocal(em.log, types.VideoNfoInfo{ImdbId: mixInfo.IMDBId}, true)
 	if err != nil {
 
-		if errors.Is(err, common2.SkipCreateInDB) == true {
+		if errors.Is(err, common.SkipCreateInDB) == true {
 			em.log.Debugln("autoFindMappingPathWithMixInfoByIMDBId.GetVideoIMDBInfoFromLocal", err)
 			return false
 		}
@@ -513,11 +514,11 @@ func (em *EmbyHelper) autoFindMappingPathWithMixInfoByIMDBId(mixInfo *emby.EmbyM
 			// 这个就是蓝光了
 			// 先替换再拼接,不然会出现拼接完成后,在 Windows 下会把 /mnt/share1/电影 变为这样了 \mnt\share1\电影\失控玩家 (2021)\失控玩家 (2021).mp4
 			videoReplacedDirFPath := strings.ReplaceAll(mixInfo.VideoInfo.Path, mixInfo.VideoInfo.Path, localIMDBInfo.RootDirPath)
-			fakeVideoFPath := filepath.Join(videoReplacedDirFPath, filepath.Base(mixInfo.VideoInfo.Path)+common2.VideoExtMp4)
+			fakeVideoFPath := filepath.Join(videoReplacedDirFPath, filepath.Base(mixInfo.VideoInfo.Path)+common.VideoExtMp4)
 			mixInfo.PhysicalVideoFileFullPath = strings.ReplaceAll(fakeVideoFPath, filepath.Dir(mixInfo.VideoInfo.Path), localIMDBInfo.RootDirPath)
 			// 这个电影的文件夹
 			mixInfo.VideoFolderName = filepath.Base(mixInfo.VideoInfo.Path)
-			mixInfo.VideoFileName = filepath.Base(mixInfo.VideoInfo.Path) + common2.VideoExtMp4
+			mixInfo.VideoFileName = filepath.Base(mixInfo.VideoInfo.Path) + common.VideoExtMp4
 		} else {
 			// 常规的电影情况,也就是有一个具体的视频文件 .mp4 or .mkv
 			// 在 Windows 下,如果操作 linux 的路径 /mnt/abc/123 filepath.Dir 那么得到的是 \mnt\abc
@@ -559,7 +560,7 @@ func (em *EmbyHelper) autoFindMappingPathWithMixInfoByIMDBId(mixInfo *emby.EmbyM
 // findMappingPathWithMixInfo 从 Emby 内置路径匹配到物理路径
 // X:\电影    - /mnt/share1/电影
 // X:\连续剧  - /mnt/share1/连续剧
-func (em *EmbyHelper) findMappingPathWithMixInfo(mixInfo *emby.EmbyMixInfo, isMovieOrSeries bool) bool {
+func (em *EmbyHelper) findMappingPathWithMixInfo(mixInfo *emby2.EmbyMixInfo, isMovieOrSeries bool) bool {
 
 	defer func() {
 		// 见 https://github.com/allanpk716/ChineseSubFinder/issues/278
@@ -635,11 +636,11 @@ func (em *EmbyHelper) findMappingPathWithMixInfo(mixInfo *emby.EmbyMixInfo, isMo
 			// 这个就是蓝光了
 			// 先替换再拼接,不然会出现拼接完成后,在 Windows 下会把 /mnt/share1/电影 变为这样了 \mnt\share1\电影\失控玩家 (2021)\失控玩家 (2021).mp4
 			videoReplacedDirFPath := strings.ReplaceAll(mixInfo.VideoInfo.Path, pathSlices[0].Path, nowPhRootPath)
-			fakeVideoFPath := filepath.Join(videoReplacedDirFPath, filepath.Base(mixInfo.VideoInfo.Path)+common2.VideoExtMp4)
+			fakeVideoFPath := filepath.Join(videoReplacedDirFPath, filepath.Base(mixInfo.VideoInfo.Path)+common.VideoExtMp4)
 			mixInfo.PhysicalVideoFileFullPath = strings.ReplaceAll(fakeVideoFPath, pathSlices[0].Path, nowPhRootPath)
 			// 这个电影的文件夹
 			mixInfo.VideoFolderName = filepath.Base(mixInfo.VideoInfo.Path)
-			mixInfo.VideoFileName = filepath.Base(mixInfo.VideoInfo.Path) + common2.VideoExtMp4
+			mixInfo.VideoFileName = filepath.Base(mixInfo.VideoInfo.Path) + common.VideoExtMp4
 		} else {
 			// 常规的电影情况,也就是有一个具体的视频文件 .mp4 or .mkv
 			mixInfo.PhysicalVideoFileFullPath = strings.ReplaceAll(mixInfo.VideoInfo.Path, pathSlices[0].Path, nowPhRootPath)
@@ -676,11 +677,11 @@ func (em *EmbyHelper) findMappingPathWithMixInfo(mixInfo *emby.EmbyMixInfo, isMo
 }
 
 // getMoreVideoInfoList 把视频的更多信息查询出来,需要并发去做
-func (em *EmbyHelper) getMoreVideoInfoList(videoIdList []string, isMovieOrSeries bool) ([]emby.EmbyMixInfo, error) {
-	var filterVideoEmbyInfo = make([]emby.EmbyMixInfo, 0)
+func (em *EmbyHelper) getMoreVideoInfoList(videoIdList []string, isMovieOrSeries bool) ([]emby2.EmbyMixInfo, error) {
+	var filterVideoEmbyInfo = make([]emby2.EmbyMixInfo, 0)
 
 	// 这个方法是使用两边的路径映射表来实现的转换,使用的体验不佳,很多人搞不定
-	queryFuncByMatchPath := func(m string) (*emby.EmbyMixInfo, error) {
+	queryFuncByMatchPath := func(m string) (*emby2.EmbyMixInfo, error) {
 
 		oneMixInfo, err := em.getMoreVideoInfo(m, isMovieOrSeries)
 		if err != nil {
@@ -793,10 +794,10 @@ func (em *EmbyHelper) getMoreVideoInfoList(videoIdList []string, isMovieOrSeries
 }
 
 // filterNoChineseSubVideoList 将没有中文字幕的视频找出来
-func (em *EmbyHelper) filterNoChineseSubVideoList(videoList []emby.EmbyMixInfo) ([]emby.EmbyMixInfo, error) {
+func (em *EmbyHelper) filterNoChineseSubVideoList(videoList []emby2.EmbyMixInfo) ([]emby2.EmbyMixInfo, error) {
 	currentTime := time.Now()
 
-	var noSubVideoList = make([]emby.EmbyMixInfo, 0)
+	var noSubVideoList = make([]emby2.EmbyMixInfo, 0)
 	// TODO 这里有一种情况需要考虑的,如果内置有中文的字幕,那么是否需要跳过,目前暂定的一定要有外置的字幕
 	for _, info := range videoList {
 
@@ -865,7 +866,7 @@ func (em *EmbyHelper) filterNoChineseSubVideoList(videoList []emby.EmbyMixInfo)
 }
 
 // GetInternalEngSubAndExChineseEnglishSub 获取对应 videoId 的内置英文字幕,外置中文字幕(只要是带有中文的都算,简体、繁体、简英、繁英,需要后续额外的判断)字幕
-func (em *EmbyHelper) GetInternalEngSubAndExChineseEnglishSub(videoId string) (bool, []emby.SubInfo, []emby.SubInfo, error) {
+func (em *EmbyHelper) GetInternalEngSubAndExChineseEnglishSub(videoId string) (bool, []emby2.SubInfo, []emby2.SubInfo, error) {
 
 	// 先刷新以下这个资源,避免找到的字幕不存在了
 	err := em.EmbyApi.UpdateVideoSubList(videoId)
@@ -902,9 +903,9 @@ func (em *EmbyHelper) GetInternalEngSubAndExChineseEnglishSub(videoId string) (b
 	}
 	// 再内置英文字幕能找到的前提下,就可以先找中文的外置字幕,目前版本只能考虑双语字幕
 	// 内置英文字幕,这里把 srt 和 ass 的都导出来
-	var inSubList = make([]emby.SubInfo, 0)
+	var inSubList = make([]emby2.SubInfo, 0)
 	// 外置中文双语字幕
-	var exSubList = make([]emby.SubInfo, 0)
+	var exSubList = make([]emby2.SubInfo, 0)
 	tmpFileNameWithOutExt := ""
 	for _, stream := range videoInfo.MediaStreams {
 		// 首先找到外置的字幕文件
@@ -918,7 +919,7 @@ func (em *EmbyHelper) GetInternalEngSubAndExChineseEnglishSub(videoId string) (b
 				//tmpFileName = strings.ReplaceAll(tmpFileName, subparser.Sub_Ext_Mark_Default, "")
 				//tmpFileName = strings.ReplaceAll(tmpFileName, subparser.Sub_Ext_Mark_Forced, "")
 				tmpFileNameWithOutExt = strings.ReplaceAll(tmpFileName, path.Ext(tmpFileName), "")
-				exSubList = append(exSubList, *emby.NewSubInfo(tmpFileNameWithOutExt+"."+stream.Codec, "."+stream.Codec, stream.Index))
+				exSubList = append(exSubList, *emby2.NewSubInfo(tmpFileNameWithOutExt+"."+stream.Codec, "."+stream.Codec, stream.Index))
 			} else {
 				continue
 			}
@@ -945,7 +946,7 @@ func (em *EmbyHelper) GetInternalEngSubAndExChineseEnglishSub(videoId string) (b
 		var tmpSubContentLenList = make([]int, 0)
 		for _, index := range insideEngSUbIndexList {
 			// TODO 这里默认是去 Emby 去拿字幕,但是其实可以缓存在视频文件同级的目录下,这样后续就无需多次下载了,毕竟每次下载都需要读取完整的视频
-			subFileData, err := em.EmbyApi.GetSubFileData(videoId, mediaSourcesId, fmt.Sprintf("%d", index), common2.SubExtSRT)
+			subFileData, err := em.EmbyApi.GetSubFileData(videoId, mediaSourcesId, fmt.Sprintf("%d", index), common.SubExtSRT)
 			if err != nil {
 				return false, nil, nil, err
 			}
@@ -961,15 +962,15 @@ func (em *EmbyHelper) GetInternalEngSubAndExChineseEnglishSub(videoId string) (b
 	}
 	// 这里才是下载最佳的那个字幕
 	for i := 0; i < 2; i++ {
-		tmpExt := common2.SubExtSRT
+		tmpExt := common.SubExtSRT
 		if i == 1 {
-			tmpExt = common2.SubExtASS
+			tmpExt = common.SubExtASS
 		}
 		subFileData, err := em.EmbyApi.GetSubFileData(videoId, mediaSourcesId, fmt.Sprintf("%d", InsideEngSubIndex), tmpExt)
 		if err != nil {
 			return false, nil, nil, err
 		}
-		tmpInSubInfo := emby.NewSubInfo(videoFileNameWithOutExt+tmpExt, tmpExt, InsideEngSubIndex)
+		tmpInSubInfo := emby2.NewSubInfo(videoFileNameWithOutExt+tmpExt, tmpExt, InsideEngSubIndex)
 		tmpInSubInfo.Content = []byte(subFileData)
 		inSubList = append(inSubList, *tmpInSubInfo)
 	}
@@ -1059,7 +1060,7 @@ type InputData struct {
 }
 
 type OutData struct {
-	Info *emby.EmbyMixInfo
+	Info *emby2.EmbyMixInfo
 	Err  error
 }
 

+ 3 - 2
pkg/logic/file_downloader/downloader_hub.go

@@ -5,14 +5,15 @@ import (
 	"fmt"
 	"path/filepath"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/ass"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/srt"
 	"github.com/allanpk716/ChineseSubFinder/pkg/sub_parser_hub"
 
 	"github.com/allanpk716/ChineseSubFinder/pkg/random_auth_key"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
 	"github.com/allanpk716/ChineseSubFinder/pkg/cache_center"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"

+ 1 - 1
pkg/logic/mark_system/markingsystem.go

@@ -1,11 +1,11 @@
 package mark_system
 
 import (
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/ass"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/srt"
 	"github.com/allanpk716/ChineseSubFinder/pkg/sub_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/sub_parser_hub"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
 	"github.com/sirupsen/logrus"
 )
 

+ 4 - 3
pkg/logic/movie_helper/moviehelper.go

@@ -6,12 +6,13 @@ import (
 	"strings"
 	"time"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/ifaces"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/ass"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/srt"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/ifaces"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/imdb_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"

+ 2 - 1
pkg/logic/pre_download_process/pre_download_proces.go

@@ -5,6 +5,8 @@ import (
 	"fmt"
 	"time"
 
+	common2 "github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/file_downloader"
 	subSupplier "github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_supplier"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_supplier/a4k"
@@ -16,7 +18,6 @@ import (
 
 	"github.com/allanpk716/ChineseSubFinder/pkg/global_value"
 
-	common2 "github.com/allanpk716/ChineseSubFinder/internal/types/common"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_folder"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/notify_center"

+ 3 - 2
pkg/logic/pre_job/pro_job.go

@@ -3,8 +3,9 @@ package pre_job
 import (
 	"errors"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types"
-	common2 "github.com/allanpk716/ChineseSubFinder/internal/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types"
+	common2 "github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/hot_fix"
 	"github.com/allanpk716/ChineseSubFinder/pkg/rod_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"

+ 8 - 7
pkg/logic/scan_played_video_subinfo/scan_played_video_subinfo.go

@@ -8,16 +8,17 @@ import (
 	"strings"
 	"sync"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/ifaces"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types"
+	common2 "github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+
 	embyHelper "github.com/allanpk716/ChineseSubFinder/pkg/logic/emby_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/file_downloader"
 
 	"github.com/allanpk716/ChineseSubFinder/pkg/mix_media_info"
 
 	"github.com/allanpk716/ChineseSubFinder/internal/dao"
-	"github.com/allanpk716/ChineseSubFinder/internal/ifaces"
 	"github.com/allanpk716/ChineseSubFinder/internal/models"
-	"github.com/allanpk716/ChineseSubFinder/internal/types"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/imdb_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/language"
@@ -199,7 +200,7 @@ func (s *ScanPlayedVideoSubInfo) Scan() error {
 		s.imdbInfoCache = make(map[string]*models.IMDBInfo)
 		// -----------------------------------------------------
 		// 并发控制
-		s.taskControl.SetCtxProcessFunc("ScanSubPlayedPool", s.scan, common.ScanPlayedSubTimeOut)
+		s.taskControl.SetCtxProcessFunc("ScanSubPlayedPool", s.scan, common2.ScanPlayedSubTimeOut)
 		// -----------------------------------------------------
 
 		err := s.taskControl.Invoke(&task_control.TaskData{
@@ -273,13 +274,13 @@ func (s *ScanPlayedVideoSubInfo) Scan() error {
 				}
 
 				IsMovie := false
-				videoTypes := common.Movie
+				videoTypes := common2.Movie
 				if bFoundMovie == true {
-					videoTypes = common.Movie
+					videoTypes = common2.Movie
 					IsMovie = true
 				}
 				if bFoundSeries == true {
-					videoTypes = common.Series
+					videoTypes = common2.Series
 					IsMovie = false
 				}
 

+ 6 - 5
pkg/logic/series_helper/seriesHelper.go

@@ -5,15 +5,16 @@ import (
 	"strconv"
 	"time"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/ifaces"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/emby"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/series"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/ass"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/srt"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/ifaces"
 	"github.com/allanpk716/ChineseSubFinder/internal/models"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/emby"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/series"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/imdb_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"

+ 2 - 1
pkg/logic/sub_parser/ass/ass.go

@@ -5,7 +5,8 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/language"
 	"github.com/allanpk716/ChineseSubFinder/pkg/regex_things"
 	"github.com/emirpasic/gods/maps/treemap"

+ 2 - 1
pkg/logic/sub_parser/ass/ass_test.go

@@ -4,7 +4,8 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/log_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/unit_test_helper"
 )

+ 2 - 1
pkg/logic/sub_parser/srt/srt.go

@@ -6,7 +6,8 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/language"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/regex_things"

+ 2 - 1
pkg/logic/sub_parser/srt/srt_test.go

@@ -5,7 +5,8 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+
 	lan "github.com/allanpk716/ChineseSubFinder/pkg/language"
 	"github.com/allanpk716/ChineseSubFinder/pkg/log_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/unit_test_helper"

+ 4 - 3
pkg/logic/sub_supplier/a4k/a4k.go

@@ -7,6 +7,10 @@ import (
 	"strings"
 	"time"
 
+	common2 "github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/series"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
+
 	"github.com/Tnze/go.num/v2/zh"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/file_downloader"
 	"github.com/allanpk716/ChineseSubFinder/pkg/mix_media_info"
@@ -17,9 +21,6 @@ import (
 
 	"github.com/PuerkitoBio/goquery"
 
-	common2 "github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/series"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"
 	"github.com/sirupsen/logrus"

+ 3 - 3
pkg/logic/sub_supplier/assrt/assrt.go

@@ -4,6 +4,9 @@ import (
 	"encoding/json"
 	"errors"
 	"fmt"
+	common2 "github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/series"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
 	"net/url"
 	"os"
 	"path/filepath"
@@ -16,9 +19,6 @@ import (
 
 	"github.com/allanpk716/ChineseSubFinder/pkg/mix_media_info"
 
-	common2 "github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/series"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_folder"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/notify_center"

+ 5 - 4
pkg/logic/sub_supplier/csf/csf.go

@@ -10,9 +10,13 @@ import (
 	"strings"
 	"time"
 
+	common2 "github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/series"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/file_downloader"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_folder"
 
 	"github.com/allanpk716/ChineseSubFinder/pkg/subtitle_best_api"
@@ -23,9 +27,6 @@ import (
 
 	"github.com/allanpk716/ChineseSubFinder/pkg/mix_media_info"
 
-	common2 "github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/series"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"
 	"github.com/sirupsen/logrus"
 )

+ 8 - 7
pkg/logic/sub_supplier/shooter/shooter.go

@@ -9,9 +9,10 @@ import (
 	"path/filepath"
 	"time"
 
-	common2 "github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/series"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/series"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/file_downloader"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
@@ -33,7 +34,7 @@ func NewSupplier(fileDownloader *file_downloader.FileDownloader) *Supplier {
 	sup := Supplier{}
 	sup.log = fileDownloader.Log
 	sup.fileDownloader = fileDownloader
-	sup.topic = common2.DownloadSubsPerSite
+	sup.topic = common.DownloadSubsPerSite
 	sup.isAlive = true // 默认是可以使用的,如果 check 后,再调整状态
 
 	sup.settings = fileDownloader.Settings
@@ -81,7 +82,7 @@ func (s *Supplier) GetSettings() *settings.Settings {
 }
 
 func (s *Supplier) GetSupplierName() string {
-	return common2.SubSiteShooter
+	return common.SubSiteShooter
 }
 
 func (s *Supplier) GetSubListFromFile4Movie(filePath string) ([]supplier.SubInfo, error) {
@@ -129,7 +130,7 @@ func (s *Supplier) getSubListFromFile(filePath string) ([]supplier.SubInfo, erro
 		return nil, err
 	}
 	if hash == "" {
-		return nil, common2.ShooterFileHashIsEmpty
+		return nil, common.ShooterFileHashIsEmpty
 	}
 
 	videoFileName := filepath.Base(filePath)
@@ -202,7 +203,7 @@ func ComputeFileHash(filePath string) (string, error) {
 	}
 	size := float64(stat.Size())
 	if size < 0xF000 {
-		return "", common2.VideoFileIsTooSmall
+		return "", common.VideoFileIsTooSmall
 	}
 	samplePositions := [4]int64{
 		4 * 1024,

+ 5 - 4
pkg/logic/sub_supplier/subSupplierHub.go

@@ -3,10 +3,11 @@ package sub_supplier
 import (
 	"path/filepath"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/ifaces"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/backend"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/emby"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/series"
+	"github.com/allanpk716/ChineseSubFinder/pkg/ifaces"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/backend"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/emby"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/series"
+
 	movieHelper "github.com/allanpk716/ChineseSubFinder/pkg/logic/movie_helper"
 	seriesHelper "github.com/allanpk716/ChineseSubFinder/pkg/logic/series_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/settings"

+ 16 - 15
pkg/logic/sub_supplier/subhd/subhd.go

@@ -13,6 +13,11 @@ import (
 	"strings"
 	"time"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/series"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/file_downloader"
 	"github.com/allanpk716/ChineseSubFinder/pkg/rod_helper"
 
@@ -20,10 +25,6 @@ import (
 
 	"github.com/PuerkitoBio/goquery"
 	"github.com/Tnze/go.num/v2/zh"
-	common2 "github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/series"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/global_value"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
@@ -52,7 +53,7 @@ func NewSupplier(fileDownloader *file_downloader.FileDownloader) *Supplier {
 	sup := Supplier{}
 	sup.log = fileDownloader.Log
 	sup.fileDownloader = fileDownloader
-	sup.topic = common2.DownloadSubsPerSite
+	sup.topic = common.DownloadSubsPerSite
 
 	sup.settings = fileDownloader.Settings
 	if sup.settings.AdvancedSettings.Topic > 0 && sup.settings.AdvancedSettings.Topic != sup.topic {
@@ -61,10 +62,10 @@ func NewSupplier(fileDownloader *file_downloader.FileDownloader) *Supplier {
 	sup.isAlive = true // 默认是可以使用的,如果 check 后,再调整状态
 
 	// 默认超时是 2 * 60s,如果是调试模式则是 5 min
-	sup.tt = common2.BrowserTimeOut
+	sup.tt = common.BrowserTimeOut
 	sup.debugMode = sup.settings.AdvancedSettings.DebugMode
 	if sup.debugMode == true {
-		sup.tt = common2.OneMovieProcessTimeOut
+		sup.tt = common.OneMovieProcessTimeOut
 	}
 
 	return &sup
@@ -127,7 +128,7 @@ func (s *Supplier) GetSettings() *settings.Settings {
 }
 
 func (s *Supplier) GetSupplierName() string {
-	return common2.SubSiteSubHd
+	return common.SubSiteSubHd
 }
 
 func (s *Supplier) GetSubListFromFile4Movie(filePath string) ([]supplier.SubInfo, error) {
@@ -405,7 +406,7 @@ func (s *Supplier) step0(browser *rod.Browser, keyword string) (string, error) {
 		}
 	}()
 
-	result, page, err := rod_helper.HttpGetFromBrowser(browser, fmt.Sprintf(s.settings.AdvancedSettings.SuppliersSettings.SubHD.RootUrl+common2.SubSubHDSearchUrl, url.QueryEscape(keyword)), s.tt)
+	result, page, err := rod_helper.HttpGetFromBrowser(browser, fmt.Sprintf(s.settings.AdvancedSettings.SuppliersSettings.SubHD.RootUrl+common.SubSubHDSearchUrl, url.QueryEscape(keyword)), s.tt)
 	if err != nil {
 		return "", err
 	}
@@ -416,7 +417,7 @@ func (s *Supplier) step0(browser *rod.Browser, keyword string) (string, error) {
 	re := regexp.MustCompile(`共\s*(\d+)\s*条`)
 	matched := re.FindAllStringSubmatch(result, -1)
 	if matched == nil || len(matched) < 1 {
-		return "", common2.SubHDStep0SubCountElementNotFound
+		return "", common.SubHDStep0SubCountElementNotFound
 	}
 	subCount, err := decode.GetNumber2int(matched[0][0])
 	if err != nil {
@@ -436,7 +437,7 @@ func (s *Supplier) step0(browser *rod.Browser, keyword string) (string, error) {
 	if ok == true {
 
 		if len(imgSelection.Nodes) < 1 {
-			return "", common2.SubHDStep0ImgParentLessThan1
+			return "", common.SubHDStep0ImgParentLessThan1
 		}
 		step1Url := ""
 		if imgSelection.Nodes[0].Parent.Data == "a" {
@@ -457,11 +458,11 @@ func (s *Supplier) step0(browser *rod.Browser, keyword string) (string, error) {
 			}
 		}
 		if step1Url == "" {
-			return "", common2.SubHDStep0HrefIsNull
+			return "", common.SubHDStep0HrefIsNull
 		}
 		return step1Url, nil
 	} else {
-		return "", common2.SubHDStep0HrefIsNull
+		return "", common.SubHDStep0HrefIsNull
 	}
 }
 
@@ -618,7 +619,7 @@ func (s *Supplier) downloadSubFile(browser *rod.Browser, page *rod.Page, subDown
 			// 填写“验证码”
 			s.log.Debugln("填写验证码")
 			el := page.MustElement(InputCode)
-			el.MustInput(common2.SubhdCode)
+			el.MustInput(common.SubhdCode)
 			//page.MustEval(`$("#gzhcode").attr("value","` + common2.SubhdCode + `");`)
 			// 是否有“完成验证”按钮
 			s.log.Debugln("查找是否有交验证码按钮1")
@@ -677,7 +678,7 @@ func (s *Supplier) downloadSubFile(browser *rod.Browser, page *rod.Page, subDown
 		return nil, err
 	}
 	if downloadSuccess == false {
-		return nil, common2.SubHDStep2ExCannotFindDownloadBtn
+		return nil, common.SubHDStep2ExCannotFindDownloadBtn
 	}
 	inSubInfo := supplier.NewSubInfo(s.GetSupplierName(), 1, fileName, language.ChineseSimple, subDownloadPageUrl, 0, 0, filepath.Ext(fileName), fileByte)
 

+ 2 - 1
pkg/logic/sub_supplier/subhd/subhd_test.go

@@ -6,10 +6,11 @@ import (
 	"testing"
 	"time"
 
+	commonValue "github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/file_downloader"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/series_helper"
 
-	commonValue "github.com/allanpk716/ChineseSubFinder/internal/types/common"
 	"github.com/allanpk716/ChineseSubFinder/pkg/cache_center"
 	"github.com/allanpk716/ChineseSubFinder/pkg/global_value"
 	"github.com/allanpk716/ChineseSubFinder/pkg/log_helper"

+ 7 - 6
pkg/logic/sub_supplier/xunlei/xunlei.go

@@ -9,9 +9,10 @@ import (
 	"path/filepath"
 	"time"
 
-	common2 "github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/series"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/series"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/language"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/file_downloader"
@@ -35,7 +36,7 @@ func NewSupplier(fileDownloader *file_downloader.FileDownloader) *Supplier {
 	sup := Supplier{}
 	sup.log = fileDownloader.Log
 	sup.fileDownloader = fileDownloader
-	sup.topic = common2.DownloadSubsPerSite
+	sup.topic = common.DownloadSubsPerSite
 	sup.isAlive = true // 默认是可以使用的,如果 check 后,再调整状态
 
 	sup.settings = fileDownloader.Settings
@@ -91,7 +92,7 @@ func (s *Supplier) GetSettings() *settings.Settings {
 }
 
 func (s *Supplier) GetSupplierName() string {
-	return common2.SubSiteXunLei
+	return common.SubSiteXunLei
 }
 
 func (s *Supplier) GetSubListFromFile4Movie(filePath string) ([]supplier.SubInfo, error) {
@@ -135,7 +136,7 @@ func (s *Supplier) getSubListFromFile(filePath string) ([]supplier.SubInfo, erro
 	var tmpXunLeiSubListChinese = make([]SublistXunLei, 0)
 	var outSubList []supplier.SubInfo
 	if len(cid) == 0 {
-		return nil, common2.XunLeiCIdIsEmpty
+		return nil, common.XunLeiCIdIsEmpty
 	}
 
 	jsonList, err = s.getSubInfos(filePath, cid)

+ 16 - 15
pkg/logic/sub_supplier/zimuku/zimuku.go

@@ -11,16 +11,17 @@ import (
 	"strings"
 	"time"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	language2 "github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/series"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/rod_helper"
 
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/file_downloader"
 
 	"github.com/PuerkitoBio/goquery"
 	"github.com/Tnze/go.num/v2/zh"
-	common2 "github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	language2 "github.com/allanpk716/ChineseSubFinder/internal/types/language"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/series"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/global_value"
 	"github.com/allanpk716/ChineseSubFinder/pkg/language"
@@ -48,7 +49,7 @@ func NewSupplier(fileDownloader *file_downloader.FileDownloader) *Supplier {
 	sup := Supplier{}
 	sup.log = fileDownloader.Log
 	sup.fileDownloader = fileDownloader
-	sup.topic = common2.DownloadSubsPerSite
+	sup.topic = common.DownloadSubsPerSite
 	sup.isAlive = true // 默认是可以使用的,如果 check 后,再调整状态
 
 	sup.settings = fileDownloader.Settings
@@ -57,10 +58,10 @@ func NewSupplier(fileDownloader *file_downloader.FileDownloader) *Supplier {
 	}
 
 	// 默认超时是 2 * 60s,如果是调试模式则是 5 min
-	sup.tt = common2.BrowserTimeOut
+	sup.tt = common.BrowserTimeOut
 	sup.debugMode = sup.settings.AdvancedSettings.DebugMode
 	if sup.debugMode == true {
-		sup.tt = common2.OneMovieProcessTimeOut
+		sup.tt = common.OneMovieProcessTimeOut
 	}
 	// 判断是否启用代理
 	sup.httpProxyAddress = sup.settings.AdvancedSettings.ProxySettings.GetLocalHttpProxyUrl()
@@ -126,7 +127,7 @@ func (s *Supplier) GetSettings() *settings.Settings {
 }
 
 func (s *Supplier) GetSupplierName() string {
-	return common2.SubSiteZiMuKu
+	return common.SubSiteZiMuKu
 }
 
 func (s *Supplier) GetSubListFromFile4Movie(filePath string) ([]supplier.SubInfo, error) {
@@ -206,7 +207,7 @@ func (s *Supplier) GetSubListFromFile4Series(seriesInfo *series.SeriesInfo) ([]s
 			if err != nil {
 				s.log.Errorln(s.GetSupplierName(), "step 0", "0 times", "keyword:", keyword, err)
 				// 如果只是搜索不到,则继续换关键词
-				if err != common2.ZiMuKuSearchKeyWordStep0DetailPageUrlNotFound {
+				if err != common.ZiMuKuSearchKeyWordStep0DetailPageUrlNotFound {
 					s.log.Errorln(s.GetSupplierName(), "ZiMuKuSearchKeyWordStep0DetailPageUrlNotFound", keyword, err)
 					continue
 				}
@@ -221,7 +222,7 @@ func (s *Supplier) GetSubListFromFile4Series(seriesInfo *series.SeriesInfo) ([]s
 			if err != nil {
 				s.log.Errorln(s.GetSupplierName(), "step 0", "0 times", "keyword:", keyword, err)
 				// 如果只是搜索不到,则继续换关键词
-				if err != common2.ZiMuKuSearchKeyWordStep0DetailPageUrlNotFound {
+				if err != common.ZiMuKuSearchKeyWordStep0DetailPageUrlNotFound {
 					s.log.Errorln(s.GetSupplierName(), "ZiMuKuSearchKeyWordStep0DetailPageUrlNotFound", keyword, err)
 					continue
 				}
@@ -509,7 +510,7 @@ func (s *Supplier) step0(browser *rod.Browser, keyword string) (string, error) {
 		}
 	}()
 
-	desUrl := fmt.Sprintf(s.settings.AdvancedSettings.SuppliersSettings.Zimuku.RootUrl+common2.SubZiMuKuSearchFormatUrl, url.QueryEscape(keyword))
+	desUrl := fmt.Sprintf(s.settings.AdvancedSettings.SuppliersSettings.Zimuku.RootUrl+common.SubZiMuKuSearchFormatUrl, url.QueryEscape(keyword))
 	result, page, err := rod_helper.HttpGetFromBrowser(browser, desUrl, s.tt)
 	if err != nil {
 		return "", err
@@ -521,7 +522,7 @@ func (s *Supplier) step0(browser *rod.Browser, keyword string) (string, error) {
 	re := regexp.MustCompile(`<p\s+class="tt\s+clearfix"><a\s+href="(/subs/[\w]+\.html)"\s+target="_blank"><b>(.*?)</b></a></p>`)
 	matched := re.FindAllStringSubmatch(result, -1)
 	if matched == nil || len(matched) < 1 {
-		return "", common2.ZiMuKuSearchKeyWordStep0DetailPageUrlNotFound
+		return "", common.ZiMuKuSearchKeyWordStep0DetailPageUrlNotFound
 	}
 	// 影片的详情界面 url
 	filmDetailPageUrl := matched[0][1]
@@ -654,7 +655,7 @@ func (s *Supplier) step2(browser *rod.Browser, subInfo *SubInfo) error {
 	matched := re.FindAllStringSubmatch(result, -1)
 	if matched == nil || len(matched) == 0 || len(matched[0]) == 0 {
 		s.log.Warnln("Step2,sub download url not found", detailUrl)
-		return common2.ZiMuKuDownloadUrlStep2NotFound
+		return common.ZiMuKuDownloadUrlStep2NotFound
 	}
 	if strings.Contains(matched[0][1], "://") {
 		subInfo.SubDownloadPageUrl = matched[0][1]
@@ -684,7 +685,7 @@ func (s *Supplier) DownFile(browser *rod.Browser, subDownloadPageUrl string, Top
 	matched := re.FindAllStringSubmatch(result, -1)
 	if matched == nil || len(matched) == 0 || len(matched[0]) == 0 {
 		s.log.Debugln("Step3,sub download url not found", subDownloadPageFullUrl)
-		return nil, common2.ZiMuKuDownloadUrlStep3NotFound
+		return nil, common.ZiMuKuDownloadUrlStep3NotFound
 	}
 
 	fileName := ""
@@ -734,7 +735,7 @@ func (s *Supplier) DownFile(browser *rod.Browser, subDownloadPageUrl string, Top
 		return inSubInfo, nil
 	} else {
 		s.log.Debugln("Step3,sub download url not found", subDownloadPageFullUrl)
-		return nil, common2.ZiMuKuDownloadUrlDownFileFailed
+		return nil, common.ZiMuKuDownloadUrlDownFileFailed
 	}
 }
 

+ 2 - 1
pkg/logic/sub_timeline_fixer/SubTimelineFixerHelperEx.go

@@ -5,7 +5,8 @@ import (
 	"math"
 	"os"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/ffmpeg_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/ass"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/srt"

+ 2 - 1
pkg/my_util/util.go

@@ -23,7 +23,8 @@ import (
 	"strings"
 	"time"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/filter"
 	"github.com/allanpk716/ChineseSubFinder/pkg/regex_things"

+ 1 - 1
pkg/settings/advanced_settings.go

@@ -1,8 +1,8 @@
 package settings
 
 import (
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
 	"github.com/allanpk716/ChineseSubFinder/pkg/local_http_proxy_server"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
 )
 
 type AdvancedSettings struct {

+ 3 - 1
pkg/settings/chs_cht_changer.go

@@ -1,6 +1,8 @@
 package settings
 
-import "github.com/allanpk716/ChineseSubFinder/internal/types/language"
+import (
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+)
 
 type ChsChtChanger struct {
 	Enable                 bool `json:"enable"`

+ 1 - 1
pkg/settings/emby_settings.go

@@ -1,7 +1,7 @@
 package settings
 
 import (
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
 )
 
 type EmbySettings struct {

+ 8 - 8
pkg/settings/supplier_settings.go

@@ -1,7 +1,7 @@
 package settings
 
 import (
-	common2 "github.com/allanpk716/ChineseSubFinder/internal/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
 )
 
 type SuppliersSettings struct {
@@ -16,13 +16,13 @@ type SuppliersSettings struct {
 
 func NewSuppliersSettings() *SuppliersSettings {
 	return &SuppliersSettings{
-		ChineseSubFinder: NewOneSupplierSettings(common2.SubSiteChineseSubFinder, "haha", -1),
-		Xunlei:           NewOneSupplierSettings(common2.SubSiteXunLei, common2.SubXunLeiRootUrlDef, -1),
-		Shooter:          NewOneSupplierSettings(common2.SubSiteShooter, common2.SubShooterRootUrlDef, -1),
-		SubHD:            NewOneSupplierSettings(common2.SubSiteSubHd, common2.SubSubHDRootUrlDef, 20),
-		Zimuku:           NewOneSupplierSettings(common2.SubSiteZiMuKu, common2.SubZiMuKuRootUrlDef, 20),
-		Assrt:            NewOneSupplierSettings(common2.SubSiteAssrt, common2.SubAssrtRootUrlDef, -1),
-		A4k:              NewOneSupplierSettings(common2.SubSiteA4K, common2.SubA4kRootUrlDef, -1),
+		ChineseSubFinder: NewOneSupplierSettings(common.SubSiteChineseSubFinder, "haha", -1),
+		Xunlei:           NewOneSupplierSettings(common.SubSiteXunLei, common.SubXunLeiRootUrlDef, -1),
+		Shooter:          NewOneSupplierSettings(common.SubSiteShooter, common.SubShooterRootUrlDef, -1),
+		SubHD:            NewOneSupplierSettings(common.SubSiteSubHd, common.SubSubHDRootUrlDef, 20),
+		Zimuku:           NewOneSupplierSettings(common.SubSiteZiMuKu, common.SubZiMuKuRootUrlDef, 20),
+		Assrt:            NewOneSupplierSettings(common.SubSiteAssrt, common.SubAssrtRootUrlDef, -1),
+		A4k:              NewOneSupplierSettings(common.SubSiteA4K, common.SubA4kRootUrlDef, -1),
 	}
 }
 

+ 2 - 1
pkg/something_static/something_static.go

@@ -8,9 +8,10 @@ import (
 	"path/filepath"
 	"time"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/file_downloader"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/sirupsen/logrus"
 )

+ 2 - 1
pkg/sub_file_hash/sub_file_hash.go

@@ -7,7 +7,8 @@ import (
 	"math"
 	"os"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 )
 

+ 12 - 11
pkg/sub_formatter/emby/emby.go

@@ -5,8 +5,9 @@ import (
 	"regexp"
 	"strings"
 
-	language2 "github.com/allanpk716/ChineseSubFinder/internal/types/language"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
+	language3 "github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/language"
 	"github.com/allanpk716/ChineseSubFinder/pkg/sub_formatter/common"
 )
@@ -28,7 +29,7 @@ func (f Formatter) GetFormatterFormatterName() int {
 }
 
 // IsMatchThisFormat 是否满足当前实现接口的字幕命名格式 - 是否符合规则、fileNameWithOutExt string, subExt string, subLang types.MyLanguage, extraSubPreName string
-func (f Formatter) IsMatchThisFormat(subName string) (bool, string, string, language2.MyLanguage, string) {
+func (f Formatter) IsMatchThisFormat(subName string) (bool, string, string, language3.MyLanguage, string) {
 	/*
 		Emby 的命名规则比较特殊,而且本程序就是做中文字幕下载的,所以,下面的正则表达式比较特殊
 	*/
@@ -40,9 +41,9 @@ func (f Formatter) IsMatchThisFormat(subName string) (bool, string, string, lang
 		[0][2]	.ass
 	*/
 	if matched == nil || len(matched) < 1 || len(matched[0]) < 3 {
-		return false, "", "", language2.Unknown, ""
+		return false, "", "", language3.Unknown, ""
 	}
-	var subLang language2.MyLanguage
+	var subLang language3.MyLanguage
 	var subLangStr string
 	var extraSubPreName string
 	fileNameWithOutExt := strings.ReplaceAll(subName, matched[0][0], "")
@@ -51,7 +52,7 @@ func (f Formatter) IsMatchThisFormat(subName string) (bool, string, string, lang
 	if strings.Contains(midString, ",") == true {
 		tmps := strings.Split(midString, ",")
 		if len(tmps) < 2 {
-			return false, "", "", language2.Unknown, ""
+			return false, "", "", language3.Unknown, ""
 		}
 		subLangStr = tmps[0]
 		extraSubPreName = tmps[1]
@@ -65,7 +66,7 @@ func (f Formatter) IsMatchThisFormat(subName string) (bool, string, string, lang
 }
 
 // GenerateMixSubName 通过视频和字幕信息,生成当前实现接口的字幕命名格式。extraSubPreName 一般是填写字幕网站,不填写则留空 - 新名称、新名称带有 default 标记,新名称带有 forced 标记
-func (f Formatter) GenerateMixSubName(videoFileName, subExt string, subLang language2.MyLanguage, extraSubPreName string) (string, string, string) {
+func (f Formatter) GenerateMixSubName(videoFileName, subExt string, subLang language3.MyLanguage, extraSubPreName string) (string, string, string) {
 	/*
 		这里会生成类似的文件名 xxxx.chinese(中英,shooter)
 	*/
@@ -74,7 +75,7 @@ func (f Formatter) GenerateMixSubName(videoFileName, subExt string, subLang lang
 	return f.GenerateMixSubNameBase(videoFileNameWithOutExt, subExt, subLang, extraSubPreName)
 }
 
-func (f Formatter) GenerateMixSubNameBase(fileNameWithOutExt, subExt string, subLang language2.MyLanguage, extraSubPreName string) (string, string, string) {
+func (f Formatter) GenerateMixSubNameBase(fileNameWithOutExt, subExt string, subLang language3.MyLanguage, extraSubPreName string) (string, string, string) {
 	// 这里传入字幕后缀名的时候,可能会带有 default 或者 forced 字段,需要剔除
 	nowSubExt := strings.ReplaceAll(subExt, subparser.Sub_Ext_Mark_Default, "")
 	nowSubExt = strings.ReplaceAll(nowSubExt, subparser.Sub_Ext_Mark_Forced, "")
@@ -84,9 +85,9 @@ func (f Formatter) GenerateMixSubNameBase(fileNameWithOutExt, subExt string, sub
 		note = "," + extraSubPreName
 	}
 
-	subNewName := fileNameWithOutExt + language2.Emby_chinese + "(" + language.Lang2ChineseString(subLang) + note + ")" + nowSubExt
-	subNewNameWithDefault := fileNameWithOutExt + language2.Emby_chinese + "(" + language.Lang2ChineseString(subLang) + note + ")" + subparser.Sub_Ext_Mark_Default + nowSubExt
-	subNewNameWithForced := fileNameWithOutExt + language2.Emby_chinese + "(" + language.Lang2ChineseString(subLang) + note + ")" + subparser.Sub_Ext_Mark_Forced + nowSubExt
+	subNewName := fileNameWithOutExt + language3.Emby_chinese + "(" + language.Lang2ChineseString(subLang) + note + ")" + nowSubExt
+	subNewNameWithDefault := fileNameWithOutExt + language3.Emby_chinese + "(" + language.Lang2ChineseString(subLang) + note + ")" + subparser.Sub_Ext_Mark_Default + nowSubExt
+	subNewNameWithForced := fileNameWithOutExt + language3.Emby_chinese + "(" + language.Lang2ChineseString(subLang) + note + ")" + subparser.Sub_Ext_Mark_Forced + nowSubExt
 
 	return subNewName, subNewNameWithDefault, subNewNameWithForced
 }

+ 3 - 2
pkg/sub_formatter/emby/emby_test.go

@@ -3,8 +3,9 @@ package emby
 import (
 	"testing"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+
 	subCommon "github.com/allanpk716/ChineseSubFinder/pkg/sub_formatter/common"
 )
 

+ 11 - 10
pkg/sub_formatter/normal/normal.go

@@ -5,8 +5,9 @@ import (
 	"regexp"
 	"strings"
 
-	languageConst "github.com/allanpk716/ChineseSubFinder/internal/types/language"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
+	language2 "github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/language"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/ass"
 	"github.com/allanpk716/ChineseSubFinder/pkg/logic/sub_parser/srt"
@@ -35,7 +36,7 @@ func (f Formatter) GetFormatterFormatterName() int {
 }
 
 // IsMatchThisFormat 是否满足当前实现接口的字幕命名格式 - 是否符合规则、fileNameWithOutExt string, subExt string, subLang types.MyLanguage, extraSubPreName string
-func (f Formatter) IsMatchThisFormat(subName string) (bool, string, string, languageConst.MyLanguage, string) {
+func (f Formatter) IsMatchThisFormat(subName string) (bool, string, string, language2.MyLanguage, string) {
 	/*
 		Emby 的命名规则比较特殊,而且本程序就是做中文字幕下载的,所以,下面的正则表达式比较特殊
 		见本程序内 internal/types/language/ISOLanguage.go 这里的支持 ISO 规范和中文编码变种
@@ -69,9 +70,9 @@ func (f Formatter) IsMatchThisFormat(subName string) (bool, string, string, lang
 		[0][2]	.ass
 	*/
 	if matched == nil || len(matched) < 1 || len(matched[0]) < 3 {
-		return false, "", "", languageConst.Unknown, ""
+		return false, "", "", language2.Unknown, ""
 	}
-	var subLang languageConst.MyLanguage
+	var subLang language2.MyLanguage
 	var extraSubPreName string
 
 	// replace only applys to basename
@@ -96,7 +97,7 @@ func (f Formatter) IsMatchThisFormat(subName string) (bool, string, string, lang
 }
 
 // GenerateMixSubName 通过视频和字幕信息,生成当前实现接口的字幕命名格式。extraSubPreName 一般是填写字幕网站,不填写则留空 - 新名称、新名称带有 default 标记,新名称带有 forced 标记
-func (f Formatter) GenerateMixSubName(videoFileName, subExt string, subLang languageConst.MyLanguage, extraSubPreName string) (string, string, string) {
+func (f Formatter) GenerateMixSubName(videoFileName, subExt string, subLang language2.MyLanguage, extraSubPreName string) (string, string, string) {
 	/*
 		这里会生成类似的文件名 xxxx.zh
 	*/
@@ -105,14 +106,14 @@ func (f Formatter) GenerateMixSubName(videoFileName, subExt string, subLang lang
 	return f.GenerateMixSubNameBase(videoFileNameWithOutExt, subExt, subLang, extraSubPreName)
 }
 
-func (f Formatter) GenerateMixSubNameBase(fileNameWithOutExt, subExt string, subLang languageConst.MyLanguage, extraSubPreName string) (string, string, string) {
+func (f Formatter) GenerateMixSubNameBase(fileNameWithOutExt, subExt string, subLang language2.MyLanguage, extraSubPreName string) (string, string, string) {
 	// 这里传入字幕后缀名的时候,可能会带有 default 或者 forced 字段,需要剔除
 	nowSubExt := strings.ReplaceAll(subExt, subparser.Sub_Ext_Mark_Default, "")
 	nowSubExt = strings.ReplaceAll(nowSubExt, subparser.Sub_Ext_Mark_Forced, "")
 
-	subNewName := fileNameWithOutExt + "." + languageConst.ISO_639_1_Chinese + nowSubExt
-	subNewNameWithDefault := fileNameWithOutExt + "." + languageConst.ISO_639_1_Chinese + subparser.Sub_Ext_Mark_Default + nowSubExt
-	subNewNameWithForced := fileNameWithOutExt + "." + languageConst.ISO_639_1_Chinese + subparser.Sub_Ext_Mark_Forced + nowSubExt
+	subNewName := fileNameWithOutExt + "." + language2.ISO_639_1_Chinese + nowSubExt
+	subNewNameWithDefault := fileNameWithOutExt + "." + language2.ISO_639_1_Chinese + subparser.Sub_Ext_Mark_Default + nowSubExt
+	subNewNameWithForced := fileNameWithOutExt + "." + language2.ISO_639_1_Chinese + subparser.Sub_Ext_Mark_Forced + nowSubExt
 
 	return subNewName, subNewNameWithDefault, subNewNameWithForced
 }

+ 3 - 2
pkg/sub_formatter/normal/normal_test.go

@@ -4,8 +4,9 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+
 	subCommon "github.com/allanpk716/ChineseSubFinder/pkg/sub_formatter/common"
 )
 

+ 39 - 38
pkg/sub_formatter/old/old.go

@@ -1,11 +1,12 @@
 package old
 
 import (
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/language"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
 	"path/filepath"
 	"strings"
+
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	language2 "github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
 )
 
 /*
@@ -43,22 +44,22 @@ func IsOldVersionSubPrefixName(subFileName string) (bool, string, string) {
 	// 一种的保存了多字幕 SaveMultiSub: true
 	// 先判断 单字幕
 	switch nowExt {
-	case language.Emby_chs:
-		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language.MatchLangChs, subTypeExt, "", true)
-	case language.Emby_cht:
-		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language.MatchLangCht, subTypeExt, "", false)
-	case language.Emby_chs_en:
-		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language.MatchLangChsEn, subTypeExt, "", true)
-	case language.Emby_cht_en:
-		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language.MatchLangChtEn, subTypeExt, "", false)
-	case language.Emby_chs_jp:
-		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language.MatchLangChsJp, subTypeExt, "", true)
-	case language.Emby_cht_jp:
-		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language.MatchLangChtJp, subTypeExt, "", false)
-	case language.Emby_chs_kr:
-		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language.MatchLangChsKr, subTypeExt, "", true)
-	case language.Emby_cht_kr:
-		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language.MatchLangChtKr, subTypeExt, "", false)
+	case language2.Emby_chs:
+		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language2.MatchLangChs, subTypeExt, "", true)
+	case language2.Emby_cht:
+		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language2.MatchLangCht, subTypeExt, "", false)
+	case language2.Emby_chs_en:
+		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language2.MatchLangChsEn, subTypeExt, "", true)
+	case language2.Emby_cht_en:
+		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language2.MatchLangChtEn, subTypeExt, "", false)
+	case language2.Emby_chs_jp:
+		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language2.MatchLangChsJp, subTypeExt, "", true)
+	case language2.Emby_cht_jp:
+		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language2.MatchLangChtJp, subTypeExt, "", false)
+	case language2.Emby_chs_kr:
+		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language2.MatchLangChsKr, subTypeExt, "", true)
+	case language2.Emby_cht_kr:
+		return true, orgMixExt, makeMixSubExtString(orgFileNameWithOutOrgMixExt, language2.MatchLangChtKr, subTypeExt, "", false)
 	}
 	// 再判断 多字幕情况
 	spStrings := strings.Split(nowExt, "[")
@@ -68,25 +69,25 @@ func IsOldVersionSubPrefixName(subFileName string) (bool, string, string) {
 	// 分两段来判断是否符合标准
 	// 第一段
 	firstOk := true
-	lang := language.MatchLangChs
+	lang := language2.MatchLangChs
 	site := ""
 	switch spStrings[0] {
-	case language.Emby_chs:
-		lang = language.MatchLangChs
-	case language.Emby_cht:
-		lang = language.MatchLangCht
-	case language.Emby_chs_en:
-		lang = language.MatchLangChsEn
-	case language.Emby_cht_en:
-		lang = language.MatchLangChtEn
-	case language.Emby_chs_jp:
-		lang = language.MatchLangChsJp
-	case language.Emby_cht_jp:
-		lang = language.MatchLangChtJp
-	case language.Emby_chs_kr:
-		lang = language.MatchLangChsKr
-	case language.Emby_cht_kr:
-		lang = language.MatchLangChtKr
+	case language2.Emby_chs:
+		lang = language2.MatchLangChs
+	case language2.Emby_cht:
+		lang = language2.MatchLangCht
+	case language2.Emby_chs_en:
+		lang = language2.MatchLangChsEn
+	case language2.Emby_cht_en:
+		lang = language2.MatchLangChtEn
+	case language2.Emby_chs_jp:
+		lang = language2.MatchLangChsJp
+	case language2.Emby_cht_jp:
+		lang = language2.MatchLangChtJp
+	case language2.Emby_chs_kr:
+		lang = language2.MatchLangChsKr
+	case language2.Emby_cht_kr:
+		lang = language2.MatchLangChtKr
 	default:
 		firstOk = false
 	}
@@ -120,7 +121,7 @@ func makeMixSubExtString(orgFileNameWithOutExt, lang string, ext, site string, b
 	}
 
 	if site == "" {
-		return orgFileNameWithOutExt + language.Emby_chinese + "(" + lang + ")" + tmpDefault + ext
+		return orgFileNameWithOutExt + language2.Emby_chinese + "(" + lang + ")" + tmpDefault + ext
 	}
-	return orgFileNameWithOutExt + language.Emby_chinese + "(" + lang + "," + site + ")" + tmpDefault + ext
+	return orgFileNameWithOutExt + language2.Emby_chinese + "(" + lang + "," + site + ")" + tmpDefault + ext
 }

+ 4 - 3
pkg/sub_formatter/sub_format_changer.go

@@ -7,11 +7,12 @@ import (
 	"path/filepath"
 	"strings"
 
+	"github.com/allanpk716/ChineseSubFinder/pkg/ifaces"
+	interCommon "github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
+
 	"github.com/allanpk716/ChineseSubFinder/internal/dao"
-	"github.com/allanpk716/ChineseSubFinder/internal/ifaces"
 	"github.com/allanpk716/ChineseSubFinder/internal/models"
-	interCommon "github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
 	movieHelper "github.com/allanpk716/ChineseSubFinder/pkg/logic/movie_helper"
 	seriesHelper "github.com/allanpk716/ChineseSubFinder/pkg/logic/series_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"

+ 3 - 1
pkg/sub_helper/dialogue_merger.go

@@ -1,6 +1,8 @@
 package sub_helper
 
-import "github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
+import (
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
+)
 
 // DialogueMerger 合并分散的对白,目标是搞定英文字幕
 type DialogueMerger struct {

+ 4 - 3
pkg/sub_helper/sub_helper.go

@@ -9,9 +9,10 @@ import (
 	"strings"
 	"time"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/supplier"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/supplier"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/archive_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/decode"
 	"github.com/allanpk716/ChineseSubFinder/pkg/filter"

+ 5 - 4
pkg/sub_parser_hub/subParserHub.go

@@ -6,10 +6,11 @@ import (
 	"regexp"
 	"strings"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/ifaces"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	languageConst "github.com/allanpk716/ChineseSubFinder/internal/types/language"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
+	"github.com/allanpk716/ChineseSubFinder/pkg/ifaces"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	languageConst "github.com/allanpk716/ChineseSubFinder/pkg/types/language"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/filter"
 	"github.com/allanpk716/ChineseSubFinder/pkg/language"
 	"github.com/sirupsen/logrus"

+ 2 - 1
pkg/sub_timeline_fixer/pipeline.go

@@ -8,7 +8,8 @@ import (
 	"strings"
 	"time"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/subparser"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/subparser"
+
 	"github.com/allanpk716/ChineseSubFinder/pkg/gss"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
 	"github.com/allanpk716/ChineseSubFinder/pkg/sub_helper"

+ 30 - 29
pkg/task_queue/get.go

@@ -1,8 +1,9 @@
 package task_queue
 
 import (
-	"github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
 	"time"
+
+	task_queue2 "github.com/allanpk716/ChineseSubFinder/pkg/types/task_queue"
 )
 
 func (t *TaskQueue) BeforeGetOneJob() {
@@ -13,7 +14,7 @@ func (t *TaskQueue) BeforeGetOneJob() {
 	for TaskPriority := 0; TaskPriority <= taskPriorityCount; TaskPriority++ {
 		t.taskPriorityMapList[TaskPriority].Each(func(key interface{}, value interface{}) {
 
-			nowOneJob := value.(task_queue.OneJob)
+			nowOneJob := value.(task_queue2.OneJob)
 			if //nowOneJob.JobStatus == task_queue.Done &&
 			// 默认是 90day, A.After(B) : A > B == true
 			(time.Time)(nowOneJob.UpdateTime).AddDate(0, 0, t.settings.AdvancedSettings.TaskQueue.ExpirationTime).After(time.Now()) == false {
@@ -35,10 +36,10 @@ func (t *TaskQueue) BeforeGetOneJob() {
 }
 
 // GetOneJob 优先获取 GetOneWaitingJob 然后才是 GetOneDoneJob
-func (t *TaskQueue) GetOneJob() (bool, task_queue.OneJob, error) {
+func (t *TaskQueue) GetOneJob() (bool, task_queue2.OneJob, error) {
 	found, waitingJob, err := t.GetOneWaitingJob()
 	if err != nil {
-		return false, task_queue.OneJob{}, err
+		return false, task_queue2.OneJob{}, err
 	}
 	if found == false {
 		return t.GetOneDoneJob()
@@ -48,27 +49,27 @@ func (t *TaskQueue) GetOneJob() (bool, task_queue.OneJob, error) {
 }
 
 // GetOneWaitingJob 获取一个元素,按优先级,0 - taskPriorityCount 的级别去拿去任务,不会移除任务
-func (t *TaskQueue) GetOneWaitingJob() (bool, task_queue.OneJob, error) {
+func (t *TaskQueue) GetOneWaitingJob() (bool, task_queue2.OneJob, error) {
 
 	defer t.queueLock.Unlock()
 	t.queueLock.Lock()
 
 	// 如果队列里面没有东西,则返回 false
 	if t.isEmpty() == true {
-		return false, task_queue.OneJob{}, nil
+		return false, task_queue2.OneJob{}, nil
 	}
 	// 找到需要返回的复合条件的任务
 	found := false
-	tOneJob := task_queue.OneJob{}
+	tOneJob := task_queue2.OneJob{}
 	for TaskPriority := 0; TaskPriority <= taskPriorityCount; TaskPriority++ {
 
 		t.taskPriorityMapList[TaskPriority].Any(func(key interface{}, value interface{}) bool {
 
-			tOneJob = value.(task_queue.OneJob)
+			tOneJob = value.(task_queue2.OneJob)
 			// 任务的 UpdateTime 与现在的时间大于单个字幕下载的间隔
 			// 默认是 12h, A.After(B) : A > B == true
 			// 见《任务队列设计》--以优先级顺序取出描述
-			if tOneJob.JobStatus == task_queue.Waiting && (tOneJob.DownloadTimes == 0 ||
+			if tOneJob.JobStatus == task_queue2.Waiting && (tOneJob.DownloadTimes == 0 ||
 				// 优先级 <= 3 也可以提前取出
 				TaskPriority <= HighTaskPriorityLevel ||
 				// 默认是 12h, A.After(B) : A > B == true
@@ -93,27 +94,27 @@ func (t *TaskQueue) GetOneWaitingJob() (bool, task_queue.OneJob, error) {
 }
 
 // GetOneDoneJob 获取一个元素,按优先级,0 - taskPriorityCount 的级别去拿去任务,不会移除任务
-func (t *TaskQueue) GetOneDoneJob() (bool, task_queue.OneJob, error) {
+func (t *TaskQueue) GetOneDoneJob() (bool, task_queue2.OneJob, error) {
 
 	defer t.queueLock.Unlock()
 	t.queueLock.Lock()
 
 	// 如果队列里面没有东西,则返回 false
 	if t.isEmpty() == true {
-		return false, task_queue.OneJob{}, nil
+		return false, task_queue2.OneJob{}, nil
 	}
 
 	found := false
-	tOneJob := task_queue.OneJob{}
+	tOneJob := task_queue2.OneJob{}
 	for TaskPriority := 0; TaskPriority <= taskPriorityCount; TaskPriority++ {
 
 		t.taskPriorityMapList[TaskPriority].Any(func(key interface{}, value interface{}) bool {
 
-			tOneJob = value.(task_queue.OneJob)
+			tOneJob = value.(task_queue2.OneJob)
 			// 任务的 UpdateTime 与现在的时间大于单个字幕下载的间隔
 			// 默认是 12h, A.After(B) : A > B == true
 			// 见《任务队列设计》--以优先级顺序取出描述
-			if tOneJob.JobStatus == task_queue.Done &&
+			if tOneJob.JobStatus == task_queue2.Done &&
 				// 要在 三个月内
 				(time.Time)(tOneJob.CreatedTime).AddDate(0, 0, t.settings.AdvancedSettings.TaskQueue.ExpirationTime).After(time.Now()) == true &&
 				// 已经下载过的视频,要间隔 12 小时再次下载
@@ -135,12 +136,12 @@ func (t *TaskQueue) GetOneDoneJob() (bool, task_queue.OneJob, error) {
 	return false, tOneJob, nil
 }
 
-func (t *TaskQueue) GetJobsByStatus(status task_queue.JobStatus) (bool, []task_queue.OneJob, error) {
+func (t *TaskQueue) GetJobsByStatus(status task_queue2.JobStatus) (bool, []task_queue2.OneJob, error) {
 
 	defer t.queueLock.Unlock()
 	t.queueLock.Lock()
 
-	outOneJobs := make([]task_queue.OneJob, 0)
+	outOneJobs := make([]task_queue2.OneJob, 0)
 	// 如果队列里面没有东西,则返回 false
 	if t.isEmpty() == true {
 		return false, nil, nil
@@ -150,8 +151,8 @@ func (t *TaskQueue) GetJobsByStatus(status task_queue.JobStatus) (bool, []task_q
 
 		t.taskPriorityMapList[TaskPriority].Each(func(key interface{}, value interface{}) {
 
-			tOneJob := task_queue.OneJob{}
-			tOneJob = value.(task_queue.OneJob)
+			tOneJob := task_queue2.OneJob{}
+			tOneJob = value.(task_queue2.OneJob)
 			if tOneJob.JobStatus == status {
 				// 找到加入列表
 				outOneJobs = append(outOneJobs, tOneJob)
@@ -163,12 +164,12 @@ func (t *TaskQueue) GetJobsByStatus(status task_queue.JobStatus) (bool, []task_q
 }
 
 // GetJobsByPriorityAndStatus 根据任务优先级和状态获取任务列表
-func (t *TaskQueue) GetJobsByPriorityAndStatus(taskPriority int, status task_queue.JobStatus) (bool, []task_queue.OneJob, error) {
+func (t *TaskQueue) GetJobsByPriorityAndStatus(taskPriority int, status task_queue2.JobStatus) (bool, []task_queue2.OneJob, error) {
 
 	defer t.queueLock.Unlock()
 	t.queueLock.Lock()
 
-	outOneJobs := make([]task_queue.OneJob, 0)
+	outOneJobs := make([]task_queue2.OneJob, 0)
 	// 如果队列里面没有东西,则返回 false
 	if t.isEmpty() == true {
 		return false, nil, nil
@@ -176,8 +177,8 @@ func (t *TaskQueue) GetJobsByPriorityAndStatus(taskPriority int, status task_que
 
 	t.taskPriorityMapList[taskPriority].Each(func(key interface{}, value interface{}) {
 
-		tOneJob := task_queue.OneJob{}
-		tOneJob = value.(task_queue.OneJob)
+		tOneJob := task_queue2.OneJob{}
+		tOneJob = value.(task_queue2.OneJob)
 		if tOneJob.JobStatus == status {
 			// 找到加入列表
 			outOneJobs = append(outOneJobs, tOneJob)
@@ -187,12 +188,12 @@ func (t *TaskQueue) GetJobsByPriorityAndStatus(taskPriority int, status task_que
 	return true, outOneJobs, nil
 }
 
-func (t *TaskQueue) GetAllJobs() (bool, []task_queue.OneJob, error) {
+func (t *TaskQueue) GetAllJobs() (bool, []task_queue2.OneJob, error) {
 
 	defer t.queueLock.Unlock()
 	t.queueLock.Lock()
 
-	outOneJobs := make([]task_queue.OneJob, 0)
+	outOneJobs := make([]task_queue2.OneJob, 0)
 	// 如果队列里面没有东西,则返回 false
 	if t.isEmpty() == true {
 		return false, nil, nil
@@ -202,8 +203,8 @@ func (t *TaskQueue) GetAllJobs() (bool, []task_queue.OneJob, error) {
 
 		t.taskPriorityMapList[TaskPriority].Each(func(key interface{}, value interface{}) {
 
-			tOneJob := task_queue.OneJob{}
-			tOneJob = value.(task_queue.OneJob)
+			tOneJob := task_queue2.OneJob{}
+			tOneJob = value.(task_queue2.OneJob)
 			// 找到加入列表
 			outOneJobs = append(outOneJobs, tOneJob)
 		})
@@ -212,12 +213,12 @@ func (t *TaskQueue) GetAllJobs() (bool, []task_queue.OneJob, error) {
 	return true, outOneJobs, nil
 }
 
-func (t *TaskQueue) GetOneJobByID(jobId string) (bool, task_queue.OneJob) {
+func (t *TaskQueue) GetOneJobByID(jobId string) (bool, task_queue2.OneJob) {
 
 	defer t.queueLock.Unlock()
 	t.queueLock.Lock()
 
-	outOneJob := task_queue.OneJob{}
+	outOneJob := task_queue2.OneJob{}
 
 	taskPriority, bok := t.taskKeyMap.Get(jobId)
 	if bok == false {
@@ -228,7 +229,7 @@ func (t *TaskQueue) GetOneJobByID(jobId string) (bool, task_queue.OneJob) {
 	if bok == false {
 		return false, outOneJob
 	}
-	outOneJob = needDelJobObj.(task_queue.OneJob)
+	outOneJob = needDelJobObj.(task_queue2.OneJob)
 
 	return true, outOneJob
 }

+ 20 - 21
pkg/task_queue/task_queue.go

@@ -3,15 +3,14 @@ package task_queue
 import (
 	"encoding/json"
 	"errors"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/emby"
+	task_queue2 "github.com/allanpk716/ChineseSubFinder/pkg/types/task_queue"
 	"os"
 	"path/filepath"
 	"sync"
 	"time"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/emby"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
-	taskQueue2 "github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
 	"github.com/allanpk716/ChineseSubFinder/pkg/cache_center"
 	"github.com/allanpk716/ChineseSubFinder/pkg/global_value"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
@@ -90,7 +89,7 @@ func (t *TaskQueue) Size() int {
 }
 
 // checkPriority 检测优先级,会校验范围
-func (t *TaskQueue) checkPriority(oneJob taskQueue2.OneJob) taskQueue2.OneJob {
+func (t *TaskQueue) checkPriority(oneJob task_queue2.OneJob) task_queue2.OneJob {
 
 	if oneJob.TaskPriority > taskPriorityCount {
 		oneJob.TaskPriority = taskPriorityCount
@@ -104,7 +103,7 @@ func (t *TaskQueue) checkPriority(oneJob taskQueue2.OneJob) taskQueue2.OneJob {
 }
 
 // degrade 降一级,会校验范围
-func (t *TaskQueue) degrade(oneJob taskQueue2.OneJob) taskQueue2.OneJob {
+func (t *TaskQueue) degrade(oneJob task_queue2.OneJob) task_queue2.OneJob {
 
 	oneJob.TaskPriority -= 1
 
@@ -112,7 +111,7 @@ func (t *TaskQueue) degrade(oneJob taskQueue2.OneJob) taskQueue2.OneJob {
 }
 
 // Add 放入元素,放入的时候会根据 TaskPriority 进行归类,存在的不会新增和更新
-func (t *TaskQueue) Add(oneJob task_queue.OneJob) (bool, error) {
+func (t *TaskQueue) Add(oneJob task_queue2.OneJob) (bool, error) {
 
 	defer t.queueLock.Unlock()
 	t.queueLock.Lock()
@@ -148,7 +147,7 @@ func (t *TaskQueue) Add(oneJob task_queue.OneJob) (bool, error) {
 }
 
 // update 更新素,不存在则会失败,内部用,没有锁
-func (t *TaskQueue) update(oneJob task_queue.OneJob) (bool, error) {
+func (t *TaskQueue) update(oneJob task_queue2.OneJob) (bool, error) {
 
 	if t.isExist(oneJob.Id) == false {
 		return false, nil
@@ -183,7 +182,7 @@ func (t *TaskQueue) update(oneJob task_queue.OneJob) (bool, error) {
 }
 
 // Update 更新素,不存在则会失败
-func (t *TaskQueue) Update(oneJob task_queue.OneJob) (bool, error) {
+func (t *TaskQueue) Update(oneJob task_queue2.OneJob) (bool, error) {
 
 	defer t.queueLock.Unlock()
 	t.queueLock.Lock()
@@ -192,7 +191,7 @@ func (t *TaskQueue) Update(oneJob task_queue.OneJob) (bool, error) {
 }
 
 // AutoDetectUpdateJobStatus 根据任务的生命周期图,进行自动判断更新,见《任务的生命周期》流程图
-func (t *TaskQueue) AutoDetectUpdateJobStatus(oneJob task_queue.OneJob, inErr error) {
+func (t *TaskQueue) AutoDetectUpdateJobStatus(oneJob task_queue2.OneJob, inErr error) {
 
 	defer t.queueLock.Unlock()
 	t.queueLock.Lock()
@@ -204,18 +203,18 @@ func (t *TaskQueue) AutoDetectUpdateJobStatus(oneJob task_queue.OneJob, inErr er
 
 		// 如果任务的优先级是 0,那么这个任务就认为是一次性任务,下载完毕不管如何都会设置为 ignore
 		if oneJob.TaskPriority == 0 {
-			oneJob.JobStatus = task_queue.Ignore
+			oneJob.JobStatus = task_queue2.Ignore
 		}
 
 		// 没有错误就是完成
 		oneJob.TaskPriority = DefaultTaskPriorityLevel
-		oneJob.JobStatus = taskQueue2.Done
+		oneJob.JobStatus = task_queue2.Done
 		oneJob.DownloadTimes += 1
 	} else {
 		// 超过了时间限制,默认是 90 天, A.Before(B) : A < B == true
 		if (time.Time)(oneJob.AddedTime).AddDate(0, 0, t.settings.AdvancedSettings.TaskQueue.ExpirationTime).Before(time.Now()) == true {
 			// 超过 90 天了
-			oneJob.JobStatus = taskQueue2.Failed
+			oneJob.JobStatus = task_queue2.Failed
 		} else {
 			// 还在 90 天内
 			// 是否是首次,那么就看它的 Level 是否是在 5,然后 retry == 0
@@ -232,12 +231,12 @@ func (t *TaskQueue) AutoDetectUpdateJobStatus(oneJob task_queue.OneJob, inErr er
 			}
 
 			// 强制为 waiting
-			oneJob.JobStatus = taskQueue2.Waiting
+			oneJob.JobStatus = task_queue2.Waiting
 		}
 
 		// 如果任务的优先级是 0,那么这个任务就认为是一次性任务,下载完毕不管如何都会设置为 ignore
 		if oneJob.TaskPriority == 0 {
-			oneJob.JobStatus = task_queue.Ignore
+			oneJob.JobStatus = task_queue2.Ignore
 		}
 		// 传入的错误需要放进来
 		oneJob.ErrorInfo = inErr.Error()
@@ -274,7 +273,7 @@ func (t *TaskQueue) del(jobId string) (bool, error) {
 	if bok == false {
 		return false, nil
 	}
-	needDelJob := needDelJobObj.(task_queue.OneJob)
+	needDelJob := needDelJobObj.(task_queue2.OneJob)
 	jobSetsObj, bok := t.taskGroupBySeries.Get(needDelJob.SeriesRootDirPath)
 	if bok == false {
 		return false, nil
@@ -337,7 +336,7 @@ func (t *TaskQueue) read() {
 			if err != nil {
 				t.log.Panicln(err)
 			}
-			nowOneJob := task_queue.OneJob{}
+			nowOneJob := task_queue2.OneJob{}
 			err = json.Unmarshal(jsonString, &nowOneJob)
 			if err != nil {
 				t.log.Panicln(err)
@@ -350,7 +349,7 @@ func (t *TaskQueue) read() {
 			// JobID -- taskPriority
 			t.taskKeyMap.Put(key, i)
 			// SeriesRootDirPath -- tree.Set(JobID)
-			oneJob := value.(task_queue.OneJob)
+			oneJob := value.(task_queue2.OneJob)
 			jobIDSet, found := t.taskGroupBySeries.Get(oneJob.SeriesRootDirPath)
 			if found == false {
 				// 不存在
@@ -372,9 +371,9 @@ func (t *TaskQueue) afterRead() {
 	for TaskPriority := 0; TaskPriority <= taskPriorityCount; TaskPriority++ {
 		t.taskPriorityMapList[TaskPriority].Each(func(key interface{}, value interface{}) {
 
-			nowOneJob := value.(task_queue.OneJob)
-			if nowOneJob.JobStatus == task_queue.Downloading {
-				nowOneJob.JobStatus = task_queue.Waiting
+			nowOneJob := value.(task_queue2.OneJob)
+			if nowOneJob.JobStatus == task_queue2.Downloading {
+				nowOneJob.JobStatus = task_queue2.Waiting
 				nowOneJob.DownloadTimes += 1
 				bok, err := t.update(nowOneJob)
 				if err != nil {

+ 18 - 18
pkg/task_queue/task_queue_test.go

@@ -2,10 +2,10 @@ package task_queue
 
 import (
 	"fmt"
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/common"
+	task_queue2 "github.com/allanpk716/ChineseSubFinder/pkg/types/task_queue"
 	"testing"
 
-	"github.com/allanpk716/ChineseSubFinder/internal/types/common"
-	"github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
 	"github.com/allanpk716/ChineseSubFinder/pkg/cache_center"
 	"github.com/allanpk716/ChineseSubFinder/pkg/log_helper"
 	"github.com/allanpk716/ChineseSubFinder/pkg/my_util"
@@ -26,7 +26,7 @@ func TestTaskQueue_AddAndGetAndDel(t *testing.T) {
 		taskQueue.Close()
 	}()
 	for i := taskPriorityCount; i >= 0; i-- {
-		bok, err := taskQueue.Add(*task_queue.NewOneJob(common.Movie, my_util.RandStringBytesMaskImprSrcSB(10), i))
+		bok, err := taskQueue.Add(*task_queue2.NewOneJob(common.Movie, my_util.RandStringBytesMaskImprSrcSB(10), i))
 		if err != nil {
 			t.Fatal("TestTaskQueue.Add", err)
 		}
@@ -35,7 +35,7 @@ func TestTaskQueue_AddAndGetAndDel(t *testing.T) {
 		}
 	}
 
-	bok, waitingJobs, err := taskQueue.GetJobsByStatus(task_queue.Waiting)
+	bok, waitingJobs, err := taskQueue.GetJobsByStatus(task_queue2.Waiting)
 	if err != nil {
 		t.Fatal("TestTaskQueue.Get", err)
 	}
@@ -78,7 +78,7 @@ func TestTaskQueue_AddAndClear(t *testing.T) {
 
 	taskQueue := NewTaskQueue(cache_center.NewCacheCenter(taskQueueName, settings.GetSettings(), log_helper.GetLogger4Tester()))
 	for i := taskPriorityCount; i >= 0; i-- {
-		bok, err := taskQueue.Add(*task_queue.NewOneJob(common.Movie, my_util.RandStringBytesMaskImprSrcSB(10), i))
+		bok, err := taskQueue.Add(*task_queue2.NewOneJob(common.Movie, my_util.RandStringBytesMaskImprSrcSB(10), i))
 		if err != nil {
 			t.Fatal("TestTaskQueue.Add", err)
 		}
@@ -106,7 +106,7 @@ func TestTaskQueue_Update(t *testing.T) {
 
 	taskQueue := NewTaskQueue(cache_center.NewCacheCenter(taskQueueName, settings.GetSettings(), log_helper.GetLogger4Tester()))
 	for i := taskPriorityCount; i >= 0; i-- {
-		bok, err := taskQueue.Add(*task_queue.NewOneJob(common.Movie, my_util.RandStringBytesMaskImprSrcSB(10), i))
+		bok, err := taskQueue.Add(*task_queue2.NewOneJob(common.Movie, my_util.RandStringBytesMaskImprSrcSB(10), i))
 		if err != nil {
 			t.Fatal("TestTaskQueue.Add", err)
 		}
@@ -115,7 +115,7 @@ func TestTaskQueue_Update(t *testing.T) {
 		}
 	}
 
-	bok, waitingJobs, err := taskQueue.GetJobsByStatus(task_queue.Waiting)
+	bok, waitingJobs, err := taskQueue.GetJobsByStatus(task_queue2.Waiting)
 	if err != nil {
 		t.Fatal("TestTaskQueue.Get", err)
 	}
@@ -136,7 +136,7 @@ func TestTaskQueue_Update(t *testing.T) {
 
 	for _, waitingJob := range waitingJobs {
 
-		waitingJob.JobStatus = task_queue.Committed
+		waitingJob.JobStatus = task_queue2.Committed
 
 		bok, err = taskQueue.Update(waitingJob)
 		if err != nil {
@@ -147,7 +147,7 @@ func TestTaskQueue_Update(t *testing.T) {
 		}
 	}
 
-	bok, committedJobs, err := taskQueue.GetJobsByStatus(task_queue.Committed)
+	bok, committedJobs, err := taskQueue.GetJobsByStatus(task_queue2.Committed)
 	if err != nil {
 		t.Fatal("TestTaskQueue.Get", err)
 	}
@@ -169,7 +169,7 @@ func TestTaskQueue_UpdateAdGetOneWaiting(t *testing.T) {
 
 	taskQueue := NewTaskQueue(cache_center.NewCacheCenter(taskQueueName, settings.GetSettings(), log_helper.GetLogger4Tester()))
 	for i := taskPriorityCount; i >= 0; i-- {
-		bok, err := taskQueue.Add(*task_queue.NewOneJob(common.Movie, fmt.Sprintf("%d", i), i))
+		bok, err := taskQueue.Add(*task_queue2.NewOneJob(common.Movie, fmt.Sprintf("%d", i), i))
 		if err != nil {
 			t.Fatal("TestTaskQueue.Add", err)
 		}
@@ -190,7 +190,7 @@ func TestTaskQueue_UpdateAdGetOneWaiting(t *testing.T) {
 		t.Fatal("waitingJob.TaskPriority != 0")
 	}
 
-	waitingJob.JobStatus = task_queue.Committed
+	waitingJob.JobStatus = task_queue2.Committed
 	bok, err = taskQueue.Update(waitingJob)
 	if err != nil {
 		t.Fatal("TestTaskQueue.Update", err)
@@ -221,7 +221,7 @@ func TestTaskQueue_UpdatePriority(t *testing.T) {
 
 	taskQueue := NewTaskQueue(cache_center.NewCacheCenter(taskQueueName, settings.GetSettings(), log_helper.GetLogger4Tester()))
 	for i := taskPriorityCount; i >= 0; i-- {
-		bok, err := taskQueue.Add(*task_queue.NewOneJob(common.Movie, fmt.Sprintf("%d", i), i))
+		bok, err := taskQueue.Add(*task_queue2.NewOneJob(common.Movie, fmt.Sprintf("%d", i), i))
 		if err != nil {
 			t.Fatal("TestTaskQueue.Add", err)
 		}
@@ -251,7 +251,7 @@ func TestTaskQueue_UpdatePriority(t *testing.T) {
 		t.Fatal("TestTaskQueue.Update == false")
 	}
 
-	bok, waitingJobs, err := taskQueue.GetJobsByPriorityAndStatus(0, task_queue.Waiting)
+	bok, waitingJobs, err := taskQueue.GetJobsByPriorityAndStatus(0, task_queue2.Waiting)
 	if err != nil {
 		t.Fatal("TestTaskQueue.GetJobsByPriorityAndStatus", err)
 	}
@@ -263,7 +263,7 @@ func TestTaskQueue_UpdatePriority(t *testing.T) {
 		t.Fatal("len(waitingJobs) != 0")
 	}
 
-	bok, waitingJobs, err = taskQueue.GetJobsByPriorityAndStatus(1, task_queue.Waiting)
+	bok, waitingJobs, err = taskQueue.GetJobsByPriorityAndStatus(1, task_queue2.Waiting)
 	if err != nil {
 		t.Fatal("TestTaskQueue.GetJobsByPriorityAndStatus", err)
 	}
@@ -286,7 +286,7 @@ func TestTaskQueue_AddAndGetOneJob(t *testing.T) {
 	taskQueue := NewTaskQueue(cache_center.NewCacheCenter(taskQueueName, settings.GetSettings(), log_helper.GetLogger4Tester()))
 
 	for i := taskPriorityCount; i >= 0; i-- {
-		bok, err := taskQueue.Add(*task_queue.NewOneJob(common.Movie, fmt.Sprintf("%d", i), DefaultTaskPriorityLevel))
+		bok, err := taskQueue.Add(*task_queue2.NewOneJob(common.Movie, fmt.Sprintf("%d", i), DefaultTaskPriorityLevel))
 		if err != nil {
 			t.Fatal("TestTaskQueue.Add", err)
 		}
@@ -319,7 +319,7 @@ func TestTaskQueue_AddAndGetOneJob(t *testing.T) {
 	println("VideoFPath", oneJob.VideoFPath)
 	println("TaskPriority", oneJob.TaskPriority)
 
-	found, waitingJobs, err := taskQueue.GetJobsByStatus(task_queue.Waiting)
+	found, waitingJobs, err := taskQueue.GetJobsByStatus(task_queue2.Waiting)
 	if err != nil {
 		return
 	}
@@ -328,7 +328,7 @@ func TestTaskQueue_AddAndGetOneJob(t *testing.T) {
 		println("QueueDownloader Waiting:", i, job.VideoName)
 	}
 
-	found, waitingJobs, err = taskQueue.GetJobsByStatus(task_queue.Done)
+	found, waitingJobs, err = taskQueue.GetJobsByStatus(task_queue2.Done)
 	if err != nil {
 		return
 	}
@@ -337,7 +337,7 @@ func TestTaskQueue_AddAndGetOneJob(t *testing.T) {
 		println("QueueDownloader Done:", i, job.VideoName)
 	}
 
-	found, waitingJobs, err = taskQueue.GetJobsByStatus(task_queue.Failed)
+	found, waitingJobs, err = taskQueue.GetJobsByStatus(task_queue2.Failed)
 	if err != nil {
 		return
 	}

+ 3 - 1
internal/types/backend/reply_all_jobs.go → pkg/types/backend/reply_all_jobs.go

@@ -1,6 +1,8 @@
 package backend
 
-import "github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
+import (
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/task_queue"
+)
 
 type ReplyAllJobs struct {
 	AllJobs []task_queue.OneJob `json:"all_jobs"`

+ 0 - 0
internal/types/backend/reply_check_auth.go → pkg/types/backend/reply_check_auth.go


+ 0 - 0
internal/types/backend/reply_check_emby_path.go → pkg/types/backend/reply_check_emby_path.go


+ 0 - 0
internal/types/backend/reply_check_path.go → pkg/types/backend/reply_check_path.go


+ 0 - 0
internal/types/backend/reply_check_proxy.go → pkg/types/backend/reply_check_proxy.go


+ 0 - 0
internal/types/backend/reply_common.go → pkg/types/backend/reply_common.go


+ 0 - 0
internal/types/backend/reply_job_log.go → pkg/types/backend/reply_job_log.go


+ 0 - 0
internal/types/backend/reply_job_status.go → pkg/types/backend/reply_job_status.go


+ 3 - 1
internal/types/backend/reply_job_things.go → pkg/types/backend/reply_job_things.go

@@ -1,6 +1,8 @@
 package backend
 
-import "github.com/allanpk716/ChineseSubFinder/internal/types/task_queue"
+import (
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/task_queue"
+)
 
 type ReplyJobThings struct {
 	JobID     string               `json:"job_id"`

+ 0 - 0
internal/types/backend/reply_login.go → pkg/types/backend/reply_login.go


+ 0 - 0
internal/types/backend/reply_movie_list.go → pkg/types/backend/reply_movie_list.go


+ 0 - 0
internal/types/backend/reply_refresh_video_list.go → pkg/types/backend/reply_refresh_video_list.go


+ 3 - 1
internal/types/backend/reply_running_log.go → pkg/types/backend/reply_running_log.go

@@ -1,6 +1,8 @@
 package backend
 
-import "github.com/allanpk716/ChineseSubFinder/internal/types/log_hub"
+import (
+	"github.com/allanpk716/ChineseSubFinder/pkg/types/log_hub"
+)
 
 type ReplyRunningLog struct {
 	RecentLogs []log_hub.OnceLog `json:"recent_logs"`

+ 0 - 0
internal/types/backend/reply_series_list.go → pkg/types/backend/reply_series_list.go


Деякі файли не було показано, через те що забагато файлів було змінено