2021-10-21 03:51:50 +05:30
|
|
|
import Foundation
|
|
|
|
|
|
|
|
enum VideosApp: String, CaseIterable {
|
2022-12-11 20:30:20 +05:30
|
|
|
enum AppType: String {
|
|
|
|
case local
|
|
|
|
case youTube
|
|
|
|
case peerTube
|
|
|
|
}
|
|
|
|
|
2022-12-09 05:45:19 +05:30
|
|
|
case local
|
|
|
|
case invidious
|
|
|
|
case piped
|
|
|
|
case peerTube
|
2021-10-21 03:51:50 +05:30
|
|
|
|
|
|
|
var name: String {
|
2022-12-12 03:45:56 +05:30
|
|
|
switch self {
|
|
|
|
case .peerTube:
|
|
|
|
return "PeerTube"
|
|
|
|
default:
|
|
|
|
return rawValue.capitalized
|
|
|
|
}
|
2021-10-21 03:51:50 +05:30
|
|
|
}
|
|
|
|
|
2022-12-11 20:30:20 +05:30
|
|
|
var appType: AppType {
|
|
|
|
switch self {
|
|
|
|
case .local:
|
|
|
|
return .local
|
|
|
|
case .invidious:
|
|
|
|
return .youTube
|
|
|
|
case .piped:
|
|
|
|
return .youTube
|
|
|
|
case .peerTube:
|
|
|
|
return .peerTube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-21 03:51:50 +05:30
|
|
|
var supportsAccounts: Bool {
|
2022-12-09 05:45:19 +05:30
|
|
|
self != .local
|
2021-11-15 04:36:01 +05:30
|
|
|
}
|
|
|
|
|
2021-10-21 03:51:50 +05:30
|
|
|
var supportsPopular: Bool {
|
|
|
|
self == .invidious
|
|
|
|
}
|
|
|
|
|
|
|
|
var supportsSearchFilters: Bool {
|
|
|
|
self == .invidious
|
|
|
|
}
|
|
|
|
|
2022-12-09 05:45:19 +05:30
|
|
|
var supportsSearchSuggestions: Bool {
|
|
|
|
self != .peerTube
|
|
|
|
}
|
|
|
|
|
2021-10-21 03:51:50 +05:30
|
|
|
var supportsSubscriptions: Bool {
|
|
|
|
supportsAccounts
|
|
|
|
}
|
|
|
|
|
2022-12-10 07:31:59 +05:30
|
|
|
var paginatesSubscriptions: Bool {
|
|
|
|
self == .invidious
|
|
|
|
}
|
|
|
|
|
2021-10-21 03:51:50 +05:30
|
|
|
var supportsTrendingCategories: Bool {
|
|
|
|
self == .invidious
|
|
|
|
}
|
|
|
|
|
|
|
|
var supportsUserPlaylists: Bool {
|
2022-12-09 05:45:19 +05:30
|
|
|
self != .local
|
2022-04-10 20:37:10 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
var userPlaylistsEndpointIncludesVideos: Bool {
|
2021-10-21 03:51:50 +05:30
|
|
|
self == .invidious
|
|
|
|
}
|
2021-10-28 02:41:38 +05:30
|
|
|
|
2022-08-21 19:35:26 +05:30
|
|
|
var userPlaylistsUseChannelPlaylistEndpoint: Bool {
|
|
|
|
self == .piped
|
|
|
|
}
|
|
|
|
|
2022-05-22 03:59:51 +05:30
|
|
|
var userPlaylistsHaveVisibility: Bool {
|
|
|
|
self == .invidious
|
|
|
|
}
|
|
|
|
|
|
|
|
var userPlaylistsAreEditable: Bool {
|
|
|
|
self == .invidious
|
|
|
|
}
|
|
|
|
|
2021-10-28 02:41:38 +05:30
|
|
|
var hasFrontendURL: Bool {
|
|
|
|
self == .piped
|
|
|
|
}
|
2021-12-05 01:05:41 +05:30
|
|
|
|
2022-01-05 04:48:01 +05:30
|
|
|
var searchUsesIndexedPages: Bool {
|
|
|
|
self == .invidious
|
|
|
|
}
|
2022-06-25 04:18:57 +05:30
|
|
|
|
|
|
|
var supportsOpeningChannelsByName: Bool {
|
|
|
|
self == .piped
|
|
|
|
}
|
2022-07-22 03:22:09 +05:30
|
|
|
|
|
|
|
var allowsDisablingVidoesProxying: Bool {
|
|
|
|
self == .invidious
|
|
|
|
}
|
2022-11-10 22:41:28 +05:30
|
|
|
|
|
|
|
var supportsOpeningVideosByID: Bool {
|
2022-12-09 05:45:19 +05:30
|
|
|
self != .local
|
2022-11-10 22:41:28 +05:30
|
|
|
}
|
2021-10-21 03:51:50 +05:30
|
|
|
}
|