Added realse and pickup dates. Games no Always go to DetailView and not editmode

This commit is contained in:
2021-06-24 16:23:09 +02:00
parent 87dbc9d1da
commit 2b5615f3fa
8 changed files with 1396 additions and 10 deletions

View File

@@ -78,6 +78,11 @@ class LibraryImport {
}
}
private func noneIfEmpty(_ str : String?) -> String? {
if str == "" { return .none }
return str
}
private func makeCDGame(from game: BHLGame, _ gameDict: inout [UUID : Game], _ cdConsole: Console) {
let cdGame = Game(context: self.CDContext)
gameDict[game.uuid] = cdGame
@@ -88,7 +93,8 @@ class LibraryImport {
cdGame.finishedDate = game.finishedDate
cdGame.lentTo = game.lentTo
cdGame.cover_icloud_path = game.cover_icloud_path
cdGame.pickupDescription = game.pickupDescription
cdGame.notes = noneIfEmpty(game.notes)
cdGame.pickupDescription = noneIfEmpty(game.pickupDescription)
cdGame.isDigital = game.isDigital
cdGame.playtime_h = game.playtime_h ?? 0
cdGame.playtime_min = game.playtime_min ?? 0