diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index 0b4e8ace..e3f4ff1d 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -173,7 +173,6 @@ BE96D57E131924D520D57057 /* Pods-Audiobookshelf.debug.xcconfig */, D2F7F575384A63F1C47DE984 /* Pods-Audiobookshelf.release.xcconfig */, ); - name = Pods; path = Pods; sourceTree = ""; }; @@ -721,12 +720,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = Icons; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 19; + CURRENT_PROJECT_VERSION = 20; DEVELOPMENT_TEAM = 7UFJ7D8V6A; INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 0.9.62; + MARKETING_VERSION = 0.9.63; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; PRODUCT_BUNDLE_IDENTIFIER = com.audiobookshelf.app.dev; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -745,12 +744,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = Icons; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 19; + CURRENT_PROJECT_VERSION = 20; DEVELOPMENT_TEAM = 7UFJ7D8V6A; INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 0.9.62; + MARKETING_VERSION = 0.9.63; PRODUCT_BUNDLE_IDENTIFIER = com.audiobookshelf.app; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = ""; diff --git a/ios/App/App/AppDelegate.swift b/ios/App/App/AppDelegate.swift index 7f822415..1cf787d0 100644 --- a/ios/App/App/AppDelegate.swift +++ b/ios/App/App/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Override point for customization after application launch. let configuration = Realm.Configuration( - schemaVersion: 7, + schemaVersion: 8, migrationBlock: { [weak self] migration, oldSchemaVersion in if (oldSchemaVersion < 1) { self?.logger.log("Realm schema version was \(oldSchemaVersion)") diff --git a/ios/App/Shared/models/local/LocalLibraryItem.swift b/ios/App/Shared/models/local/LocalLibraryItem.swift index 6e20b52f..f1fc815f 100644 --- a/ios/App/Shared/models/local/LocalLibraryItem.swift +++ b/ios/App/Shared/models/local/LocalLibraryItem.swift @@ -169,9 +169,14 @@ extension LocalLibraryItem { self.media?.chapters.forEach { chapter in chapters.append(Chapter.detachCopy(of: chapter)!) } let authorName = mediaMetadata?.authorDisplayName + var duration = getDuration() + var displayTitle = mediaMetadata?.title + let audioTracks = List() if let episode = episode, let track = episode.audioTrack { audioTracks.append(AudioTrack.detachCopy(of: track)!) + duration = track.duration + displayTitle = episode.title } else if let tracks = self.media?.tracks { tracks.forEach { t in audioTracks.append(AudioTrack.detachCopy(of: t)!) } } @@ -185,10 +190,10 @@ extension LocalLibraryItem { mediaType: self.mediaType, mediaMetadata: mediaMetadata, chapters: chapters, - displayTitle: mediaMetadata?.title, + displayTitle: displayTitle, displayAuthor: authorName, coverPath: self.coverContentUrl, - duration: self.getDuration(), + duration: duration, playMethod: PlayMethod.local.rawValue, startedAt: dateNow, updatedAt: dateNow, diff --git a/ios/App/Shared/models/server/Metadata.swift b/ios/App/Shared/models/server/Metadata.swift index 9b33cad9..eb2a4b7e 100644 --- a/ios/App/Shared/models/server/Metadata.swift +++ b/ios/App/Shared/models/server/Metadata.swift @@ -12,6 +12,7 @@ class Metadata: EmbeddedObject, Codable { @Persisted var title: String = "Unknown" @Persisted var subtitle: String? @Persisted var authors = List() + @Persisted var author: String? // Podcast author @Persisted var narrators = List() @Persisted var genres = List() @Persisted var publishedYear: String? @@ -28,12 +29,13 @@ class Metadata: EmbeddedObject, Codable { @Persisted var seriesName: String? @Persisted var feedUrl: String? - var authorDisplayName: String { self.authorName ?? "Unknown" } + var authorDisplayName: String { self.authorName ?? self.author ?? "Unknown" } private enum CodingKeys : String, CodingKey { case title, subtitle, authors, + author, // Podcast author narrators, genres, publishedYear, @@ -60,6 +62,7 @@ class Metadata: EmbeddedObject, Codable { let values = try decoder.container(keyedBy: CodingKeys.self) title = try values.decode(String.self, forKey: .title) subtitle = try? values.decode(String.self, forKey: .subtitle) + author = try? values.decode(String.self, forKey: .author) // Podcast author if let authorList = try? values.decode([Author].self, forKey: .authors) { authors.append(objectsIn: authorList) } @@ -88,6 +91,7 @@ class Metadata: EmbeddedObject, Codable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(title, forKey: .title) try container.encode(subtitle, forKey: .subtitle) + try container.encode(author, forKey: .author) // Podcast author try container.encode(Array(authors), forKey: .authors) try container.encode(Array(narrators), forKey: .narrators) try container.encode(Array(genres), forKey: .genres)