1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30
yattee/Model/Playlist.swift
2021-06-28 17:27:53 +02:00

26 lines
591 B
Swift

import Foundation
import SwiftyJSON
struct Playlist: Identifiable, Equatable, Hashable {
let id: String
var title: String
var description: String
var videos = [Video]()
init(_ json: JSON) {
id = json["playlistId"].stringValue
title = json["title"].stringValue
description = json["description"].stringValue
videos = json["videos"].arrayValue.map { Video($0) }
}
static func == (lhs: Playlist, rhs: Playlist) -> Bool {
lhs.id == rhs.id
}
func hash(into hasher: inout Hasher) {
hasher.combine(id)
}
}