Model improvements

This commit is contained in:
Arkadiusz Fal 2022-09-01 00:00:28 +02:00
parent dfe3fb81ea
commit f5016cc961
3 changed files with 7 additions and 2 deletions

View File

@ -45,6 +45,8 @@ final class PlayerModel: ObservableObject {
}
}
static var shared: PlayerModel!
static let availableRates: [Float] = [0.5, 0.67, 0.8, 1, 1.25, 1.5, 2]
let logger = Logger(label: "stream.yattee.app")

View File

@ -15,8 +15,6 @@ struct VideoCell: View {
#endif
@EnvironmentObject<AccountsModel> private var accounts
@EnvironmentObject<NavigationModel> private var navigation
@EnvironmentObject<PlayerModel> private var player
@EnvironmentObject<RecentsModel> private var recents
@EnvironmentObject<ThumbnailsModel> private var thumbnails
@ -29,6 +27,9 @@ struct VideoCell: View {
@Default(.watchedVideoBadgeColor) private var watchedVideoBadgeColor
@Default(.watchedVideoPlayNowBehavior) private var watchedVideoPlayNowBehavior
private var navigation: NavigationModel { .shared }
private var player: PlayerModel { .shared }
@FetchRequest private var watchRequest: FetchedResults<Watch>
init(video: Video) {

View File

@ -185,6 +185,8 @@ struct YatteeApp: App {
InstancesManifest.shared.setPublicAccount(countryOfPublicInstances!, accounts: accounts, asCurrent: accounts.current.isNil)
}
PlayerModel.shared = player
playlists.accounts = accounts
search.accounts = accounts
subscriptions.accounts = accounts