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
9492f3165e
commit
08e870c94c
@ -255,10 +255,10 @@ private extension DatabaseManager
|
|||||||
|
|
||||||
do
|
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 }
|
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()
|
self.gamesDatabase = try GamesDatabase()
|
||||||
|
|||||||
@ -66,7 +66,10 @@ extension GamesDatabase
|
|||||||
|
|
||||||
class GamesDatabase
|
class GamesDatabase
|
||||||
{
|
{
|
||||||
static let version = -1
|
static let version = 2
|
||||||
|
static var previousVersion: Int? {
|
||||||
|
return UserDefaults.standard.previousGamesDatabaseVersion
|
||||||
|
}
|
||||||
|
|
||||||
private let connection: Connection
|
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