Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "audiobookshelf-icon.png",
"filename" : "abs.svg",
"idiom" : "universal"
}
],
Expand Down
31 changes: 31 additions & 0 deletions BookPlayer/Assets.xcassets/audiobookshelf-icon.imageset/abs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "icon-transparent.png",
"filename" : "jellyfin.svg",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion BookPlayer/Library/ItemList/ItemListViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,14 @@ extension ItemListViewModel {
func createFolder(with title: String, items: [String]? = nil, type: SimpleItemType) {
Task { @MainActor in
do {
let trimmedTitle = title.trimmingCharacters(in: .whitespacesAndNewlines)

guard !trimmedTitle.isEmpty else {
return
}

let folder = try libraryService.createFolder(
with: title,
with: trimmedTitle,
inside: libraryNode.folderRelativePath
)
await syncService.scheduleUpload(items: [folder])
Expand Down
2 changes: 1 addition & 1 deletion BookPlayer/Player/PlayerManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ final class PlayerManager: NSObject, PlayerManagerProtocol, ObservableObject {
self.nowPlayingInfo[MPMediaItemPropertyTitle] = chapter.title

/// If the chapter title is the same as the current item, show the author instead
if chapter.title == currentItem.title {
if currentItem.isBoundBook || chapter.title == currentItem.title {
self.nowPlayingInfo[MPMediaItemPropertyArtist] = currentItem.author
} else {
self.nowPlayingInfo[MPMediaItemPropertyArtist] = currentItem.title
Expand Down
22 changes: 20 additions & 2 deletions BookPlayer/Settings/Sections/SettingsTipView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,26 @@ struct SettingsTipView: View {
@State private var loadProductTask: Task<(), Error>?
@EnvironmentObject private var theme: ThemeViewModel
@Environment(\.loadingState) var loadingState
@Environment(\.accountService) var accountService

let purchaseCompleted: () -> Void

/// Whether this is the user's first donation (uses non-consumable) or a repeat donation (uses consumable)
private var isFirstDonation: Bool {
return accountService.getAccount()?.donationMade != true
}

/// Returns the appropriate product ID based on donation history
private var productId: String {
if isFirstDonation {
// First time donation uses non-consumable
return tipOption.rawValue
} else {
// Subsequent donations use consumable
return tipOption.rawValue + ".consumable"
}
}

var buttonBackgroundColor: Color {
switch tipOption {
case .kind:
Expand Down Expand Up @@ -93,7 +110,8 @@ struct SettingsTipView: View {
func loadProduct() {
loadProductTask = Task {
self.isLoading = true
let products = await Purchases.shared.products([tipOption.rawValue])
// Use non-consumable for first donation, consumable for repeat donations
let products = await Purchases.shared.products([productId])
self.product = products.first
self.buttonTitle = self.product?.localizedPriceString ?? ""
self.isLoading = false
Expand All @@ -104,7 +122,7 @@ struct SettingsTipView: View {
guard AppEnvironment.isPurchaseEnabled else {
throw PurchaseError.testFlightPurchasesDisabled
}

_ = await loadProductTask?.result

guard let product else {
Expand Down
2 changes: 1 addition & 1 deletion Shared/Services/PlaybackService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public final class PlaybackService: PlaybackServiceProtocol {

return PlayableItem(
title: folder.title,
author: chapters.first?.author ?? "voiceover_unknown_author".localized,
author: chapters.first?.author ?? folder.details,
chapters: chapters,
currentTime: folder.currentTime,
duration: duration ?? folder.duration,
Expand Down