Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcode a return for level to allow other data to load #19

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -110,7 +110,7 @@ extension Assignment: DatabaseCodable {
self.createdAt = resultSet.date(forColumn: table.createdAt.name)!
self.subjectID = resultSet.long(forColumn: table.subjectID.name)
self.subjectType = resultSet.rawValue(SubjectType.self, forColumn: table.subjectType.name)!
self.level = resultSet.long(forColumn: table.level.name)
// self.level = resultSet.long(forColumn: table.level.name)
self.srsStage = resultSet.long(forColumn: table.srsStage.name)
self.srsStageName = resultSet.string(forColumn: table.srsStageName.name)!
self.unlockedAt = resultSet.date(forColumn: table.unlockedAt.name)
Expand Down
8 changes: 6 additions & 2 deletions WaniKaniKit/Model/Assignment.swift
Expand Up @@ -9,7 +9,6 @@ public struct Assignment: ResourceCollectionItemData, Equatable {
public let createdAt: Date
public let subjectID: Int
public let subjectType: SubjectType
public let level: Int
public let srsStage: Int
public let srsStageName: String
public let unlockedAt: Date?
Expand All @@ -26,7 +25,6 @@ public struct Assignment: ResourceCollectionItemData, Equatable {
case createdAt = "created_at"
case subjectID = "subject_id"
case subjectType = "subject_type"
case level
case srsStage = "srs_stage"
case srsStageName = "srs_stage_name"
case unlockedAt = "unlocked_at"
Expand All @@ -42,6 +40,12 @@ public struct Assignment: ResourceCollectionItemData, Equatable {
}

public extension Assignment {
var level: Int {
print("subjectType \(subjectType)")
print("subjectID \(subjectID)")
return 1
}

public static func isAcceleratedLevel(_ level: Int) -> Bool {
return level <= 2
}
Expand Down