-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- The backup & batch programs still have a lax/strict switch. However all the tables now use the option set to set how strict they are. - They default to .strict since the programs did. - Next step will be to add control for each table to the programs. - This reverts #532.
- Loading branch information
Showing
11 changed files
with
79 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// SchemaConstraints+SchemaOptions.swift | ||
// itunes_json | ||
// | ||
// Created by Greg Bolsinga on 12/25/24. | ||
// | ||
|
||
extension SchemaConstraints { | ||
var schemaOptions: SchemaOptions { | ||
switch self { | ||
case .strict: | ||
.strictSchema | ||
case .lax: | ||
.laxSchema | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// SchemaOptions.swift | ||
// itunes_json | ||
// | ||
// Created by Greg Bolsinga on 12/25/24. | ||
// | ||
|
||
import Foundation | ||
|
||
struct SchemaOptions: OptionSet { | ||
let rawValue: UInt | ||
|
||
private static let laxArtist = SchemaOptions(rawValue: 1 << 0) | ||
private static let laxAlbum = SchemaOptions(rawValue: 1 << 1) | ||
private static let laxSong = SchemaOptions(rawValue: 1 << 2) | ||
private static let laxPlays = SchemaOptions(rawValue: 1 << 3) | ||
|
||
static let strictSchema = SchemaOptions() | ||
static let laxSchema: SchemaOptions = [ | ||
Self.laxArtist, Self.laxAlbum, Self.laxSong, Self.laxPlays, | ||
] | ||
|
||
var artistConstraints: SchemaConstraints { self.contains(.laxArtist) ? .lax : .strict } | ||
var albumConstraints: SchemaConstraints { self.contains(.laxAlbum) ? .lax : .strict } | ||
var songConstraints: SchemaConstraints { self.contains(.laxSong) ? .lax : .strict } | ||
var playsConstraints: SchemaConstraints { self.contains(.laxPlays) ? .lax : .strict } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters