Refactoring

This commit is contained in:
Leon Böttger committed 2025-04-04 20:26:09 +02:00
1 parent bb86ebc606
commit ce77e73428
2 files changed
+2 -14

No files matched your search

+1 -1
View File
@@ -282,7 +282,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
private func pressAcceptButton(transferID: String) {
if true || (!isPlusVersion() && transmissionCount() > 0) {
if false || (!isPlusVersion() && transmissionCount() > 0) {
self.continueTransmission(accept: true, transferID: transferID, storeInTemp: true)
log("Showing plus screen...")
+1 -13
View File
@@ -471,24 +471,12 @@ public class SaveFilesManager {
for file in files {
let fileName = file.lastPathComponent
var destinationURL = target.appendingPathComponent(fileName)
let destinationURL = target.appendingPathComponent(fileName)
if !filesFinishedDownloading.contains(destinationURL) {
log("File \(file) not finished downloading, skipping")
log("Pending files: \(filesFinishedDownloading)")
continue
}
var counter = 1
let fileExtension = destinationURL.pathExtension
let baseName = destinationURL.deletingPathExtension().lastPathComponent
while fileManager.fileExists(atPath: destinationURL.path) {
let newFileName = "\(baseName)-\(counter)"
let newFileNameWithExtension = fileExtension.isEmpty ? newFileName : "\(newFileName).\(fileExtension)"
destinationURL = target.appendingPathComponent(newFileNameWithExtension)
counter += 1
}
log("Moving file: \(file.lastPathComponent) to \(destinationURL.lastPathComponent)")
try fileManager.copyItem(at: file, to: destinationURL)