Skip to content

Commit

Permalink
issue insidegui#23: fixed issue with wrong comparision type for year …
Browse files Browse the repository at this point in the history
…search query
  • Loading branch information
art-divin committed May 1, 2015
1 parent 894159a commit fe299c1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions WWDC/VideosViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,14 @@ class VideosViewController: NSViewController, NSTableViewDelegate, NSTableViewDa
var qualifiers = term.qualifierSearchParser_parseQualifiers(["year", "focus", "track", "downloaded"])
indexOfLastSelectedRow = -1
return sessions.filter { session in

if let year: String = qualifiers["year"] as? String {
let yearStr = "\(session.year)"
if !(yearStr as NSString).containsString(year) {
return false
let result = (yearStr as NSString).rangeOfString(year, options: .CaseInsensitiveSearch)
if result.location + result.length == count(yearStr) {
return true
}
return false
}

if let focus: String = qualifiers["focus"] as? String {
Expand Down

0 comments on commit fe299c1

Please sign in to comment.