1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 14:20:32 +05:30

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] static let availableRates: [Float] = [0.5, 0.67, 0.8, 1, 1.25, 1.5, 2]
let logger = Logger(label: "stream.yattee.app") let logger = Logger(label: "stream.yattee.app")

View File

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

View File

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