Skip to content

Commit

Permalink
Merge branch 'root-v1.21-and-main' into release/dcs/v1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
richmahn committed Jan 18, 2024
2 parents 098d442 + 4275d3b commit 7ddbee6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
8 changes: 7 additions & 1 deletion modules/dcs/tcts.go
Expand Up @@ -27,6 +27,8 @@ func GetTcTsManifestFromBlob(blob *git.Blob) (*structs.TcTsManifest, error) {
t.MetadataType = "tc"
t.Format = "usfm"
t.Subject = "Aligned Bible"
t.FlavorType = "scripture"
t.Flavor = "textTranslation"
} else if t.TsVersion >= 3 {
t.MetadataVersion = strconv.Itoa(t.TsVersion)
t.MetadataType = "ts"
Expand All @@ -36,14 +38,18 @@ func GetTcTsManifestFromBlob(blob *git.Blob) (*structs.TcTsManifest, error) {
if t.Resource.Name == "" {
t.Resource.Name = strings.ToUpper(t.Resource.ID)
}

if t.Project.Name == "" {
t.Project.Name = strings.ToUpper(t.Project.ID)
}
if t.Resource.ID == "obs" {
t.Subject = "Open Bible Stories"
t.FlavorType = "gloss"
t.Flavor = "textStories"
} else {
t.Subject = "Bible"
t.FlavorType = "scripture"
t.Flavor = "textTranslation"

}
} else {
return nil, nil
Expand Down
14 changes: 8 additions & 6 deletions modules/structs/dcs_tctsmanifest.go
Expand Up @@ -9,13 +9,15 @@ package structs
// ts v5: https://git.door43.org/69c530493aab80e7/uw-mrk-lol/raw/branch/master/manifest.json
// ts v6: https://git.door43.org/Sitorabi/def_obs_text_obs/src/branch/master/manifest.json
type TcTsManifest struct {
TcVersion int `json:"tc_version"` // for tC
TsVersion int `json:"package_version"` // for tS
MetadataVersion string // To be filled in below
MetadataType string // To Be filled in below
TcVersion int `json:"tc_version"` // for tC
TsVersion int `json:"package_version"` // for tS
MetadataVersion string
MetadataType string
Format string `json:"format"`
Subject string // To be filled in below
Title string // To be filled in below
Subject string
FlavorType string
Flavor string
Title string
TargetLanguage struct {
ID string `json:"id"`
Name string `json:"name"`
Expand Down
7 changes: 3 additions & 4 deletions services/door43metadata/door43metadata.go
Expand Up @@ -521,7 +521,6 @@ func GetTcOrTsDoor43Metadata(dm *repo_model.Door43Metadata, repo *repo_model.Rep

log.Info("%s/%s: manifest.json exists so might be a tC or tS repo", repo.FullName(), commit.ID)
var bookPath string
var contentFormat string
var count int
var versification string

Expand All @@ -531,14 +530,12 @@ func GetTcOrTsDoor43Metadata(dm *repo_model.Door43Metadata, repo *repo_model.Rep
}
if t.MetadataType == "ts" {
bookPath = "."
contentFormat = "text"
if t.Project.ID != "obs" {
versification = "ufw"
}
} else {
bookPath = "./" + repo.Name + ".usfm"
count, _ = GetBookAlignmentCount(bookPath, commit)
contentFormat = "usfm"
versification = "ufw"
}

Expand All @@ -557,13 +554,15 @@ func GetTcOrTsDoor43Metadata(dm *repo_model.Door43Metadata, repo *repo_model.Rep
dm.MetadataType = t.MetadataType
dm.MetadataVersion = t.MetadataVersion
dm.Subject = t.Subject
dm.FlavorType = t.FlavorType
dm.Flavor = t.Flavor
dm.Title = t.Title
dm.Abbreviation = strings.ToLower(t.Resource.ID)
dm.Language = t.TargetLanguage.ID
dm.LanguageTitle = t.TargetLanguage.Name
dm.LanguageDirection = t.TargetLanguage.Direction
dm.LanguageIsGL = dcs.LanguageIsGL(t.TargetLanguage.ID)
dm.ContentFormat = contentFormat
dm.ContentFormat = t.Format
dm.CheckingLevel = 1
dm.Ingredients = []*structs.Ingredient{{
Categories: dcs.GetBookCategories(t.Project.ID),
Expand Down

0 comments on commit 7ddbee6

Please sign in to comment.