Jelajahi Sumber

保存进度,需要先重构项目目录结构

Signed-off-by: allan716 <[email protected]>
allan716 4 tahun lalu
induk
melakukan
fee99e8100
4 mengubah file dengan 15 tambahan dan 0 penghapusan
  1. 2 0
      common/language.go
  2. 8 0
      emby_helper/embyhelper.go
  3. 1 0
      go.mod
  4. 4 0
      go.sum

+ 2 - 0
common/language.go

@@ -26,7 +26,9 @@ const (
 // 需要符合 emby 的格式要求,在后缀名前面
 const (
 	Emby_unknow = ".unknow"					// 未知语言
+	Emby_chinese 	= ".chinese"			// 中文
 	Emby_chi 	= ".chi"					// 简体
+	Emby_chn 	= ".chn"					// 中国国家代码
 	Emby_chs 	= ".chs"					// 简体
 	Emby_cht 	= ".cht"					// 繁体
 	Emby_chs_en = ".chs_en"                 // 简英双语字幕

+ 8 - 0
emby_helper/embyhelper.go

@@ -288,9 +288,15 @@ func (em *EmbyHelper) langStringOK(inLang string) bool {
 	spStrings := strings.Split(tmpString, "[")
 	if len(spStrings) > 1 {
 		nextString = spStrings[0]
+	} else {
+		spStrings = strings.Split(tmpString, "(")
+		if len(spStrings) > 1 {
+			nextString = spStrings[0]
+		}
 	}
 	switch nextString {
 	case em.replaceLangString(common.Emby_chi),
+		em.replaceLangString(common.Emby_chn),
 		em.replaceLangString(common.Emby_chs),
 		em.replaceLangString(common.Emby_cht),
 		em.replaceLangString(common.Emby_chs_en),
@@ -300,6 +306,8 @@ func (em *EmbyHelper) langStringOK(inLang string) bool {
 		em.replaceLangString(common.Emby_chs_kr),
 		em.replaceLangString(common.Emby_cht_kr):
 			return true
+	case em.replaceLangString(common.Emby_chinese):
+		return true
 	default:
 		return false
 	}

+ 1 - 0
go.mod

@@ -51,6 +51,7 @@ require (
 	gopkg.in/ini.v1 v1.62.0 // indirect
 	gopkg.in/yaml.v2 v2.4.0 // indirect
 	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
+	gorm.io/gorm v1.21.12 // indirect
 )
 
 replace github.com/go-creed/sat => github.com/allanpk716/sat v0.0.0-20210622112535-2e00ce54a80b

+ 4 - 0
go.sum

@@ -131,6 +131,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
 github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
 github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
 github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
+github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
+github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
 github.com/jinzhu/now v1.1.2 h1:eVKgfIdy9b6zbWBMgFpfDPoAMifwSZagU9HmEU6zgiI=
 github.com/jinzhu/now v1.1.2/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
 github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
@@ -430,6 +432,8 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gorm.io/gorm v1.21.12 h1:3fQM0Eiz7jcJEhPggHEpoYnsGZqynMzverL77DV40RM=
+gorm.io/gorm v1.21.12/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0=
 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=