From 1f328f74157ec54dc3050ebce4b9d2a3b09800c5 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 5 May 2026 16:40:11 +1000 Subject: [PATCH 1/3] Add Codable round-trip tests for shared DTOs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `CommonUpNextItem` and `SiriPodcastItem` are passed across process boundaries (main app ↔ widget extension, main app ↔ intents extension) via App Group storage and Siri shortcut payloads. The Codable representation is the wire format, so a field rename or type change would silently break the consumers at runtime. Lock the contract with explicit round-trip tests now, before extracting the types into a new shared SPM module. The tests will move alongside the types in a follow-up commit. --- Generated with the help of Claude Code, https://code.claude.com Co-Authored-By: Claude Opus 4.7 (1M context) --- .../SharedModels/CommonUpNextItemTests.swift | 42 +++++++++++++++++++ .../SharedModels/SiriPodcastItemTests.swift | 17 ++++++++ 2 files changed, 59 insertions(+) create mode 100644 PocketCastsTests/Tests/SharedModels/CommonUpNextItemTests.swift create mode 100644 PocketCastsTests/Tests/SharedModels/SiriPodcastItemTests.swift diff --git a/PocketCastsTests/Tests/SharedModels/CommonUpNextItemTests.swift b/PocketCastsTests/Tests/SharedModels/CommonUpNextItemTests.swift new file mode 100644 index 0000000000..eeb1209c39 --- /dev/null +++ b/PocketCastsTests/Tests/SharedModels/CommonUpNextItemTests.swift @@ -0,0 +1,42 @@ +import Foundation +@testable import podcasts +import XCTest + +final class CommonUpNextItemTests: XCTestCase { + // CommonUpNextItem crosses process boundaries via App Group UserDefaults + // (main app writes, widget/intents extension reads). The Codable contract + // is the wire format — guard it explicitly. + func testRoundTripsThroughJSONCoding() throws { + let original = CommonUpNextItem( + episodeUuid: "episode-uuid", + imageUrl: "https://example.com/image.png", + episodeTitle: "Episode Title", + podcastName: "Podcast Name", + podcastColor: "#FF0000", + duration: 1234.5, + isPlaying: true + ) + + let data = try JSONEncoder().encode(original) + let decoded = try JSONDecoder().decode(CommonUpNextItem.self, from: data) + + XCTAssertEqual(decoded, original) + } + + func testRoundTripsWhenNotPlaying() throws { + let original = CommonUpNextItem( + episodeUuid: "uuid", + imageUrl: "url", + episodeTitle: "title", + podcastName: "name", + podcastColor: "color", + duration: 0, + isPlaying: false + ) + + let data = try JSONEncoder().encode(original) + let decoded = try JSONDecoder().decode(CommonUpNextItem.self, from: data) + + XCTAssertEqual(decoded, original) + } +} diff --git a/PocketCastsTests/Tests/SharedModels/SiriPodcastItemTests.swift b/PocketCastsTests/Tests/SharedModels/SiriPodcastItemTests.swift new file mode 100644 index 0000000000..8effdc6cf1 --- /dev/null +++ b/PocketCastsTests/Tests/SharedModels/SiriPodcastItemTests.swift @@ -0,0 +1,17 @@ +import Foundation +@testable import podcasts +import XCTest + +final class SiriPodcastItemTests: XCTestCase { + // SiriPodcastItem crosses the boundary between the main app and the + // PodcastsIntents extension. The Codable contract is the wire format. + func testRoundTripsThroughJSONCoding() throws { + let original = SiriPodcastItem(name: "Podcast Name", uuid: "podcast-uuid") + + let data = try JSONEncoder().encode(original) + let decoded = try JSONDecoder().decode(SiriPodcastItem.self, from: data) + + XCTAssertEqual(decoded.name, original.name) + XCTAssertEqual(decoded.uuid, original.uuid) + } +} From 50761deb2799e785d7e707c46a06739ff1a3ef4e Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 5 May 2026 16:53:23 +1000 Subject: [PATCH 2/3] Extract CommonUpNextItem into shared module Seeds a new `PocketCastsSharedModels` SPM module and moves `CommonUpNextItem` into it as the kernel of cross-target sharing. The DTO was previously a member of three Xcode targets via target membership in `podcasts.xcodeproj` (`podcasts`, `WidgetExtension`, `PodcastsIntents`). That pattern compiles the same source three times and gives every target a private copy of the type, which is brittle: a rename or signature change must be coordinated across copies, and divergence is invisible until something fails at the App Group / process boundary the type was meant to cross. Owning the type in a real module replaces three copies with one, gives us a place to test the wire format, and proves the wiring for follow-up moves. `SiriPodcastItem` lands next in a separate commit using the same pattern; `SharedConstants` is a future move that will pull `Share Extension` into the SPM `XcodeSupport` list. The module test target is registered in `UnitTests.xctestplan` so `-only-testing:PocketCastsSharedModelsTests` runs under the `Pocket Casts Staging` scheme alongside the other module tests. --- Generated with the help of Claude Code, https://code.claude.com Co-Authored-By: Claude Opus 4.7 (1M context) --- Modules/Package.swift | 16 ++++++++++ .../CommonUpNextItem.swift | 29 +++++++++++++++++++ .../CommonUpNextItemTests.swift | 2 +- PocketCastsTests/UnitTests.xctestplan | 7 +++++ PodcastsIntents/PlayMediaIntentHandler.swift | 1 + .../Common/CommonWidgetHelper.swift | 1 + WidgetExtension/Data/WidgetEpisode.swift | 1 + .../Now Playing/NowPlayingEntryView.swift | 3 +- podcasts.xcodeproj/project.pbxproj | 8 ----- podcasts/CommonUpNextItem.swift | 11 ------- podcasts/WidgetHelper.swift | 1 + 11 files changed, 59 insertions(+), 21 deletions(-) create mode 100644 Modules/Sources/PocketCastsSharedModels/CommonUpNextItem.swift rename {PocketCastsTests/Tests/SharedModels => Modules/Tests/PocketCastsSharedModelsTests}/CommonUpNextItemTests.swift (97%) delete mode 100644 podcasts/CommonUpNextItem.swift diff --git a/Modules/Package.swift b/Modules/Package.swift index 17071d18f4..05fccefdb1 100644 --- a/Modules/Package.swift +++ b/Modules/Package.swift @@ -21,6 +21,10 @@ let package = Package( name: "PocketCastsUtils", targets: ["PocketCastsUtils"] ), + .library( + name: "PocketCastsSharedModels", + targets: ["PocketCastsSharedModels"] + ), .library( name: "PocketCastsDataModel", targets: ["PocketCastsDataModel"] @@ -105,6 +109,15 @@ let package = Package( dependencies: ["PocketCastsUtils"], path: "Tests/PocketCastsUtilsTests" ), + .target( + name: "PocketCastsSharedModels", + path: "Sources/PocketCastsSharedModels" + ), + .testTarget( + name: "PocketCastsSharedModelsTests", + dependencies: ["PocketCastsSharedModels"], + path: "Tests/PocketCastsSharedModelsTests" + ), .target( name: "PocketCastsDataModel", dependencies: [ @@ -215,6 +228,7 @@ enum XcodeSupport { "PocketCastsDataModel", "PocketCastsServer", "PocketCastsUtils", + "PocketCastsSharedModels", "PocketCastsDependencyInjection", "EventHorizonSDK", .product(name: "Lottie", package: "lottie-ios"), @@ -273,6 +287,7 @@ enum XcodeSupport { .xcodeTarget( XcodeTargetNames.podcastsIntents, dependencies: [ + "PocketCastsSharedModels", .product(name: "Fuse", package: "fuse-swift"), ] ), @@ -286,6 +301,7 @@ enum XcodeSupport { XcodeTargetNames.widgetExtension, dependencies: [ "PocketCastsUtils", + "PocketCastsSharedModels", ] ), .xcodeTarget( diff --git a/Modules/Sources/PocketCastsSharedModels/CommonUpNextItem.swift b/Modules/Sources/PocketCastsSharedModels/CommonUpNextItem.swift new file mode 100644 index 0000000000..490224d315 --- /dev/null +++ b/Modules/Sources/PocketCastsSharedModels/CommonUpNextItem.swift @@ -0,0 +1,29 @@ +import Foundation + +public struct CommonUpNextItem: Codable, Hashable { + public var episodeUuid: String + public var imageUrl: String + public var episodeTitle: String + public var podcastName: String + public var podcastColor: String + public var duration: TimeInterval + public var isPlaying: Bool + + public init( + episodeUuid: String, + imageUrl: String, + episodeTitle: String, + podcastName: String, + podcastColor: String, + duration: TimeInterval, + isPlaying: Bool = false + ) { + self.episodeUuid = episodeUuid + self.imageUrl = imageUrl + self.episodeTitle = episodeTitle + self.podcastName = podcastName + self.podcastColor = podcastColor + self.duration = duration + self.isPlaying = isPlaying + } +} diff --git a/PocketCastsTests/Tests/SharedModels/CommonUpNextItemTests.swift b/Modules/Tests/PocketCastsSharedModelsTests/CommonUpNextItemTests.swift similarity index 97% rename from PocketCastsTests/Tests/SharedModels/CommonUpNextItemTests.swift rename to Modules/Tests/PocketCastsSharedModelsTests/CommonUpNextItemTests.swift index eeb1209c39..5fea1a5092 100644 --- a/PocketCastsTests/Tests/SharedModels/CommonUpNextItemTests.swift +++ b/Modules/Tests/PocketCastsSharedModelsTests/CommonUpNextItemTests.swift @@ -1,5 +1,5 @@ import Foundation -@testable import podcasts +@testable import PocketCastsSharedModels import XCTest final class CommonUpNextItemTests: XCTestCase { diff --git a/PocketCastsTests/UnitTests.xctestplan b/PocketCastsTests/UnitTests.xctestplan index 88256bea82..95fd0a194f 100644 --- a/PocketCastsTests/UnitTests.xctestplan +++ b/PocketCastsTests/UnitTests.xctestplan @@ -51,6 +51,13 @@ "identifier" : "PocketCastsUtilsTests", "name" : "PocketCastsUtilsTests" } + }, + { + "target" : { + "containerPath" : "container:Modules", + "identifier" : "PocketCastsSharedModelsTests", + "name" : "PocketCastsSharedModelsTests" + } } ], "version" : 1 diff --git a/PodcastsIntents/PlayMediaIntentHandler.swift b/PodcastsIntents/PlayMediaIntentHandler.swift index 841b89ba58..6356bab58d 100644 --- a/PodcastsIntents/PlayMediaIntentHandler.swift +++ b/PodcastsIntents/PlayMediaIntentHandler.swift @@ -1,6 +1,7 @@ import CoreSpotlight import Intents import MediaPlayer +import PocketCastsSharedModels import UIKit class PlayMediaIntentHandler: NSObject, INPlayMediaIntentHandling { diff --git a/WidgetExtension/Common/CommonWidgetHelper.swift b/WidgetExtension/Common/CommonWidgetHelper.swift index fa41d578e8..bd740dfd64 100644 --- a/WidgetExtension/Common/CommonWidgetHelper.swift +++ b/WidgetExtension/Common/CommonWidgetHelper.swift @@ -1,4 +1,5 @@ import Foundation +import PocketCastsSharedModels import PocketCastsUtils import UIKit diff --git a/WidgetExtension/Data/WidgetEpisode.swift b/WidgetExtension/Data/WidgetEpisode.swift index 64c632310c..c7b2aa06b3 100644 --- a/WidgetExtension/Data/WidgetEpisode.swift +++ b/WidgetExtension/Data/WidgetEpisode.swift @@ -1,4 +1,5 @@ import Foundation +import PocketCastsSharedModels import SwiftUI class WidgetEpisode: ObservableObject, Hashable { diff --git a/WidgetExtension/Now Playing/NowPlayingEntryView.swift b/WidgetExtension/Now Playing/NowPlayingEntryView.swift index d6cc026136..f10df6e140 100644 --- a/WidgetExtension/Now Playing/NowPlayingEntryView.swift +++ b/WidgetExtension/Now Playing/NowPlayingEntryView.swift @@ -1,6 +1,7 @@ import Foundation -import WidgetKit +import PocketCastsSharedModels import SwiftUI +import WidgetKit struct NowPlayingWidgetEntryView: View { @State var entry: NowPlayingProvider.Entry diff --git a/podcasts.xcodeproj/project.pbxproj b/podcasts.xcodeproj/project.pbxproj index d1ef715097..121c212d79 100644 --- a/podcasts.xcodeproj/project.pbxproj +++ b/podcasts.xcodeproj/project.pbxproj @@ -105,10 +105,8 @@ 4029E3E42293AD410003BEEB /* ChangePasswordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4029E3E22293AD410003BEEB /* ChangePasswordViewController.swift */; }; 4029E3E52293AD410003BEEB /* ChangePasswordViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4029E3E32293AD410003BEEB /* ChangePasswordViewController.xib */; }; 403086D02378EB1F009EF821 /* UpNextViewController+UserEpisode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 403086CF2378EB1F009EF821 /* UpNextViewController+UserEpisode.swift */; }; - 40334805240C83D200EE338E /* CommonUpNextItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD44A4442302DAC6004F55B2 /* CommonUpNextItem.swift */; }; 4034503324BF33B6001265E2 /* ListeningHistoryViewController+MultiSelect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4034503224BF33B4001265E2 /* ListeningHistoryViewController+MultiSelect.swift */; }; 4036B06E25240CC600AE08E6 /* SharedConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD054A791E3EDEB300D9195B /* SharedConstants.swift */; }; - 4036B09325240CD100AE08E6 /* CommonUpNextItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD44A4442302DAC6004F55B2 /* CommonUpNextItem.swift */; }; 4036B0A425240F5D00AE08E6 /* WidgetHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4036B0A325240F5D00AE08E6 /* WidgetHelper.swift */; }; 403946E72285231100F55162 /* AddCustomViewController+ImagePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 403946E62285231100F55162 /* AddCustomViewController+ImagePicker.swift */; }; 403946E9228587FC00F55162 /* AddCustomViewController+CollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 403946E8228587FC00F55162 /* AddCustomViewController+CollectionView.swift */; }; @@ -614,7 +612,6 @@ BD42E31A1B940AFF000EA14F /* DiscoverPodcastTableCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD42E3181B940AFF000EA14F /* DiscoverPodcastTableCell.swift */; }; BD42E31B1B940AFF000EA14F /* DiscoverPodcastTableCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BD42E3191B940AFF000EA14F /* DiscoverPodcastTableCell.xib */; }; BD43BDE72122AD0600E63165 /* skip_button.json in Resources */ = {isa = PBXBuildFile; fileRef = BD43BDE52122AD0600E63165 /* skip_button.json */; }; - BD44A4452302DAC6004F55B2 /* CommonUpNextItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD44A4442302DAC6004F55B2 /* CommonUpNextItem.swift */; }; BD44E36D20937D9C008BD7F0 /* PodcastChapterParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD44E36C20937D9C008BD7F0 /* PodcastChapterParser.swift */; }; BD47E7FA1DD57F7B00C18EE7 /* ShowNotesFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD47E7F91DD57F7B00C18EE7 /* ShowNotesFormatter.swift */; }; BD48D5A6216DB26A00391F9E /* HapticsHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD48D5A5216DB26A00391F9E /* HapticsHelper.swift */; }; @@ -2130,7 +2127,6 @@ BD42E3181B940AFF000EA14F /* DiscoverPodcastTableCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DiscoverPodcastTableCell.swift; sourceTree = ""; }; BD42E3191B940AFF000EA14F /* DiscoverPodcastTableCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DiscoverPodcastTableCell.xib; sourceTree = ""; }; BD43BDE52122AD0600E63165 /* skip_button.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = skip_button.json; sourceTree = ""; }; - BD44A4442302DAC6004F55B2 /* CommonUpNextItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonUpNextItem.swift; sourceTree = ""; }; BD44E36C20937D9C008BD7F0 /* PodcastChapterParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PodcastChapterParser.swift; sourceTree = ""; }; BD47E7F91DD57F7B00C18EE7 /* ShowNotesFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShowNotesFormatter.swift; sourceTree = ""; }; BD48D5A5216DB26A00391F9E /* HapticsHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HapticsHelper.swift; sourceTree = ""; }; @@ -3936,7 +3932,6 @@ BDF15A451B54E21B000EC323 /* PlaybackEffects.swift */, 8BB4AA622BD17EC10091480A /* FadeOutManager.swift */, 8B1B782A2BC7104000DC3373 /* SleepTimerManager.swift */, - BD44A4442302DAC6004F55B2 /* CommonUpNextItem.swift */, BD2219F0253EAEAF000025BE /* PlaybackCatchUpHelper.swift */, C725285E299B315000A582C3 /* BookmarkManager.swift */, ); @@ -6685,7 +6680,6 @@ files = ( 40043F0D23FDFD91004A9B57 /* SiriPodcastItem.swift in Sources */, 46FBD8B6276A874F00867746 /* Intents.intentdefinition in Sources */, - 40334805240C83D200EE338E /* CommonUpNextItem.swift in Sources */, 40043F0F23FE08B8004A9B57 /* SharedConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -6711,7 +6705,6 @@ 8BC0600E2AB2219700A4FEC6 /* WidgetPlayEpisodeIntentExtension.swift in Sources */, 8BC060092AB1FA0D00A4FEC6 /* PlayEpisodeIntent.swift in Sources */, 463538F526F2415300BA9D35 /* Strings+L10n.swift in Sources */, - 4036B09325240CD100AE08E6 /* CommonUpNextItem.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -7282,7 +7275,6 @@ BDD71CF41BA935E8006D2CE3 /* NetworkViewController.swift in Sources */, FF2142D42C07369200672D8D /* MediaExporter.swift in Sources */, 109446762CEB3A8100977161 /* CancelSubscriptionViewModel.swift in Sources */, - BD44A4452302DAC6004F55B2 /* CommonUpNextItem.swift in Sources */, 100C99552CE7B801008D73E9 /* CancelSubscriptionView.swift in Sources */, BDA2065D1BB3AF5D00D38389 /* DownloadProgress.swift in Sources */, 407083C625423F0A002FC9F8 /* EpisodePreviewCell.swift in Sources */, diff --git a/podcasts/CommonUpNextItem.swift b/podcasts/CommonUpNextItem.swift deleted file mode 100644 index c6a53461f8..0000000000 --- a/podcasts/CommonUpNextItem.swift +++ /dev/null @@ -1,11 +0,0 @@ -import Foundation - -struct CommonUpNextItem: Codable, Hashable { - var episodeUuid: String - var imageUrl: String - var episodeTitle: String - var podcastName: String - var podcastColor: String - var duration: TimeInterval - var isPlaying: Bool = false -} diff --git a/podcasts/WidgetHelper.swift b/podcasts/WidgetHelper.swift index e0b13a8231..56e78eb019 100644 --- a/podcasts/WidgetHelper.swift +++ b/podcasts/WidgetHelper.swift @@ -1,6 +1,7 @@ import PocketCastsDataModel import PocketCastsServer +import PocketCastsSharedModels import PocketCastsUtils import WidgetKit From 6a9afd1a5ceb462b9b811515b7627e635179a3b4 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 5 May 2026 16:57:07 +1000 Subject: [PATCH 3/3] Move SiriPodcastItem into shared module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same playbook as `CommonUpNextItem`: lift the DTO out of the multi-target-membership pattern and into `PocketCastsSharedModels`. The file was a member of `podcasts`, `PodcastsIntents`, and `PodcastsIntentsUI` in `podcasts.xcodeproj`, but `PodcastsIntentsUI` contains no source that actually references the type — that membership was stale. The new module is added as a SwiftPM dependency only on `podcasts` and `PodcastsIntents`; `PodcastsIntentsUI` keeps the dependency list it already had. --- Generated with the help of Claude Code, https://code.claude.com Co-Authored-By: Claude Opus 4.7 (1M context) --- .../PocketCastsSharedModels/SiriPodcastItem.swift | 11 +++++++++++ .../SiriPodcastItemTests.swift | 2 +- PodcastsIntents/SiriPodcastSearchManager.swift | 1 + podcasts.xcodeproj/project.pbxproj | 8 -------- podcasts/SiriPodcastItem.swift | 4 ---- podcasts/SiriShortcutsManager.swift | 1 + 6 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 Modules/Sources/PocketCastsSharedModels/SiriPodcastItem.swift rename {PocketCastsTests/Tests/SharedModels => Modules/Tests/PocketCastsSharedModelsTests}/SiriPodcastItemTests.swift (93%) delete mode 100644 podcasts/SiriPodcastItem.swift diff --git a/Modules/Sources/PocketCastsSharedModels/SiriPodcastItem.swift b/Modules/Sources/PocketCastsSharedModels/SiriPodcastItem.swift new file mode 100644 index 0000000000..d0acb05154 --- /dev/null +++ b/Modules/Sources/PocketCastsSharedModels/SiriPodcastItem.swift @@ -0,0 +1,11 @@ +import Foundation + +public struct SiriPodcastItem: Codable { + public var name: String + public var uuid: String + + public init(name: String, uuid: String) { + self.name = name + self.uuid = uuid + } +} diff --git a/PocketCastsTests/Tests/SharedModels/SiriPodcastItemTests.swift b/Modules/Tests/PocketCastsSharedModelsTests/SiriPodcastItemTests.swift similarity index 93% rename from PocketCastsTests/Tests/SharedModels/SiriPodcastItemTests.swift rename to Modules/Tests/PocketCastsSharedModelsTests/SiriPodcastItemTests.swift index 8effdc6cf1..6a7edb2794 100644 --- a/PocketCastsTests/Tests/SharedModels/SiriPodcastItemTests.swift +++ b/Modules/Tests/PocketCastsSharedModelsTests/SiriPodcastItemTests.swift @@ -1,5 +1,5 @@ import Foundation -@testable import podcasts +@testable import PocketCastsSharedModels import XCTest final class SiriPodcastItemTests: XCTestCase { diff --git a/PodcastsIntents/SiriPodcastSearchManager.swift b/PodcastsIntents/SiriPodcastSearchManager.swift index 99aa1d705a..97c2387d73 100644 --- a/PodcastsIntents/SiriPodcastSearchManager.swift +++ b/PodcastsIntents/SiriPodcastSearchManager.swift @@ -1,5 +1,6 @@ import Foundation import Fuse +import PocketCastsSharedModels class SiriPodcastSearchManager { func matchUtteranceToPodcast(searchString: String) -> SiriPodcastItem? { diff --git a/podcasts.xcodeproj/project.pbxproj b/podcasts.xcodeproj/project.pbxproj index 121c212d79..1292d6589b 100644 --- a/podcasts.xcodeproj/project.pbxproj +++ b/podcasts.xcodeproj/project.pbxproj @@ -53,10 +53,7 @@ 3FC668CA2F7CD51E0072EBA8 /* XcodeTarget_WidgetExtension in Frameworks */ = {isa = PBXBuildFile; productRef = 3FC668C92F7CD51E0072EBA8 /* XcodeTarget_WidgetExtension */; }; 3FC668CC2F7CD5A20072EBA8 /* XcodeTarget_Pocket Casts App Clip in Frameworks */ = {isa = PBXBuildFile; productRef = 3FC668CB2F7CD5A20072EBA8 /* XcodeTarget_Pocket Casts App Clip */; }; 4000A2A025463C6A00356FCE /* LeftAlignedFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4000A29F25463C6900356FCE /* LeftAlignedFlowLayout.swift */; }; - 40043F0B23FBC6B1004A9B57 /* SiriPodcastItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40043F0A23FBC6B1004A9B57 /* SiriPodcastItem.swift */; }; - 40043F0D23FDFD91004A9B57 /* SiriPodcastItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40043F0A23FBC6B1004A9B57 /* SiriPodcastItem.swift */; }; 40043F0F23FE08B8004A9B57 /* SharedConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD054A791E3EDEB300D9195B /* SharedConstants.swift */; }; - 40043F1123FE0A05004A9B57 /* SiriPodcastItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40043F0A23FBC6B1004A9B57 /* SiriPodcastItem.swift */; }; 40043F1323FE0D9E004A9B57 /* SharedConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD054A791E3EDEB300D9195B /* SharedConstants.swift */; }; 4006E30B23A35F1500174DEB /* CollectionSummaryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4006E30923A35F1500174DEB /* CollectionSummaryViewController.swift */; }; 4006E30C23A35F1500174DEB /* CollectionSummaryViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4006E30A23A35F1500174DEB /* CollectionSummaryViewController.xib */; }; @@ -1555,7 +1552,6 @@ 2F90990B2A4F88B00044FC55 /* Share Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Share Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; 3FD6E04F2BF735EC003941C0 /* podcasts.prototype.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = podcasts.prototype.entitlements; sourceTree = ""; }; 4000A29F25463C6900356FCE /* LeftAlignedFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftAlignedFlowLayout.swift; sourceTree = ""; }; - 40043F0A23FBC6B1004A9B57 /* SiriPodcastItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiriPodcastItem.swift; sourceTree = ""; }; 4006E30923A35F1500174DEB /* CollectionSummaryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionSummaryViewController.swift; sourceTree = ""; }; 4006E30A23A35F1500174DEB /* CollectionSummaryViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CollectionSummaryViewController.xib; sourceTree = ""; }; 4006E30F23A88AE600174DEB /* ExpandedCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExpandedCollectionViewController.swift; sourceTree = ""; }; @@ -3676,7 +3672,6 @@ 8BC0600A2AB1FB8100A4FEC6 /* AppPlayEpisodeIntentExtension.swift */, 8BC060072AB1FA0400A4FEC6 /* PlayEpisodeIntent.swift */, BD054A791E3EDEB300D9195B /* SharedConstants.swift */, - 40043F0A23FBC6B1004A9B57 /* SiriPodcastItem.swift */, 8BC0600C2AB2218300A4FEC6 /* WidgetPlayEpisodeIntentExtension.swift */, ); name = "Shared with Extension"; @@ -6678,7 +6673,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 40043F0D23FDFD91004A9B57 /* SiriPodcastItem.swift in Sources */, 46FBD8B6276A874F00867746 /* Intents.intentdefinition in Sources */, 40043F0F23FE08B8004A9B57 /* SharedConstants.swift in Sources */, ); @@ -6688,7 +6682,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 40043F1123FE0A05004A9B57 /* SiriPodcastItem.swift in Sources */, 40043F1323FE0D9E004A9B57 /* SharedConstants.swift in Sources */, 46FBD8B7276A874F00867746 /* Intents.intentdefinition in Sources */, ); @@ -7249,7 +7242,6 @@ FF9B6B752D0732D40057A504 /* LogsViewController.swift in Sources */, 408C088E23155B34008C9667 /* WhatsNewHelper.swift in Sources */, 463538A726E16CD100BA9D35 /* Strings+L10n.swift in Sources */, - 40043F0B23FBC6B1004A9B57 /* SiriPodcastItem.swift in Sources */, 4084263E2138E2750076D82E /* FeaturedCollectionViewCell.swift in Sources */, 46CD3CA12715E3E600F5EB8F /* SupportConfig.swift in Sources */, BD5E8D41206211E300C84B43 /* OpmlImporter.swift in Sources */, diff --git a/podcasts/SiriPodcastItem.swift b/podcasts/SiriPodcastItem.swift deleted file mode 100644 index 0615200a6f..0000000000 --- a/podcasts/SiriPodcastItem.swift +++ /dev/null @@ -1,4 +0,0 @@ -struct SiriPodcastItem: Codable { - var name: String - var uuid: String -} diff --git a/podcasts/SiriShortcutsManager.swift b/podcasts/SiriShortcutsManager.swift index 4502e06001..fc5e034146 100644 --- a/podcasts/SiriShortcutsManager.swift +++ b/podcasts/SiriShortcutsManager.swift @@ -2,6 +2,7 @@ import Foundation import Intents import PocketCastsDataModel import PocketCastsServer +import PocketCastsSharedModels import PocketCastsUtils class SiriShortcutsManager: CustomObserver {