Skip to content

Commit

Permalink
Fixed some issue version 1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ssamadgh committed Jul 6, 2018
1 parent 023da4e commit 4b36891
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@

### Whats New:

**version 1.5.2:**

- Fixed an issue that downloads wrong subtitle for selected session in some cases

**version 1.5.1:**

- Now supports WWDC 2018 video's links
Expand Down
Binary file modified Releases/WWDC.srt.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "WWDCSubGetter/MainViewController.swift"
timestampString = "551488201.255013"
timestampString = "552547545.833598"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "492"
Expand All @@ -298,11 +298,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "WWDCSubGetter/MainViewController.swift"
timestampString = "551488201.255052"
timestampString = "552547545.833994"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "679"
endingLineNumber = "679"
startingLineNumber = "686"
endingLineNumber = "686"
landmarkName = "getSubtitlesFromPath(path:)"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -314,11 +314,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "WWDCSubGetter/MainViewController.swift"
timestampString = "551488201.255088"
timestampString = "552547545.83426"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "651"
endingLineNumber = "651"
startingLineNumber = "658"
endingLineNumber = "658"
landmarkName = "downloadLinks(for:)"
landmarkType = "7">
</BreakpointContent>
Expand Down
9 changes: 8 additions & 1 deletion WWDCSubGetter/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,14 @@ final class MainViewController: NSViewController, TextFileViewDelegate, NSTextFi
if FileManager.default.fileExists(atPath: hdVideoURL.path) {

let data = try! String(contentsOfFile:hdVideoURL.path, encoding: String.Encoding.utf8)
let hdVideoLinksArray = data.components(separatedBy: "\n").filter { $0.contains(sessionNumber) }
var searchString = ""
if wwdc == .ofFall2017 {
searchString = "/\(sessionNumber)"
}
else {
searchString = "/\(sessionNumber)/\(sessionNumber)"
}
let hdVideoLinksArray = data.components(separatedBy: "\n").filter { $0.contains(searchString) }
if let videoLink = hdVideoLinksArray.first {
if let subtitle = Subtitle(videoURL: videoLink) {
model.update(subtitle)
Expand Down

0 comments on commit 4b36891

Please sign in to comment.