Stabilize iOS/watchOS/tvOS apps and add cross-platform audit remediation

This commit is contained in:
Trey t
2026-02-11 12:54:40 -06:00
parent e40275e694
commit acce712261
77 changed files with 2940 additions and 765 deletions

View File

@@ -31,6 +31,7 @@
1CC7CBCF2C21E42C001614B8 /* DataStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CC7CBCE2C21E42C001614B8 /* DataStore.swift */; };
1CC7CBD12C21E5FA001614B8 /* PlayerUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CC7CBD02C21E5FA001614B8 /* PlayerUIView.swift */; };
1CC7CBD32C21E678001614B8 /* ThotStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CC7CBD22C21E678001614B8 /* ThotStyle.swift */; };
D00200012E00000100000001 /* SharedCore in Frameworks */ = {isa = PBXBuildFile; productRef = D00200012E00000100000003 /* SharedCore */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -79,6 +80,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D00200012E00000100000001 /* SharedCore in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -177,6 +179,9 @@
dependencies = (
);
name = WekoutThotViewer;
packageProductDependencies = (
D00200012E00000100000003 /* SharedCore */,
);
productName = WekoutThotViewer;
productReference = 1CC0930B2C21DE760004E1E6 /* WekoutThotViewer.app */;
productType = "com.apple.product-type.application";
@@ -205,6 +210,9 @@
Base,
);
mainGroup = 1CC093022C21DE760004E1E6;
packageReferences = (
D00200012E00000100000002 /* XCLocalSwiftPackageReference "../SharedCore" */,
);
productRefGroup = 1CC0930C2C21DE760004E1E6 /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -258,6 +266,13 @@
};
/* End PBXSourcesBuildPhase section */
/* Begin XCLocalSwiftPackageReference section */
D00200012E00000100000002 /* XCLocalSwiftPackageReference "../SharedCore" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = ../SharedCore;
};
/* End XCLocalSwiftPackageReference section */
/* Begin XCBuildConfiguration section */
1CC093172C21DE770004E1E6 /* Debug */ = {
isa = XCBuildConfiguration;
@@ -387,6 +402,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"WekoutThotViewer/Preview Content\"";
DEVELOPMENT_TEAM = V3PF3M6B6U;
ENABLE_APP_INTENTS_METADATA_GENERATION = NO;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = WekoutThotViewer/Info.plist;
@@ -414,6 +430,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"WekoutThotViewer/Preview Content\"";
DEVELOPMENT_TEAM = V3PF3M6B6U;
ENABLE_APP_INTENTS_METADATA_GENERATION = NO;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = WekoutThotViewer/Info.plist;
@@ -434,6 +451,14 @@
};
/* End XCBuildConfiguration section */
/* Begin XCSwiftPackageProductDependency section */
D00200012E00000100000003 /* SharedCore */ = {
isa = XCSwiftPackageProductDependency;
package = D00200012E00000100000002 /* XCLocalSwiftPackageReference "../SharedCore" */;
productName = SharedCore;
};
/* End XCSwiftPackageProductDependency section */
/* Begin XCConfigurationList section */
1CC093062C21DE760004E1E6 /* Build configuration list for PBXProject "WekoutThotViewer" */ = {
isa = XCConfigurationList;

View File

@@ -14,17 +14,17 @@ struct ContentView: View {
@State var isUpdating = false
@ObservedObject var dataStore = DataStore.shared
@State var nsfwVideos: [NSFWVideo]?
@State var avPlayer = AVPlayer(url: URL(string: "https://dev.werkout.fitness/media/exercise_videos/2_Dumbbell_Lateral_Lunges.mp4")!)
@State private var showLoginView = false
@State var avPlayer = AVPlayer(url: URL(string: "https://dev.werkout.fitness/media/exercise_videos/2_Dumbbell_Lateral_Lunges.mp4") ?? URL(fileURLWithPath: "/dev/null"))
@State private var currentVideoURL: URL?
let videoEnded = NotificationCenter.default.publisher(for: NSNotification.Name.AVPlayerItemDidPlayToEndTime)
var body: some View {
VStack {
if isUpdating {
if isUpdating {
ProgressView()
.progressViewStyle(.circular)
}
ProgressView()
.progressViewStyle(.circular)
} else {
PlayerView(player: $avPlayer)
.onAppear{
@@ -37,8 +37,18 @@ struct ContentView: View {
}
}
.onAppear(perform: {
maybeUpdateShit()
maybeRefreshData()
})
.sheet(isPresented: $showLoginView) {
LoginView(completion: {
needsUpdating = true
maybeRefreshData()
})
.interactiveDismissDisabled()
}
.onDisappear {
avPlayer.pause()
}
}
func playRandomVideo() {
@@ -48,36 +58,48 @@ struct ContentView: View {
}
func playVideo(url: String) {
let url = URL(string: BaseURLs.currentBaseURL + url)
avPlayer = AVPlayer(url: url!)
guard let videoURL = URL(string: BaseURLs.currentBaseURL + url) else {
return
}
if currentVideoURL == videoURL {
avPlayer.seek(to: .zero)
avPlayer.isMuted = true
avPlayer.play()
return
}
currentVideoURL = videoURL
avPlayer = AVPlayer(url: videoURL)
avPlayer.isMuted = true
avPlayer.play()
}
func maybeUpdateShit() {
UserStore.shared.setTreyDevRegisterdUser()
func maybeRefreshData() {
guard UserStore.shared.token != nil else {
isUpdating = false
showLoginView = true
return
}
if UserStore.shared.token != nil{
if UserStore.shared.plannedWorkouts.isEmpty {
UserStore.shared.fetchPlannedWorkouts()
}
if needsUpdating {
self.isUpdating = true
dataStore.fetchAllData(completion: {
DispatchQueue.main.async {
guard let allNSFWVideos = dataStore.allNSFWVideos else {
return
}
self.nsfwVideos = allNSFWVideos
if UserStore.shared.plannedWorkouts.isEmpty {
UserStore.shared.fetchPlannedWorkouts()
}
if needsUpdating {
self.isUpdating = true
dataStore.fetchAllData(completion: {
DispatchQueue.main.async {
guard let allNSFWVideos = dataStore.allNSFWVideos else {
self.isUpdating = false
playRandomVideo()
return
}
self.nsfwVideos = allNSFWVideos
self.isUpdating = false
})
}
self.needsUpdating = false
playRandomVideo()
}
})
}
}
}