Skip to content

Commit

Permalink
All tests should pass now
Browse files Browse the repository at this point in the history
  • Loading branch information
Helvio88 committed Sep 10, 2023
1 parent 01383fc commit 00dd92e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions gamescollection/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,20 +275,20 @@ func (c *collect) getFriendlyName(file repository.FileDesc) string {

name := ""
if baseTitle.Name != "" {
name = baseTitle.Name
name = fmt.Sprintf("%s ", baseTitle.Name)
}

// Append DLC Name and tag when dlc
if dlc {
extra = "DLC"
name = fmt.Sprintf("%s - %s", name, title.Name)
name = fmt.Sprintf("%s- %s ", name, title.Name)
}

region := ""
if baseTitle.Region != "" {
region = fmt.Sprintf("(%s)", baseTitle.Region)
region = fmt.Sprintf("(%s) ", baseTitle.Region)
}

// Build the friendly name for Tinfoil
return fmt.Sprintf("%s %s [%s][v%d][%s].%s", name, region, file.GameID, title.Version, extra, file.Extension)
return fmt.Sprintf("%s%s[%s][v%d][%s].%s", name, region, file.GameID, title.Version, extra, file.Extension)
}
6 changes: 3 additions & 3 deletions gamescollection/collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ var _ = Describe("Collection", func() {
games := testCollection.Games()
Expect(games.Files).To(HaveLen(1))
Expect(games.Titledb).To(HaveLen(1))
Expect(games.Files[0].URL).To(Equal("http://tinshop.example.com/games/010034500641A000#[010034500641A000] Attack on Titan 2 (US) [BASE].nsp"))
Expect(games.Files[0].URL).To(Equal("http://tinshop.example.com/games/010034500641A000#Attack on Titan 2 (US) [010034500641A000][v0][BASE].nsp"))
})
It("Add a base game (without Region)", func() {
newGames := make([]repository.FileDesc, 0)
Expand Down Expand Up @@ -167,7 +167,7 @@ var _ = Describe("Collection", func() {
games := testCollection.Games()
Expect(games.Files).To(HaveLen(1))
Expect(games.Titledb).To(HaveLen(1))
Expect(games.Files[0].URL).To(Equal("http://tinshop.example.com/games/010034501225C000#[010034501225C000] [BASE].nsp"))
Expect(games.Files[0].URL).To(Equal("http://tinshop.example.com/games/010034501225C000#[010034501225C000][v0][BASE].nsp"))
})
It("Add a DLC game", func() {
newGames := make([]repository.FileDesc, 0)
Expand All @@ -185,7 +185,7 @@ var _ = Describe("Collection", func() {
games := testCollection.Games()
Expect(games.Files).To(HaveLen(1))
Expect(games.Titledb).To(HaveLen(1))
Expect(games.Files[0].URL).To(Equal("http://tinshop.example.com/games/010034500641B001#Attack on Titan 2 - Additional Episode, \"A Sudden Rain\" (US) [010034500641B001][v0][DLC].nsp"))
Expect(games.Files[0].URL).To(Equal("http://tinshop.example.com/games/010034500641B001#Attack on Titan 2 - Additional Episode, \"A Sudden Rain\" (US) [010034500641B001][v131072][DLC].nsp"))
})
It("Add an UPDATE game", func() {
newGames := make([]repository.FileDesc, 0)
Expand Down

0 comments on commit 00dd92e

Please sign in to comment.