Skip to content

Commit

Permalink
Updated contingency fixtures, fixed reload issue on tables and assets…
Browse files Browse the repository at this point in the history
… without streaming url
  • Loading branch information
insidegui committed May 8, 2017
1 parent 78b779a commit ac242b7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 36 deletions.
18 changes: 8 additions & 10 deletions ConfCore/SessionAssetsAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,16 @@ final class SessionAssetsJSONAdapter: Adapter {
return .error(.missingKey(AssetKeys.year))
}

guard let url = input[AssetKeys.url].string else {
return .error(.missingKey(AssetKeys.url))
}

var output = [SessionAsset]()

let streaming = SessionAsset()
streaming.rawAssetType = SessionAssetType.streamingVideo.rawValue
streaming.remoteURL = url
streaming.year = year
streaming.sessionId = sessionId
output.append(streaming)
if let url = input[AssetKeys.url].string {
let streaming = SessionAsset()
streaming.rawAssetType = SessionAssetType.streamingVideo.rawValue
streaming.remoteURL = url
streaming.year = year
streaming.sessionId = sessionId
output.append(streaming)
}

if let hd = input[AssetKeys.download_hd].string {
let hdVideo = SessionAsset()
Expand Down
4 changes: 2 additions & 2 deletions Fixtures/json_contingency/sessions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8236,8 +8236,8 @@
"current": true,
"identifier": "wwdc2017",
"webUrlKey": "wwdc17",
"start": "2017-06-05",
"end": "2017-06-09"
"start": "2017-06-13",
"end": "2017-06-17"
},
{
"name": "WWDC 2016",
Expand Down
10 changes: 2 additions & 8 deletions Fixtures/json_contingency/videos.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@
"images": {
"shelf": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/images/210_734x413.jpg"
},
"download_hd": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/210_hd_mastering_uikit_on_tvos.mp4",
"download_sd": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/210_sd_mastering_uikit_on_tvos.mp4",
"slides": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/210_mastering_uikit_on_tvos.pdf",
"year": 2017,
"url": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/hls_vod_mvp.m3u8",
"tvos_url": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/atv_vod_mvp.m3u8",
"subtitles": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/subtitles/eng/210_sd_mastering_uikit_on_tvos.vtt",
"location": "Presidio",
"duration": 2280,
"start_date": "2017-06-15T10:00:00-07:00",
Expand Down Expand Up @@ -14650,8 +14644,8 @@
"current": true,
"identifier": "wwdc2017",
"webUrlKey": "wwdc17",
"start": "2017-06-05",
"end": "2017-06-09"
"start": "2017-06-13",
"end": "2017-06-17"
},
{
"name": "WWDC 2016",
Expand Down
4 changes: 2 additions & 2 deletions Fixtures/json_post_contingency/sessions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8236,8 +8236,8 @@
"current": true,
"identifier": "wwdc2017",
"webUrlKey": "wwdc17",
"start": "2017-06-05",
"end": "2017-06-09"
"start": "2017-06-13",
"end": "2017-06-17"
},
{
"name": "WWDC 2016",
Expand Down
10 changes: 2 additions & 8 deletions Fixtures/json_post_contingency/videos.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@
"images": {
"shelf": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/images/210_734x413.jpg"
},
"download_hd": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/210_hd_mastering_uikit_on_tvos.mp4",
"download_sd": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/210_sd_mastering_uikit_on_tvos.mp4",
"slides": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/210_mastering_uikit_on_tvos.pdf",
"year": 2017,
"url": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/hls_vod_mvp.m3u8",
"tvos_url": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/atv_vod_mvp.m3u8",
"subtitles": "http://devstreaming.apple.com/videos/wwdc/2016/210e4481b1cnwor4n1q/210/subtitles/eng/210_sd_mastering_uikit_on_tvos.vtt",
"location": "Presidio",
"duration": 2280,
"start_date": "2017-06-15T10:00:00-07:00",
Expand Down Expand Up @@ -14650,8 +14644,8 @@
"current": true,
"identifier": "wwdc2017",
"webUrlKey": "wwdc17",
"start": "2017-06-05",
"end": "2017-06-09"
"start": "2017-06-13",
"end": "2017-06-17"
},
{
"name": "WWDC 2016",
Expand Down
7 changes: 1 addition & 6 deletions WWDC/SessionsTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ class SessionsTableViewController: NSViewController {

var viewModels: [SessionRow] = [] {
didSet {
tableView.reload(withOldValue: oldValue, newValue: viewModels)

// make sure the selected session is kept up to date
if tableView.selectedRow >= 0 {
selectedSession.value = viewModels[tableView.selectedRow].viewModel
}
tableView.reloadData()
}
}

Expand Down

0 comments on commit ac242b7

Please sign in to comment.