From ede41868962ffed386b0da694d14cdfe6cfdb34f Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Mon, 20 Oct 2025 22:15:48 -0700 Subject: Cleanup and a bunch of work to fix issues syncing, loading, and general bookmark states in TrackerView. Added search field (substring conjunctive filter on server/bookmark names and descriptions). --- Hotline/Shared/URLAdditions.swift | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 Hotline/Shared/URLAdditions.swift (limited to 'Hotline/Shared/URLAdditions.swift') diff --git a/Hotline/Shared/URLAdditions.swift b/Hotline/Shared/URLAdditions.swift deleted file mode 100644 index 1f25541..0000000 --- a/Hotline/Shared/URLAdditions.swift +++ /dev/null @@ -1,26 +0,0 @@ -import Foundation - -extension URL { - func generateUniqueFilePath(filename base: String) -> String { - let fileManager = FileManager.default - var finalName = base - var counter = 2 - - // Helper function to generate a new filename with a counter - func makeFileName() -> String { - let baseName = (base as NSString).deletingPathExtension - let extensionName = (base as NSString).pathExtension - return extensionName.isEmpty ? "\(baseName) \(counter)" : "\(baseName) \(counter).\(extensionName)" - } - - // Check if file exists and append counter until a unique name is found - var filePath = self.appending(component: finalName).path(percentEncoded: false) - while fileManager.fileExists(atPath: filePath) { - finalName = makeFileName() - filePath = self.appending(component: finalName).path(percentEncoded: false) - counter += 1 - } - - return filePath - } -} -- cgit