Skip to content

Commit

Permalink
Add ability to use $VIDEO_ID in custom URL setting
Browse files Browse the repository at this point in the history
  • Loading branch information
agentcooper committed Jul 29, 2023
1 parent e0b86cc commit 559039b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Telik/Model.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ struct SourceInfo {
case .usual:
return video.getStandardYouTubeURL()
case .customURL:
let finalURL = customOpenCommand.replacingOccurrences(of: "$URL", with: "\(video.getStandardYouTubeURL())")
let finalURL = customOpenCommand
.replacingOccurrences(of: "$URL", with: "\(video.getStandardYouTubeURL())")
.replacingOccurrences(of: "$VIDEO_ID", with: "\(video.id)")
guard let url = URL(string: finalURL) else {
return video.getStandardYouTubeURL()
}
Expand Down
2 changes: 1 addition & 1 deletion Telik/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct SettingsView: View {
}
if model.selectedDomain == .customURL {
TextField("Custom URL", text: $model.customOpenCommand)
Text("Use $URL for YouTube URL").font(.caption).foregroundColor(.gray)
Text("Use $URL for the full YouTube URL or $VIDEO_ID for the video ID").font(.caption).foregroundColor(.gray)
}
Toggle(isOn: $model.hideShorts) {
Text("Hide videos with #shorts in the title")
Expand Down

0 comments on commit 559039b

Please sign in to comment.