Skip to content

Commit

Permalink
Change GI data source to GitLab.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShikiSuen committed Jul 27, 2024
1 parent 1f08b41 commit 69e018f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Sources/GachaMetaGeneratorModule/Components/SupportedGame.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ extension GachaMetaGenerator {
}

func getExcelConfigDataURL(for type: DataURLType) -> URL {
var result = Self.repoHeader + repoName
var result = repoHeader + repoName
switch (self, type) {
case (.genshinImpact, .weaponData): result += "ExcelBinOutput/WeaponExcelConfigData.json"
case (.genshinImpact, .characterData): result += "ExcelBinOutput/AvatarExcelConfigData.json"
Expand All @@ -99,18 +99,21 @@ extension GachaMetaGenerator {
}

func getLangDataURL(for lang: GachaDictLang) -> URL {
URL(string: Self.repoHeader + repoName + "TextMap/\(lang.filename)")!
URL(string: repoHeader + repoName + "TextMap/\(lang.filename)")!
}

// MARK: Private

private static let repoHeader = """
https://raw.githubusercontent.com/
"""
private var repoHeader: String {
switch self {
case .genshinImpact: return "https://gitlab.com/"
case .starRail: return "https://raw.githubusercontent.com/"
}
}

private var repoName: String {
switch self {
case .genshinImpact: return "DimbreathBot/AnimeGameData/master/"
case .genshinImpact: return "Dimbreath/AnimeGameData/-/raw/master/"
case .starRail: return "Dimbreath/StarRailData/master/"
}
}
Expand Down

0 comments on commit 69e018f

Please sign in to comment.