Updates OpenVGDB to latest version
Fixes broken OpenVGDB cover art URLs due to host moving from gamefaqs1.cbsistatic.com to gamefaqs.gamespot.com.
This commit is contained in:
parent
f1f75d8cc0
commit
baf895939d
@ -255,10 +255,10 @@ private extension DatabaseManager
|
||||
|
||||
do
|
||||
{
|
||||
if !FileManager.default.fileExists(atPath: DatabaseManager.gamesDatabaseURL.path)
|
||||
if !FileManager.default.fileExists(atPath: DatabaseManager.gamesDatabaseURL.path) || GamesDatabase.version != GamesDatabase.previousVersion
|
||||
{
|
||||
guard let bundleURL = Bundle.main.url(forResource: "openvgdb", withExtension: "sqlite") else { throw GamesDatabase.Error.doesNotExist }
|
||||
try FileManager.default.copyItem(at: bundleURL, to: DatabaseManager.gamesDatabaseURL)
|
||||
try FileManager.default.copyItem(at: bundleURL, to: DatabaseManager.gamesDatabaseURL, shouldReplace: true)
|
||||
}
|
||||
|
||||
self.gamesDatabase = try GamesDatabase()
|
||||
|
||||
@ -66,7 +66,10 @@ extension GamesDatabase
|
||||
|
||||
class GamesDatabase
|
||||
{
|
||||
static let version = -1
|
||||
static let version = 2
|
||||
static var previousVersion: Int? {
|
||||
return UserDefaults.standard.previousGamesDatabaseVersion
|
||||
}
|
||||
|
||||
private let connection: Connection
|
||||
|
||||
|
||||
BIN
Resources/openvgdb.sqlite
Executable file → Normal file
BIN
Resources/openvgdb.sqlite
Executable file → Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user