Various improvements

This commit is contained in:
Isaac 2025-02-28 13:43:43 +01:00
parent 4c0dc35661
commit 6a4b0854db
10 changed files with 63 additions and 31 deletions

View file

@ -32,7 +32,6 @@ public struct ExperimentalUISettings: Codable, Equatable {
public var knockoutWallpaper: Bool
public var foldersTabAtBottom: Bool
public var playerEmbedding: Bool
public var playlistPlayback: Bool
public var preferredVideoCodec: String?
public var disableVideoAspectScaling: Bool
public var enableVoipTcp: Bool
@ -65,6 +64,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
public var playerV2: Bool
public var devRequests: Bool
public var fakeAds: Bool
public var conferenceDebug: Bool
public static var defaultSettings: ExperimentalUISettings {
return ExperimentalUISettings(
@ -75,7 +75,6 @@ public struct ExperimentalUISettings: Codable, Equatable {
knockoutWallpaper: false,
foldersTabAtBottom: false,
playerEmbedding: false,
playlistPlayback: false,
preferredVideoCodec: nil,
disableVideoAspectScaling: false,
enableVoipTcp: false,
@ -107,7 +106,8 @@ public struct ExperimentalUISettings: Codable, Equatable {
autoBenchmarkReflectors: nil,
playerV2: false,
devRequests: false,
fakeAds: false
fakeAds: false,
conferenceDebug: false
)
}
@ -119,7 +119,6 @@ public struct ExperimentalUISettings: Codable, Equatable {
knockoutWallpaper: Bool,
foldersTabAtBottom: Bool,
playerEmbedding: Bool,
playlistPlayback: Bool,
preferredVideoCodec: String?,
disableVideoAspectScaling: Bool,
enableVoipTcp: Bool,
@ -151,7 +150,8 @@ public struct ExperimentalUISettings: Codable, Equatable {
autoBenchmarkReflectors: Bool?,
playerV2: Bool,
devRequests: Bool,
fakeAds: Bool
fakeAds: Bool,
conferenceDebug: Bool
) {
self.keepChatNavigationStack = keepChatNavigationStack
self.skipReadHistory = skipReadHistory
@ -160,7 +160,6 @@ public struct ExperimentalUISettings: Codable, Equatable {
self.knockoutWallpaper = knockoutWallpaper
self.foldersTabAtBottom = foldersTabAtBottom
self.playerEmbedding = playerEmbedding
self.playlistPlayback = playlistPlayback
self.preferredVideoCodec = preferredVideoCodec
self.disableVideoAspectScaling = disableVideoAspectScaling
self.enableVoipTcp = enableVoipTcp
@ -193,6 +192,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
self.playerV2 = playerV2
self.devRequests = devRequests
self.fakeAds = fakeAds
self.conferenceDebug = conferenceDebug
}
public init(from decoder: Decoder) throws {
@ -205,7 +205,6 @@ public struct ExperimentalUISettings: Codable, Equatable {
self.knockoutWallpaper = (try container.decodeIfPresent(Int32.self, forKey: "knockoutWallpaper") ?? 0) != 0
self.foldersTabAtBottom = (try container.decodeIfPresent(Int32.self, forKey: "foldersTabAtBottom") ?? 0) != 0
self.playerEmbedding = (try container.decodeIfPresent(Int32.self, forKey: "playerEmbedding") ?? 0) != 0
self.playlistPlayback = (try container.decodeIfPresent(Int32.self, forKey: "playlistPlayback") ?? 0) != 0
self.preferredVideoCodec = try container.decodeIfPresent(String.self.self, forKey: "preferredVideoCodec")
self.disableVideoAspectScaling = (try container.decodeIfPresent(Int32.self, forKey: "disableVideoAspectScaling") ?? 0) != 0
self.enableVoipTcp = (try container.decodeIfPresent(Int32.self, forKey: "enableVoipTcp") ?? 0) != 0
@ -238,6 +237,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
self.playerV2 = try container.decodeIfPresent(Bool.self, forKey: "playerV2") ?? false
self.devRequests = try container.decodeIfPresent(Bool.self, forKey: "devRequests") ?? false
self.fakeAds = try container.decodeIfPresent(Bool.self, forKey: "fakeAds") ?? false
self.conferenceDebug = try container.decodeIfPresent(Bool.self, forKey: "conferenceDebug") ?? false
}
public func encode(to encoder: Encoder) throws {
@ -250,7 +250,6 @@ public struct ExperimentalUISettings: Codable, Equatable {
try container.encode((self.knockoutWallpaper ? 1 : 0) as Int32, forKey: "knockoutWallpaper")
try container.encode((self.foldersTabAtBottom ? 1 : 0) as Int32, forKey: "foldersTabAtBottom")
try container.encode((self.playerEmbedding ? 1 : 0) as Int32, forKey: "playerEmbedding")
try container.encode((self.playlistPlayback ? 1 : 0) as Int32, forKey: "playlistPlayback")
try container.encodeIfPresent(self.preferredVideoCodec, forKey: "preferredVideoCodec")
try container.encode((self.disableVideoAspectScaling ? 1 : 0) as Int32, forKey: "disableVideoAspectScaling")
try container.encode((self.enableVoipTcp ? 1 : 0) as Int32, forKey: "enableVoipTcp")
@ -283,6 +282,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
try container.encodeIfPresent(self.playerV2, forKey: "playerV2")
try container.encodeIfPresent(self.devRequests, forKey: "devRequests")
try container.encodeIfPresent(self.fakeAds, forKey: "fakeAds")
try container.encodeIfPresent(self.conferenceDebug, forKey: "conferenceDebug")
}
}