diff --git a/.github/workflows/non-drm-build.yml b/.github/workflows/non-drm-build.yml index f0d76dc30..de4a32061 100644 --- a/.github/workflows/non-drm-build.yml +++ b/.github/workflows/non-drm-build.yml @@ -5,7 +5,7 @@ jobs: runs-on: macOS-13 steps: - name: Force Xcode 15 - run: sudo xcode-select -switch /Applications/Xcode_15.0.app + run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app - name: Checkout main repo uses: actions/checkout@v3 - name: Set up repo for nonDRM build diff --git a/.github/workflows/release-on-merge.yml b/.github/workflows/release-on-merge.yml index ba4e1bc58..08fa7bbb8 100644 --- a/.github/workflows/release-on-merge.yml +++ b/.github/workflows/release-on-merge.yml @@ -9,7 +9,7 @@ jobs: runs-on: macOS-13 steps: - name: Force Xcode 15 - run: sudo xcode-select -switch /Applications/Xcode_15.0.app + run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app - name: Checkout main repo and submodules uses: actions/checkout@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6de00d5ff..f92332c2d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ jobs: runs-on: macOS-13 steps: - name: Force Xcode 15 - run: sudo xcode-select -switch /Applications/Xcode_15.0.app + run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app - name: Checkout main repo and submodules uses: actions/checkout@v3 with: diff --git a/.github/workflows/unit-testing.yml b/.github/workflows/unit-testing.yml index ec98737ed..97b7d30b8 100644 --- a/.github/workflows/unit-testing.yml +++ b/.github/workflows/unit-testing.yml @@ -5,7 +5,7 @@ jobs: runs-on: macOS-13 steps: - name: Force Xcode 15 - run: sudo xcode-select -switch /Applications/Xcode_15.0.app + run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app - name: Checkout main repo and submodules uses: actions/checkout@v3 with: diff --git a/.github/workflows/upload-on-merge.yml b/.github/workflows/upload-on-merge.yml index 16b71ec96..15e93f8f7 100644 --- a/.github/workflows/upload-on-merge.yml +++ b/.github/workflows/upload-on-merge.yml @@ -9,7 +9,7 @@ jobs: runs-on: macOS-13 steps: - name: Force Xcode 15 - run: sudo xcode-select -switch /Applications/Xcode_15.0.app + run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app - name: Checkout main repo and submodules uses: actions/checkout@v3 with: @@ -28,7 +28,7 @@ jobs: if: github.event.pull_request.merged == true && needs.check-version.outputs.should_upload == '1' steps: - name: Force Xcode 15 - run: sudo xcode-select -switch /Applications/Xcode_15.0.app + run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app - name: Checkout main repo and submodules uses: actions/checkout@v3 with: diff --git a/.github/workflows/upload.yml b/.github/workflows/upload.yml index ed236904d..c76622414 100644 --- a/.github/workflows/upload.yml +++ b/.github/workflows/upload.yml @@ -5,7 +5,7 @@ jobs: runs-on: macOS-13 steps: - name: Force Xcode 15 - run: sudo xcode-select -switch /Applications/Xcode_15.0.app + run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app - name: Checkout main repo and submodules uses: actions/checkout@v3 with: @@ -24,7 +24,7 @@ jobs: if: needs.check-version.outputs.should_upload == '1' steps: - name: Force Xcode 15 - run: sudo xcode-select -switch /Applications/Xcode_15.0.app + run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app - name: Checkout main repo and submodules uses: actions/checkout@v3 with: diff --git a/Palace.xcodeproj/project.pbxproj b/Palace.xcodeproj/project.pbxproj index d6a185e9f..20f3316c7 100644 --- a/Palace.xcodeproj/project.pbxproj +++ b/Palace.xcodeproj/project.pbxproj @@ -3628,11 +3628,11 @@ inputFileListPaths = ( ); inputPaths = ( - "$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)", - "${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}/GoogleService-Info.plist", - "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}", "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}", + "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${PRODUCT_NAME}", "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist", + "$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/GoogleService-Info.plist", + "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)", ); name = Crashlytics; outputFileListPaths = ( @@ -3641,7 +3641,7 @@ ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "\"${PROJECT_DIR}/scripts/firebase/run\"\n"; + shellScript = "\"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run\"\n"; }; 73EB0B6E25821DF4006BC997 /* Copy Frameworks (Carthage) */ = { isa = PBXShellScriptBuildPhase; @@ -4537,7 +4537,7 @@ "\"$(SRCROOT)/adobe-rmsdk/xml/uft/public\"", ); INFOPLIST_FILE = PalaceTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -4602,7 +4602,7 @@ "\"$(SRCROOT)/adobe-rmsdk/xml/uft/public\"", ); INFOPLIST_FILE = PalaceTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -4642,7 +4642,7 @@ CODE_SIGN_IDENTITY = "Apple Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 210; + CURRENT_PROJECT_VERSION = 215; DEVELOPMENT_TEAM = 88CBA74T8K; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 88CBA74T8K; ENABLE_BITCODE = NO; @@ -4659,12 +4659,12 @@ "$(inherited)", ); INFOPLIST_FILE = "PalaceConfig/Palace-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.33; + MARKETING_VERSION = 1.0.34; PRODUCT_BUNDLE_IDENTIFIER = org.thepalaceproject.palace; PRODUCT_MODULE_NAME = Palace; PRODUCT_NAME = "Palace-noDRM"; @@ -4699,7 +4699,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Palace/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 210; + CURRENT_PROJECT_VERSION = 215; DEVELOPMENT_TEAM = 88CBA74T8K; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 88CBA74T8K; ENABLE_BITCODE = NO; @@ -4716,12 +4716,12 @@ "$(inherited)", ); INFOPLIST_FILE = "PalaceConfig/Palace-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.33; + MARKETING_VERSION = 1.0.34; PRODUCT_BUNDLE_IDENTIFIER = org.thepalaceproject.palace; PRODUCT_MODULE_NAME = Palace; PRODUCT_NAME = "Palace-noDRM"; @@ -4883,7 +4883,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 210; + CURRENT_PROJECT_VERSION = 215; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 88CBA74T8K; ENABLE_BITCODE = NO; @@ -4905,12 +4905,12 @@ "FEATURE_OVERDRIVE=1", ); INFOPLIST_FILE = "PalaceConfig/Palace-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.33; + MARKETING_VERSION = 1.0.34; PRODUCT_BUNDLE_IDENTIFIER = org.thepalaceproject.palace; PROVISIONING_PROFILE_SPECIFIER = "Ad Hoc"; RUN_CLANG_STATIC_ANALYZER = YES; @@ -4943,7 +4943,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Palace/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 210; + CURRENT_PROJECT_VERSION = 215; DEVELOPMENT_TEAM = 88CBA74T8K; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 88CBA74T8K; ENABLE_BITCODE = NO; @@ -4965,12 +4965,12 @@ "FEATURE_OVERDRIVE=1", ); INFOPLIST_FILE = "PalaceConfig/Palace-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.33; + MARKETING_VERSION = 1.0.34; PRODUCT_BUNDLE_IDENTIFIER = org.thepalaceproject.palace; PROVISIONING_PROFILE_SPECIFIER = "App Store"; RUN_CLANG_STATIC_ANALYZER = YES; diff --git a/Palace/Accounts/Library/Account.swift b/Palace/Accounts/Library/Account.swift index 116d58c1c..300fdf247 100644 --- a/Palace/Accounts/Library/Account.swift +++ b/Palace/Accounts/Library/Account.swift @@ -424,7 +424,10 @@ protocol AccountLogoDelegate: AnyObject { homePageUrl = publication.links.first(where: { $0.rel == "alternate" })?.href super.init() - loadLogo(imageURL: publication.thumbnailURL) + + DispatchQueue.main.async { + self.loadLogo(imageURL: publication.thumbnailURL) + } } /// Load authentication documents from the network or cache. diff --git a/Palace/AppInfrastructure/TPPAppDelegate.swift b/Palace/AppInfrastructure/TPPAppDelegate.swift index 39591ea60..ef656b6a0 100644 --- a/Palace/AppInfrastructure/TPPAppDelegate.swift +++ b/Palace/AppInfrastructure/TPPAppDelegate.swift @@ -70,9 +70,7 @@ class TPPAppDelegate: UIResponder, UIApplicationDelegate { _ = TPPBookRegistry.shared // Push Notificatoins - // TODO: Enable push notifications once they are fully tested here - // Disabling because of PP-473 -// NotificationService.shared.setupPushNotifications() + NotificationService.shared.setupPushNotifications() } // TODO: This method is deprecated, we should migrate to BGAppRefreshTask in the BackgroundTasks framework instead diff --git a/Palace/MyBooks/MyBooks/MyBooksViewModel.swift b/Palace/MyBooks/MyBooks/MyBooksViewModel.swift index 160d6cd17..9f45eedc0 100644 --- a/Palace/MyBooks/MyBooks/MyBooksViewModel.swift +++ b/Palace/MyBooks/MyBooks/MyBooksViewModel.swift @@ -110,7 +110,9 @@ class MyBooksViewModel: ObservableObject { } @objc private func stopLoading() { - isLoading.toggle() + DispatchQueue.main.async { + self.isLoading.toggle() + } } @objc private func bookRegistryDidChange() { diff --git a/Palace/Reader2/UI/EpubSearchView/EPUBSearchView.swift b/Palace/Reader2/UI/EpubSearchView/EPUBSearchView.swift index 3d279989a..27a1d2707 100644 --- a/Palace/Reader2/UI/EpubSearchView/EPUBSearchView.swift +++ b/Palace/Reader2/UI/EpubSearchView/EPUBSearchView.swift @@ -16,19 +16,12 @@ struct EPUBSearchView: View { @State private var searchQuery: String = "" @State private var debounceSearch: AnyCancellable? - var body: some View { - VStack { - searchBar - listView - } - .onChange(of: searchQuery, perform: search) - .padding() - .ignoresSafeArea(.keyboard) - } + @FocusState private var isSearchFieldFocused: Bool @ViewBuilder private var searchBar: some View { HStack { TextField("\(Strings.Generic.search)...", text: $searchQuery) + .focused($isSearchFieldFocused) // Bind the focus state to the text field Button(action: { searchQuery = "" viewModel.cancelSearch() @@ -42,6 +35,22 @@ struct EPUBSearchView: View { .background(Color(.secondarySystemBackground)) .cornerRadius(8) .padding(.bottom) + .onAppear { + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + // This delay ensures that the view is fully loaded before focusing + isSearchFieldFocused = true + } + } + } + + var body: some View { + VStack { + searchBar + listView + } + .onChange(of: searchQuery, perform: search) + .padding() + .ignoresSafeArea(.keyboard) } @ViewBuilder private var listView: some View { diff --git a/Palace/Settings/DeveloperSettings/TPPDeveloperSettingsTableViewController.swift b/Palace/Settings/DeveloperSettings/TPPDeveloperSettingsTableViewController.swift index ca9ca8a43..cccf722ee 100644 --- a/Palace/Settings/DeveloperSettings/TPPDeveloperSettingsTableViewController.swift +++ b/Palace/Settings/DeveloperSettings/TPPDeveloperSettingsTableViewController.swift @@ -15,7 +15,6 @@ import Foundation private let betaLibraryCellIdentifier = "betaLibraryCell" private let lcpPassphraseCellIdentifier = "lcpPassphraseCell" private let clearCacheCellIdentifier = "clearCacheCell" - private let enablePushNotificationsCellIdentifier = "enablePushNotificationsCell" private var pushNotificationsStatus = false @@ -35,15 +34,7 @@ import Foundation @objc func enterLCPPassphraseSwitchDidChange(sender: UISwitch) { TPPSettings.shared.enterLCPPassphraseManually = sender.isOn } - - @objc func enablePushNotificationsDidChange(sender: UISwitch) { - if sender.isOn { - NotificationService.shared.setupPushNotifications { _ in - self.updatePushNotificationStatus() - } - } - } - + // MARK:- UIViewController override func loadView() { @@ -58,33 +49,13 @@ import Foundation self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: betaLibraryCellIdentifier) self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: lcpPassphraseCellIdentifier) self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: clearCacheCellIdentifier) - self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: enablePushNotificationsCellIdentifier) - - updatePushNotificationStatus() - NotificationCenter.default.addObserver(forName: UIApplication.didBecomeActiveNotification, object: nil, queue: .main) { _ in - self.updatePushNotificationStatus() - } - } - - deinit { - NotificationCenter.default.removeObserver(self, name: UIApplication.didBecomeActiveNotification, object: nil) - } - - // Gets push notifications authorization status and updates the view - private func updatePushNotificationStatus() { - NotificationService.shared.getNotificationStatus { areEnabled in - DispatchQueue.main.async { - self.pushNotificationsStatus = areEnabled - self.tableView.reloadData() - } - } } // MARK:- UITableViewDataSource func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { switch Section(rawValue: section)! { - case .librarySettings: return 3 + case .librarySettings: return 2 default: return 1 } } @@ -98,8 +69,7 @@ import Foundation case .librarySettings: switch indexPath.row { case 0: return cellForBetaLibraries() - case 1: return cellForLCPPassphrase() - default: return cellForPushNotifications() + default: return cellForLCPPassphrase() } case .libraryRegistryDebugging: return cellForCustomRegsitry() case .dataManagement: return cellForClearCache() @@ -142,18 +112,6 @@ import Foundation return cell } - private func cellForPushNotifications() -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: enablePushNotificationsCellIdentifier)! - cell.selectionStyle = .none - cell.textLabel?.text = "Enable Push Notifications" - cell.textLabel?.adjustsFontSizeToFitWidth = true - cell.textLabel?.minimumScaleFactor = 0.5 - let pushNotificationSwitch = createSwitch(isOn: pushNotificationsStatus, action: #selector(enablePushNotificationsDidChange)) - pushNotificationSwitch.isEnabled = !pushNotificationsStatus - cell.accessoryView = pushNotificationSwitch - return cell - } - private func cellForCustomRegsitry() -> UITableViewCell { let cell = TPPRegistryDebuggingCell() cell.delegate = self diff --git a/PalaceTests/OPDS2CatalogsFeedTests.swift b/PalaceTests/OPDS2CatalogsFeedTests.swift index e48d37cab..82fc46060 100644 --- a/PalaceTests/OPDS2CatalogsFeedTests.swift +++ b/PalaceTests/OPDS2CatalogsFeedTests.swift @@ -70,146 +70,142 @@ class OPDS2CatalogsFeedTests: XCTestCase { XCTAssertEqual(errors, []) } + func testInitAccountsWithPublication() { + do { + let data = try Data(contentsOf: testFeedUrl) + let feed = try OPDS2CatalogsFeed.fromData(data) + + let gpl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "Glendora Public Library" })!) + let acl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "Alameda County Library" })!) + let dpl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "Digital Public Library of America" })!) + let nypl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "The New York Public Library" })!) + + XCTAssertEqual(gpl.name, "Glendora Public Library") + XCTAssertEqual(gpl.subtitle, "Connecting people to the world of ideas, information, and imagination") + XCTAssertEqual(gpl.uuid, "urn:uuid:a7bddadc-91c7-45a3-a642-dfd137480a22") + XCTAssertEqual(gpl.catalogUrl, "http://califa108.simplye-ca.org/CAGLEN/") + XCTAssertEqual(gpl.supportEmail!.rawValue, "library@glendoralibrary.org") + XCTAssertEqual(gpl.authenticationDocumentUrl, "http://califa108.simplye-ca.org/CAGLEN/authentication_document") + XCTAssertNotNil(gpl.logo) + + XCTAssertEqual(acl.name, "Alameda County Library") + XCTAssertEqual(acl.subtitle, "Infinite possibilities") + XCTAssertEqual(acl.uuid, "urn:uuid:bce4c73c-9d0b-4eac-92e1-1405bcee9367") + XCTAssertEqual(acl.catalogUrl, "http://acl.simplye-ca.org/CALMDA") + XCTAssertEqual(acl.supportEmail!.rawValue, "simplye@aclibrary.org") + XCTAssertEqual(acl.authenticationDocumentUrl, "http://acl.simplye-ca.org/CALMDA/authentication_document") + XCTAssertNotNil(acl.logo) + + XCTAssertEqual(dpl.name, "Digital Public Library of America") + XCTAssertEqual(dpl.subtitle, "Popular books free to download and keep, handpicked by librarians across the US.") + XCTAssertEqual(dpl.uuid, "urn:uuid:6b849570-070f-43b4-9dcc-7ebb4bca292e") + XCTAssertEqual(dpl.catalogUrl, "http://openbookshelf.dp.la/OB/groups/3") + XCTAssertEqual(dpl.supportEmail!.rawValue, "ebooks@dp.la") + XCTAssertEqual(dpl.authenticationDocumentUrl, "http://openbookshelf.dp.la/OB/authentication_document") + XCTAssertNotNil(dpl.logo) + + XCTAssertEqual(nypl.name, "The New York Public Library") + XCTAssertEqual(nypl.subtitle, "Inspiring lifelong learning, advancing knowledge, and strengthening our communities.") + XCTAssertEqual(nypl.uuid, "urn:uuid:065c0c11-0d0f-42a3-82e4-277b18786949") + XCTAssertEqual(nypl.catalogUrl, "https://circulation.librarysimplified.org/NYNYPL/") + XCTAssertEqual(nypl.supportEmail!.rawValue, "simplyehelp@nypl.org") + XCTAssertEqual(nypl.authenticationDocumentUrl, "https://circulation.librarysimplified.org/NYNYPL/authentication_document") + XCTAssertNotNil(nypl.logo) + + } catch (let error) { + XCTAssert(false, error.localizedDescription) + } + } - // TODO: Refactor code to remove logo loading in the init() function - // Otherwise, the test runs indefinitely in Github CI environment - -// func testInitAccountsWithPublication() { -// do { -// let data = try Data(contentsOf: testFeedUrl) -// let feed = try OPDS2CatalogsFeed.fromData(data) -// -// let gpl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "Glendora Public Library" })!) -// let acl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "Alameda County Library" })!) -// let dpl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "Digital Public Library of America" })!) -// let nypl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "The New York Public Library" })!) -// -// XCTAssertEqual(gpl.name, "Glendora Public Library") -// XCTAssertEqual(gpl.subtitle, "Connecting people to the world of ideas, information, and imagination") -// XCTAssertEqual(gpl.uuid, "urn:uuid:a7bddadc-91c7-45a3-a642-dfd137480a22") -// XCTAssertEqual(gpl.catalogUrl, "http://califa108.simplye-ca.org/CAGLEN/") -// XCTAssertEqual(gpl.supportEmail!.rawValue, "library@glendoralibrary.org") -// XCTAssertEqual(gpl.authenticationDocumentUrl, "http://califa108.simplye-ca.org/CAGLEN/authentication_document") -// XCTAssertNotNil(gpl.logo) -// -// XCTAssertEqual(acl.name, "Alameda County Library") -// XCTAssertEqual(acl.subtitle, "Infinite possibilities") -// XCTAssertEqual(acl.uuid, "urn:uuid:bce4c73c-9d0b-4eac-92e1-1405bcee9367") -// XCTAssertEqual(acl.catalogUrl, "http://acl.simplye-ca.org/CALMDA") -// XCTAssertEqual(acl.supportEmail!.rawValue, "simplye@aclibrary.org") -// XCTAssertEqual(acl.authenticationDocumentUrl, "http://acl.simplye-ca.org/CALMDA/authentication_document") -// XCTAssertNotNil(acl.logo) -// -// XCTAssertEqual(dpl.name, "Digital Public Library of America") -// XCTAssertEqual(dpl.subtitle, "Popular books free to download and keep, handpicked by librarians across the US.") -// XCTAssertEqual(dpl.uuid, "urn:uuid:6b849570-070f-43b4-9dcc-7ebb4bca292e") -// XCTAssertEqual(dpl.catalogUrl, "http://openbookshelf.dp.la/OB/groups/3") -// XCTAssertEqual(dpl.supportEmail!.rawValue, "ebooks@dp.la") -// XCTAssertEqual(dpl.authenticationDocumentUrl, "http://openbookshelf.dp.la/OB/authentication_document") -// XCTAssertNotNil(dpl.logo) -// -// XCTAssertEqual(nypl.name, "The New York Public Library") -// XCTAssertEqual(nypl.subtitle, "Inspiring lifelong learning, advancing knowledge, and strengthening our communities.") -// XCTAssertEqual(nypl.uuid, "urn:uuid:065c0c11-0d0f-42a3-82e4-277b18786949") -// XCTAssertEqual(nypl.catalogUrl, "https://circulation.librarysimplified.org/NYNYPL/") -// XCTAssertEqual(nypl.supportEmail!.rawValue, "simplyehelp@nypl.org") -// XCTAssertEqual(nypl.authenticationDocumentUrl, "https://circulation.librarysimplified.org/NYNYPL/authentication_document") -// XCTAssertNotNil(nypl.logo) -// -// } catch (let error) { -// XCTAssert(false, error.localizedDescription) -// } -// } -// -// func testAccountSetAuthenticationDocument() { -// do { -// let data = try Data(contentsOf: testFeedUrl) -// let feed = try OPDS2CatalogsFeed.fromData(data) -// -// let gpl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "Glendora Public Library" })!) -// let acl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "Alameda County Library" })!) -// let dpl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "Digital Public Library of America" })!) -// let nypl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "The New York Public Library" })!) -// -// gpl.authenticationDocument = try OPDS2AuthenticationDocument.fromData(try Data(contentsOf: gplAuthUrl)) -// acl.authenticationDocument = try OPDS2AuthenticationDocument.fromData(try Data(contentsOf: aclAuthUrl)) -// dpl.authenticationDocument = try OPDS2AuthenticationDocument.fromData(try Data(contentsOf: dplAuthUrl)) -// nypl.authenticationDocument = try OPDS2AuthenticationDocument.fromData(try Data(contentsOf: nyplAuthUrl)) -// -// XCTAssertEqual(gpl.details?.defaultAuth?.needsAuth, true) -// XCTAssertEqual(gpl.details?.uuid, gpl.uuid) -// XCTAssertEqual(gpl.details?.supportsReservations, true) -// XCTAssertEqual(gpl.details?.userProfileUrl, "http://califa108.simplye-ca.org/CAGLEN/patrons/me/") -// XCTAssertEqual(gpl.details?.supportsSimplyESync, true) -// XCTAssertEqual(gpl.details?.signUpUrl, URL(string:"https://catalog.ci.glendora.ca.us/polaris/patronaccount/selfregister.aspx?ctx=3.1033.0.0.1")) -// XCTAssertEqual(gpl.details?.supportsCardCreator, false) -// XCTAssertEqual(gpl.details?.getLicenseURL(.privacyPolicy), URL(string: "http://califa.org/privacy-policy")) -// XCTAssertEqual(gpl.details?.getLicenseURL(.eula), URL(string: "https://www.librarysimplified.org/EULA/")) -// XCTAssertEqual(gpl.details?.getLicenseURL(.contentLicenses), URL(string: "http://califa.org/third-party-content")) -// XCTAssertEqual(gpl.details?.getLicenseURL(.acknowledgements), nil) -// XCTAssertEqual(gpl.details?.mainColor, "blue") -// XCTAssertEqual(gpl.details?.defaultAuth?.supportsBarcodeScanner, true) -// XCTAssertEqual(gpl.details?.defaultAuth?.supportsBarcodeDisplay, true) -// XCTAssertEqual(gpl.details?.defaultAuth?.patronIDKeyboard, .numeric) -// XCTAssertEqual(gpl.details?.defaultAuth?.pinKeyboard, .numeric) -// XCTAssertEqual(gpl.details?.defaultAuth?.authPasscodeLength, 99) -// -// XCTAssertEqual(acl.details?.defaultAuth?.needsAuth, true) -// XCTAssertEqual(acl.details?.uuid, acl.uuid) -// XCTAssertEqual(acl.details?.supportsReservations, true) -// XCTAssertEqual(acl.details?.userProfileUrl, "http://acl.simplye-ca.org/CALMDA/patrons/me/") -// XCTAssertEqual(acl.details?.supportsSimplyESync, true) -// XCTAssertEqual(acl.details?.signUpUrl, nil) -// XCTAssertEqual(acl.details?.supportsCardCreator, false) -// XCTAssertEqual(acl.details?.getLicenseURL(.privacyPolicy), URL(string: "http://califa.org/privacy-policy")) -// XCTAssertEqual(acl.details?.getLicenseURL(.eula), URL(string: "https://www.librarysimplified.org/EULA/")) -// XCTAssertEqual(acl.details?.getLicenseURL(.contentLicenses), URL(string: "http://guides.aclibrary.org/TAC")) -// XCTAssertEqual(acl.details?.getLicenseURL(.acknowledgements), nil) -// XCTAssertEqual(acl.details?.mainColor, "lightblue") -// XCTAssertEqual(acl.details?.defaultAuth?.supportsBarcodeScanner, false) -// XCTAssertEqual(acl.details?.defaultAuth?.supportsBarcodeDisplay, false) -// XCTAssertEqual(acl.details?.defaultAuth?.patronIDKeyboard, .numeric) -// XCTAssertEqual(acl.details?.defaultAuth?.pinKeyboard, .standard) -// XCTAssertEqual(acl.details?.defaultAuth?.authPasscodeLength, 99) -// -// XCTAssertEqual(dpl.details?.auths.count, 0) -// XCTAssertNil(dpl.details?.defaultAuth) -// XCTAssertEqual(dpl.details?.uuid, dpl.uuid) -// XCTAssertEqual(dpl.details?.supportsReservations, false) -// XCTAssertEqual(dpl.details?.userProfileUrl, "http://openbookshelf.dp.la/OB/patrons/me/") -// XCTAssertEqual(dpl.details?.supportsSimplyESync, true) -// XCTAssertEqual(dpl.details?.signUpUrl, nil) -// XCTAssertEqual(dpl.details?.supportsCardCreator, false) -// XCTAssertEqual(dpl.details?.getLicenseURL(.privacyPolicy), nil) -// XCTAssertEqual(dpl.details?.getLicenseURL(.eula), nil) -// XCTAssertEqual(dpl.details?.getLicenseURL(.contentLicenses), nil) -// XCTAssertEqual(dpl.details?.getLicenseURL(.acknowledgements), nil) -// XCTAssertEqual(dpl.details?.mainColor, "cyan") -// -// XCTAssertEqual(nypl.details?.defaultAuth?.needsAuth, true) -// XCTAssertEqual(nypl.details?.uuid, nypl.uuid) -// XCTAssertEqual(nypl.details?.supportsReservations, true) -// XCTAssertEqual(nypl.details?.userProfileUrl, "https://circulation.librarysimplified.org/NYNYPL/patrons/me/") -// XCTAssertEqual(nypl.details?.supportsSimplyESync, true) -// XCTAssertNotNil(nypl.details?.signUpUrl) -// XCTAssertEqual(nypl.details?.signUpUrl, -// URL(string: "https://patrons.librarysimplified.org/")) -// XCTAssert(nypl.details?.supportsCardCreator ?? false) -// XCTAssertEqual(nypl.details?.getLicenseURL(.privacyPolicy), -// URL(string: "https://www.nypl.org/help/about-nypl/legal-notices/privacy-policy")) -// XCTAssertEqual(nypl.details?.getLicenseURL(.eula), URL(string: "https://librarysimplified.org/EULA/")) -// XCTAssertEqual(nypl.details?.getLicenseURL(.contentLicenses), -// URL(string: "https://librarysimplified.org/licenses/")) -// XCTAssertEqual(nypl.details?.mainColor, "red") -// XCTAssertEqual(nypl.details?.defaultAuth?.supportsBarcodeScanner, true) -// XCTAssertEqual(nypl.details?.defaultAuth?.supportsBarcodeDisplay, true) -// XCTAssertEqual(nypl.details?.defaultAuth?.patronIDKeyboard, .standard) -// XCTAssertEqual(nypl.details?.defaultAuth?.pinKeyboard, .standard) -// XCTAssertEqual(nypl.details?.defaultAuth?.authPasscodeLength, 12) -// -// } catch (let error) { -// XCTAssert(false, error.localizedDescription) -// } -// } + func testAccountSetAuthenticationDocument() { + do { + let data = try Data(contentsOf: testFeedUrl) + let feed = try OPDS2CatalogsFeed.fromData(data) + + let gpl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "Glendora Public Library" })!) + let acl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "Alameda County Library" })!) + let dpl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "Digital Public Library of America" })!) + let nypl = Account(publication: feed.catalogs.first(where: { $0.metadata.title == "The New York Public Library" })!) + + gpl.authenticationDocument = try OPDS2AuthenticationDocument.fromData(try Data(contentsOf: gplAuthUrl)) + acl.authenticationDocument = try OPDS2AuthenticationDocument.fromData(try Data(contentsOf: aclAuthUrl)) + dpl.authenticationDocument = try OPDS2AuthenticationDocument.fromData(try Data(contentsOf: dplAuthUrl)) + nypl.authenticationDocument = try OPDS2AuthenticationDocument.fromData(try Data(contentsOf: nyplAuthUrl)) + + XCTAssertEqual(gpl.details?.defaultAuth?.needsAuth, true) + XCTAssertEqual(gpl.details?.uuid, gpl.uuid) + XCTAssertEqual(gpl.details?.supportsReservations, true) + XCTAssertEqual(gpl.details?.userProfileUrl, "http://califa108.simplye-ca.org/CAGLEN/patrons/me/") + XCTAssertEqual(gpl.details?.supportsSimplyESync, true) + XCTAssertEqual(gpl.details?.signUpUrl, URL(string:"https://catalog.ci.glendora.ca.us/polaris/patronaccount/selfregister.aspx?ctx=3.1033.0.0.1")) + XCTAssertEqual(gpl.details?.supportsCardCreator, false) + XCTAssertEqual(gpl.details?.getLicenseURL(.privacyPolicy), URL(string: "http://califa.org/privacy-policy")) + XCTAssertEqual(gpl.details?.getLicenseURL(.eula), URL(string: "https://www.librarysimplified.org/EULA/")) + XCTAssertEqual(gpl.details?.getLicenseURL(.contentLicenses), URL(string: "http://califa.org/third-party-content")) + XCTAssertEqual(gpl.details?.getLicenseURL(.acknowledgements), nil) + XCTAssertEqual(gpl.details?.mainColor, "blue") + XCTAssertEqual(gpl.details?.defaultAuth?.supportsBarcodeScanner, true) + XCTAssertEqual(gpl.details?.defaultAuth?.supportsBarcodeDisplay, true) + XCTAssertEqual(gpl.details?.defaultAuth?.patronIDKeyboard, .numeric) + XCTAssertEqual(gpl.details?.defaultAuth?.pinKeyboard, .numeric) + XCTAssertEqual(gpl.details?.defaultAuth?.authPasscodeLength, 99) + + XCTAssertEqual(acl.details?.defaultAuth?.needsAuth, true) + XCTAssertEqual(acl.details?.uuid, acl.uuid) + XCTAssertEqual(acl.details?.supportsReservations, true) + XCTAssertEqual(acl.details?.userProfileUrl, "http://acl.simplye-ca.org/CALMDA/patrons/me/") + XCTAssertEqual(acl.details?.supportsSimplyESync, true) + XCTAssertEqual(acl.details?.signUpUrl, nil) + XCTAssertEqual(acl.details?.supportsCardCreator, false) + XCTAssertEqual(acl.details?.getLicenseURL(.privacyPolicy), URL(string: "http://califa.org/privacy-policy")) + XCTAssertEqual(acl.details?.getLicenseURL(.eula), URL(string: "https://www.librarysimplified.org/EULA/")) + XCTAssertEqual(acl.details?.getLicenseURL(.contentLicenses), URL(string: "http://guides.aclibrary.org/TAC")) + XCTAssertEqual(acl.details?.getLicenseURL(.acknowledgements), nil) + XCTAssertEqual(acl.details?.mainColor, "lightblue") + XCTAssertEqual(acl.details?.defaultAuth?.supportsBarcodeScanner, false) + XCTAssertEqual(acl.details?.defaultAuth?.supportsBarcodeDisplay, false) + XCTAssertEqual(acl.details?.defaultAuth?.patronIDKeyboard, .numeric) + XCTAssertEqual(acl.details?.defaultAuth?.pinKeyboard, .standard) + XCTAssertEqual(acl.details?.defaultAuth?.authPasscodeLength, 99) + + XCTAssertEqual(dpl.details?.auths.count, 0) + XCTAssertNil(dpl.details?.defaultAuth) + XCTAssertEqual(dpl.details?.uuid, dpl.uuid) + XCTAssertEqual(dpl.details?.supportsReservations, false) + XCTAssertEqual(dpl.details?.userProfileUrl, "http://openbookshelf.dp.la/OB/patrons/me/") + XCTAssertEqual(dpl.details?.supportsSimplyESync, true) + XCTAssertEqual(dpl.details?.signUpUrl, nil) + XCTAssertEqual(dpl.details?.supportsCardCreator, false) + XCTAssertEqual(dpl.details?.getLicenseURL(.privacyPolicy), nil) + XCTAssertEqual(dpl.details?.getLicenseURL(.eula), nil) + XCTAssertEqual(dpl.details?.getLicenseURL(.contentLicenses), nil) + XCTAssertEqual(dpl.details?.getLicenseURL(.acknowledgements), nil) + XCTAssertEqual(dpl.details?.mainColor, "cyan") + + XCTAssertEqual(nypl.details?.defaultAuth?.needsAuth, true) + XCTAssertEqual(nypl.details?.uuid, nypl.uuid) + XCTAssertEqual(nypl.details?.supportsReservations, true) + XCTAssertEqual(nypl.details?.userProfileUrl, "https://circulation.librarysimplified.org/NYNYPL/patrons/me/") + XCTAssertEqual(nypl.details?.supportsSimplyESync, true) + XCTAssertNotNil(nypl.details?.signUpUrl) + XCTAssertEqual(nypl.details?.signUpUrl, + URL(string: "https://patrons.librarysimplified.org/")) + XCTAssert(nypl.details?.supportsCardCreator ?? false) + XCTAssertEqual(nypl.details?.getLicenseURL(.privacyPolicy), + URL(string: "https://www.nypl.org/help/about-nypl/legal-notices/privacy-policy")) + XCTAssertEqual(nypl.details?.getLicenseURL(.eula), URL(string: "https://librarysimplified.org/EULA/")) + XCTAssertEqual(nypl.details?.getLicenseURL(.contentLicenses), + URL(string: "https://librarysimplified.org/licenses/")) + XCTAssertEqual(nypl.details?.mainColor, "red") + XCTAssertEqual(nypl.details?.defaultAuth?.supportsBarcodeScanner, true) + XCTAssertEqual(nypl.details?.defaultAuth?.supportsBarcodeDisplay, true) + XCTAssertEqual(nypl.details?.defaultAuth?.patronIDKeyboard, .standard) + XCTAssertEqual(nypl.details?.defaultAuth?.pinKeyboard, .standard) + XCTAssertEqual(nypl.details?.defaultAuth?.authPasscodeLength, 12) + + } catch (let error) { + XCTAssert(false, error.localizedDescription) + } + } } diff --git a/ios-audiobooktoolkit b/ios-audiobooktoolkit index f638dee94..71004bde2 160000 --- a/ios-audiobooktoolkit +++ b/ios-audiobooktoolkit @@ -1 +1 @@ -Subproject commit f638dee947c1998936be2cdf6fec76d1dd31cd8d +Subproject commit 71004bde2dcb45f2ea5e3daa4bbee403d85a68c5 diff --git a/ios-drm-audioengine b/ios-drm-audioengine index c20654105..a9a912a10 160000 --- a/ios-drm-audioengine +++ b/ios-drm-audioengine @@ -1 +1 @@ -Subproject commit c206541059f9e6412f3e0ccf45943ad75bc9895c +Subproject commit a9a912a1048c38d116f288ac30a13ca0bc39619b