mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Adding/removing videos to/from playlists
This commit is contained in:
@@ -6,17 +6,20 @@ struct Playlist: Identifiable, Equatable, Hashable {
|
||||
var title: String
|
||||
var visibility: PlaylistVisibility
|
||||
|
||||
var updated: TimeInterval
|
||||
|
||||
var videos = [Video]()
|
||||
|
||||
init(_ json: JSON) {
|
||||
id = json["playlistId"].stringValue
|
||||
title = json["title"].stringValue
|
||||
visibility = json["isListed"].boolValue ? .public : .private
|
||||
updated = json["updated"].doubleValue
|
||||
videos = json["videos"].arrayValue.map { Video($0) }
|
||||
}
|
||||
|
||||
static func == (lhs: Playlist, rhs: Playlist) -> Bool {
|
||||
lhs.id == rhs.id && lhs.title == rhs.title && lhs.visibility == rhs.visibility
|
||||
lhs.id == rhs.id && lhs.updated == rhs.updated
|
||||
}
|
||||
|
||||
func hash(into hasher: inout Hasher) {
|
||||
|
Reference in New Issue
Block a user