Adding/removing videos to/from playlists

This commit is contained in:
Arkadiusz Fal
2021-07-09 16:53:53 +02:00
parent 31bd2f7fe6
commit f397b13720
12 changed files with 218 additions and 17 deletions

View File

@@ -15,10 +15,21 @@ struct Video: Identifiable {
var description: String
var genre: String
let indexID: String?
var streams = [Stream]()
init(_ json: JSON) {
id = json["videoId"].stringValue
let videoID = json["videoId"].stringValue
if let id = json["indexId"].string {
indexID = id
self.id = videoID + id
} else {
indexID = nil
id = videoID
}
title = json["title"].stringValue
author = json["author"].stringValue
length = json["lengthSeconds"].doubleValue