mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-28 22:43:55 -04:00
Remove unused file
This commit is contained in:
parent
c9734ccbe3
commit
944cd1e7bb
@ -3,7 +3,7 @@
|
|||||||
archiveVersion = 1;
|
archiveVersion = 1;
|
||||||
classes = {
|
classes = {
|
||||||
};
|
};
|
||||||
objectVersion = 60;
|
objectVersion = 55;
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
@ -140,7 +140,6 @@
|
|||||||
97008AB42974A5A70076E60C /* WikiMed.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WikiMed.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
97008AB42974A5A70076E60C /* WikiMed.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WikiMed.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
97008ABA2974A5BF0076E60C /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
97008ABA2974A5BF0076E60C /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
97008ABC2974A5BF0076E60C /* OPDSParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OPDSParserTests.swift; sourceTree = "<group>"; };
|
97008ABC2974A5BF0076E60C /* OPDSParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OPDSParserTests.swift; sourceTree = "<group>"; };
|
||||||
970258B328FE418A00B68E84 /* BookmarkOperations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarkOperations.swift; sourceTree = "<group>"; };
|
|
||||||
9707541A23C2D3AB0076B74E /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
|
9707541A23C2D3AB0076B74E /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
|
||||||
970885D0271339A300C5795C /* wikipedia_dark.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = wikipedia_dark.css; sourceTree = "<group>"; };
|
970885D0271339A300C5795C /* wikipedia_dark.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = wikipedia_dark.css; sourceTree = "<group>"; };
|
||||||
9709C0972A8E4C5700E4564C /* Commands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Commands.swift; sourceTree = "<group>"; };
|
9709C0972A8E4C5700E4564C /* Commands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Commands.swift; sourceTree = "<group>"; };
|
||||||
@ -365,7 +364,6 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
97B3998724673FCA00BC6F5B /* SearchOperation */,
|
97B3998724673FCA00BC6F5B /* SearchOperation */,
|
||||||
970258B328FE418A00B68E84 /* BookmarkOperations.swift */,
|
|
||||||
9735D0BB2775594700C7D495 /* Database.swift */,
|
9735D0BB2775594700C7D495 /* Database.swift */,
|
||||||
9753D947285B55F100A626CC /* DefaultKeys.swift */,
|
9753D947285B55F100A626CC /* DefaultKeys.swift */,
|
||||||
9779A5CF2456796A00F6F6FF /* DirectoryMonitor.swift */,
|
9779A5CF2456796A00F6F6FF /* DirectoryMonitor.swift */,
|
||||||
@ -600,7 +598,7 @@
|
|||||||
buildConfigurationList = 972DE4B32814A3D9004FD9B9 /* Build configuration list for PBXNativeTarget "Kiwix" */;
|
buildConfigurationList = 972DE4B32814A3D9004FD9B9 /* Build configuration list for PBXNativeTarget "Kiwix" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
97E88F502AE409630037F0E5 /* Run Script */,
|
97E88F502AE409630037F0E5 /* Run Script */,
|
||||||
972096E52AE41ED000B378B0 /* ShellScript */,
|
972096E52AE41ED000B378B0 /* Run Script */,
|
||||||
972DE4A22814A3D8004FD9B9 /* Sources */,
|
972DE4A22814A3D8004FD9B9 /* Sources */,
|
||||||
972DE4A32814A3D8004FD9B9 /* Frameworks */,
|
972DE4A32814A3D8004FD9B9 /* Frameworks */,
|
||||||
972DE4A42814A3D8004FD9B9 /* Resources */,
|
972DE4A42814A3D8004FD9B9 /* Resources */,
|
||||||
@ -724,7 +722,7 @@
|
|||||||
/* End PBXResourcesBuildPhase section */
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXShellScriptBuildPhase section */
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
972096E52AE41ED000B378B0 /* ShellScript */ = {
|
972096E52AE41ED000B378B0 /* Run Script */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
alwaysOutOfDate = 1;
|
alwaysOutOfDate = 1;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
//
|
|
||||||
// BookmarkOperations.swift
|
|
||||||
// Kiwix
|
|
||||||
//
|
|
||||||
// Created by Chris Li on 10/17/22.
|
|
||||||
// Copyright © 2022 Chris Li. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
|
|
||||||
struct BookmarkOperations {
|
|
||||||
/// Create bookmark for an article
|
|
||||||
/// - Parameter url: url of the article to bookmark
|
|
||||||
static func create(_ url: URL?, withNotification: Bool = true) {
|
|
||||||
guard let url = url else { return }
|
|
||||||
let context = Database.shared.container.viewContext
|
|
||||||
let bookmark = Bookmark(context: context)
|
|
||||||
DispatchQueue.global().sync {
|
|
||||||
bookmark.articleURL = url
|
|
||||||
bookmark.created = Date()
|
|
||||||
if let parser = try? HTMLParser(url: url) {
|
|
||||||
bookmark.title = parser.title ?? ""
|
|
||||||
bookmark.snippet = parser.getFirstSentence(languageCode: nil)?.string
|
|
||||||
guard let zimFileID = url.host,
|
|
||||||
let zimFileID = UUID(uuidString: zimFileID),
|
|
||||||
let zimFile = try? context.fetch(ZimFile.fetchRequest(fileID: zimFileID)).first else { return }
|
|
||||||
bookmark.zimFile = zimFile
|
|
||||||
if let imagePath = parser.getFirstImagePath() {
|
|
||||||
bookmark.thumbImageURL = URL(zimFileID: zimFileID.uuidString, contentPath: imagePath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try? context.save()
|
|
||||||
if withNotification {
|
|
||||||
NotificationCenter.default.post(name: ReadingViewModel.bookmarkNotificationName, object: url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Delete an article bookmark
|
|
||||||
/// - Parameter url: url of the article to delete bookmark
|
|
||||||
static func delete(_ url: URL?, withNotification: Bool = true) {
|
|
||||||
guard let url = url else { return }
|
|
||||||
let context = Database.shared.container.viewContext
|
|
||||||
let request = Bookmark.fetchRequest(predicate: NSPredicate(format: "articleURL == %@", url as CVarArg))
|
|
||||||
guard let bookmark = try? context.fetch(request).first else { return }
|
|
||||||
context.delete(bookmark)
|
|
||||||
try? context.save()
|
|
||||||
if withNotification {
|
|
||||||
NotificationCenter.default.post(name: ReadingViewModel.bookmarkNotificationName, object: nil)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user