mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-30 07:07:22 +02:00
iOS fix local episode duration and playback session title, version bump 0.9.63
This commit is contained in:
@@ -173,7 +173,6 @@
|
|||||||
BE96D57E131924D520D57057 /* Pods-Audiobookshelf.debug.xcconfig */,
|
BE96D57E131924D520D57057 /* Pods-Audiobookshelf.debug.xcconfig */,
|
||||||
D2F7F575384A63F1C47DE984 /* Pods-Audiobookshelf.release.xcconfig */,
|
D2F7F575384A63F1C47DE984 /* Pods-Audiobookshelf.release.xcconfig */,
|
||||||
);
|
);
|
||||||
name = Pods;
|
|
||||||
path = Pods;
|
path = Pods;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@@ -721,12 +720,12 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = Icons;
|
ASSETCATALOG_COMPILER_APPICON_NAME = Icons;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 19;
|
CURRENT_PROJECT_VERSION = 20;
|
||||||
DEVELOPMENT_TEAM = 7UFJ7D8V6A;
|
DEVELOPMENT_TEAM = 7UFJ7D8V6A;
|
||||||
INFOPLIST_FILE = App/Info.plist;
|
INFOPLIST_FILE = App/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
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\"";
|
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.audiobookshelf.app.dev;
|
PRODUCT_BUNDLE_IDENTIFIER = com.audiobookshelf.app.dev;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
@@ -745,12 +744,12 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = Icons;
|
ASSETCATALOG_COMPILER_APPICON_NAME = Icons;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 19;
|
CURRENT_PROJECT_VERSION = 20;
|
||||||
DEVELOPMENT_TEAM = 7UFJ7D8V6A;
|
DEVELOPMENT_TEAM = 7UFJ7D8V6A;
|
||||||
INFOPLIST_FILE = App/Info.plist;
|
INFOPLIST_FILE = App/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
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_BUNDLE_IDENTIFIER = com.audiobookshelf.app;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
// Override point for customization after application launch.
|
// Override point for customization after application launch.
|
||||||
|
|
||||||
let configuration = Realm.Configuration(
|
let configuration = Realm.Configuration(
|
||||||
schemaVersion: 7,
|
schemaVersion: 8,
|
||||||
migrationBlock: { [weak self] migration, oldSchemaVersion in
|
migrationBlock: { [weak self] migration, oldSchemaVersion in
|
||||||
if (oldSchemaVersion < 1) {
|
if (oldSchemaVersion < 1) {
|
||||||
self?.logger.log("Realm schema version was \(oldSchemaVersion)")
|
self?.logger.log("Realm schema version was \(oldSchemaVersion)")
|
||||||
|
|||||||
@@ -169,9 +169,14 @@ extension LocalLibraryItem {
|
|||||||
self.media?.chapters.forEach { chapter in chapters.append(Chapter.detachCopy(of: chapter)!) }
|
self.media?.chapters.forEach { chapter in chapters.append(Chapter.detachCopy(of: chapter)!) }
|
||||||
let authorName = mediaMetadata?.authorDisplayName
|
let authorName = mediaMetadata?.authorDisplayName
|
||||||
|
|
||||||
|
var duration = getDuration()
|
||||||
|
var displayTitle = mediaMetadata?.title
|
||||||
|
|
||||||
let audioTracks = List<AudioTrack>()
|
let audioTracks = List<AudioTrack>()
|
||||||
if let episode = episode, let track = episode.audioTrack {
|
if let episode = episode, let track = episode.audioTrack {
|
||||||
audioTracks.append(AudioTrack.detachCopy(of: track)!)
|
audioTracks.append(AudioTrack.detachCopy(of: track)!)
|
||||||
|
duration = track.duration
|
||||||
|
displayTitle = episode.title
|
||||||
} else if let tracks = self.media?.tracks {
|
} else if let tracks = self.media?.tracks {
|
||||||
tracks.forEach { t in audioTracks.append(AudioTrack.detachCopy(of: t)!) }
|
tracks.forEach { t in audioTracks.append(AudioTrack.detachCopy(of: t)!) }
|
||||||
}
|
}
|
||||||
@@ -185,10 +190,10 @@ extension LocalLibraryItem {
|
|||||||
mediaType: self.mediaType,
|
mediaType: self.mediaType,
|
||||||
mediaMetadata: mediaMetadata,
|
mediaMetadata: mediaMetadata,
|
||||||
chapters: chapters,
|
chapters: chapters,
|
||||||
displayTitle: mediaMetadata?.title,
|
displayTitle: displayTitle,
|
||||||
displayAuthor: authorName,
|
displayAuthor: authorName,
|
||||||
coverPath: self.coverContentUrl,
|
coverPath: self.coverContentUrl,
|
||||||
duration: self.getDuration(),
|
duration: duration,
|
||||||
playMethod: PlayMethod.local.rawValue,
|
playMethod: PlayMethod.local.rawValue,
|
||||||
startedAt: dateNow,
|
startedAt: dateNow,
|
||||||
updatedAt: dateNow,
|
updatedAt: dateNow,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class Metadata: EmbeddedObject, Codable {
|
|||||||
@Persisted var title: String = "Unknown"
|
@Persisted var title: String = "Unknown"
|
||||||
@Persisted var subtitle: String?
|
@Persisted var subtitle: String?
|
||||||
@Persisted var authors = List<Author>()
|
@Persisted var authors = List<Author>()
|
||||||
|
@Persisted var author: String? // Podcast author
|
||||||
@Persisted var narrators = List<String>()
|
@Persisted var narrators = List<String>()
|
||||||
@Persisted var genres = List<String>()
|
@Persisted var genres = List<String>()
|
||||||
@Persisted var publishedYear: String?
|
@Persisted var publishedYear: String?
|
||||||
@@ -28,12 +29,13 @@ class Metadata: EmbeddedObject, Codable {
|
|||||||
@Persisted var seriesName: String?
|
@Persisted var seriesName: String?
|
||||||
@Persisted var feedUrl: String?
|
@Persisted var feedUrl: String?
|
||||||
|
|
||||||
var authorDisplayName: String { self.authorName ?? "Unknown" }
|
var authorDisplayName: String { self.authorName ?? self.author ?? "Unknown" }
|
||||||
|
|
||||||
private enum CodingKeys : String, CodingKey {
|
private enum CodingKeys : String, CodingKey {
|
||||||
case title,
|
case title,
|
||||||
subtitle,
|
subtitle,
|
||||||
authors,
|
authors,
|
||||||
|
author, // Podcast author
|
||||||
narrators,
|
narrators,
|
||||||
genres,
|
genres,
|
||||||
publishedYear,
|
publishedYear,
|
||||||
@@ -60,6 +62,7 @@ class Metadata: EmbeddedObject, Codable {
|
|||||||
let values = try decoder.container(keyedBy: CodingKeys.self)
|
let values = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
title = try values.decode(String.self, forKey: .title)
|
title = try values.decode(String.self, forKey: .title)
|
||||||
subtitle = try? values.decode(String.self, forKey: .subtitle)
|
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) {
|
if let authorList = try? values.decode([Author].self, forKey: .authors) {
|
||||||
authors.append(objectsIn: authorList)
|
authors.append(objectsIn: authorList)
|
||||||
}
|
}
|
||||||
@@ -88,6 +91,7 @@ class Metadata: EmbeddedObject, Codable {
|
|||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
try container.encode(title, forKey: .title)
|
try container.encode(title, forKey: .title)
|
||||||
try container.encode(subtitle, forKey: .subtitle)
|
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(authors), forKey: .authors)
|
||||||
try container.encode(Array(narrators), forKey: .narrators)
|
try container.encode(Array(narrators), forKey: .narrators)
|
||||||
try container.encode(Array(genres), forKey: .genres)
|
try container.encode(Array(genres), forKey: .genres)
|
||||||
|
|||||||
Reference in New Issue
Block a user