2021-08-02 02:55:50 +05:30
|
|
|
import Foundation
|
|
|
|
|
2021-07-22 18:13:13 +05:30
|
|
|
extension Video {
|
2022-04-16 23:14:07 +05:30
|
|
|
static var fixtureID: Video.ID = "video-fixture"
|
|
|
|
static var fixtureChannelID: Channel.ID = "channel-fixture"
|
2022-03-27 23:57:26 +05:30
|
|
|
|
2021-07-22 18:13:13 +05:30
|
|
|
static var fixture: Video {
|
2021-10-22 04:59:10 +05:30
|
|
|
let thumbnailURL = "https://yt3.ggpht.com/ytc/AKedOLR-pT_JEsz_hcaA4Gjx8DHcqJ8mS42aTRqcVy6P7w=s88-c-k-c0x00ffffff-no-rj-mo"
|
2021-07-22 18:13:13 +05:30
|
|
|
|
|
|
|
return Video(
|
2022-03-27 23:57:26 +05:30
|
|
|
videoID: fixtureID,
|
2022-03-27 16:19:57 +05:30
|
|
|
title: "Relaxing Piano Music to feel good",
|
2021-07-22 18:13:13 +05:30
|
|
|
author: "Fancy Videotuber",
|
|
|
|
length: 582,
|
|
|
|
published: "7 years ago",
|
2021-08-23 00:43:33 +05:30
|
|
|
views: 21534,
|
2021-07-22 18:13:13 +05:30
|
|
|
description: "Some relaxing live piano music",
|
|
|
|
genre: "Music",
|
2021-10-22 04:59:10 +05:30
|
|
|
channel: Channel(
|
2022-04-16 23:14:07 +05:30
|
|
|
id: fixtureChannelID,
|
2021-10-22 04:59:10 +05:30
|
|
|
name: "The Channel",
|
|
|
|
thumbnailURL: URL(string: thumbnailURL)!,
|
|
|
|
subscriptionsCount: 2300,
|
|
|
|
videos: []
|
|
|
|
),
|
2022-03-27 23:57:26 +05:30
|
|
|
thumbnails: [],
|
2021-07-22 18:13:13 +05:30
|
|
|
live: false,
|
2021-08-23 00:43:33 +05:30
|
|
|
upcoming: false,
|
2021-11-28 20:07:55 +05:30
|
|
|
publishedAt: Date(),
|
2021-08-23 00:43:33 +05:30
|
|
|
likes: 37333,
|
|
|
|
dislikes: 30,
|
|
|
|
keywords: ["very", "cool", "video", "msfs 2020", "757", "747", "A380", "737-900", "MOD", "Zibo", "MD80", "MD11", "Rotate", "Laminar", "787", "A350", "MSFS", "MS2020", "Microsoft Flight Simulator", "Microsoft", "Flight", "Simulator", "SIM", "World", "Ortho", "Flying", "Boeing MAX"]
|
2021-07-22 18:13:13 +05:30
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
static var fixtureLiveWithoutPublishedOrViews: Video {
|
|
|
|
var video = fixture
|
|
|
|
|
|
|
|
video.title = "\(video.title) \(video.title) \(video.title) \(video.title) \(video.title)"
|
|
|
|
video.published = "0 seconds ago"
|
|
|
|
video.views = 0
|
|
|
|
video.live = true
|
|
|
|
|
|
|
|
return video
|
|
|
|
}
|
|
|
|
|
|
|
|
static var fixtureUpcomingWithoutPublishedOrViews: Video {
|
|
|
|
var video = fixtureLiveWithoutPublishedOrViews
|
|
|
|
|
|
|
|
video.live = false
|
|
|
|
video.upcoming = true
|
|
|
|
|
|
|
|
return video
|
|
|
|
}
|
2021-07-28 04:10:04 +05:30
|
|
|
|
|
|
|
static var allFixtures: [Video] {
|
|
|
|
[fixture, fixtureLiveWithoutPublishedOrViews, fixtureUpcomingWithoutPublishedOrViews]
|
|
|
|
}
|
2021-09-29 17:15:00 +05:30
|
|
|
|
|
|
|
static func fixtures(_ count: Int) -> [Video] {
|
|
|
|
var result = [Video]()
|
|
|
|
while result.count < count {
|
|
|
|
result.append(allFixtures.shuffled().first!)
|
|
|
|
}
|
|
|
|
|
|
|
|
return result
|
|
|
|
}
|
2021-07-22 18:13:13 +05:30
|
|
|
}
|