Skip to content

Commit e0dafcf

Browse files
committed
Add a new method for sectioned album and song
1 parent b23f8e6 commit e0dafcf

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

Sources/MusadoraKit/Library/LibraryArtist.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public extension MLibrary {
7474
}
7575
}
7676

77-
7877
/// Fetch multiple artists from the user's library by using their identifiers.
7978
///
8079
/// do {

Sources/MusadoraKit/Music Player/APlayer.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ public extension APlayer {
8282
queue = [album]
8383
try await play()
8484
}
85+
86+
@available(iOS 16.0, *)
87+
func play(album: MusicLibrarySection<Album, Song>) async throws {
88+
queue = ApplicationMusicPlayer.Queue(for: album.items)
89+
try await play()
90+
}
8591
}
8692

8793
@available(iOS 16, *, tvOS 16, *, macOS 14.0, macCatalyst 17.0, *)

Sources/MusadoraKit/Ratings/Catalog/AddCatalogRating.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public extension MCatalog {
2929

3030
/// Adds a rating for an album in the Apple Music catalog.
3131
///
32-
/// Example:
32+
/// Example:
3333
/// ```swift
3434
/// do {
3535
/// let rating = try await MCatalog.addRating(for: album, rating: .like)
@@ -71,7 +71,7 @@ public extension MCatalog {
7171

7272
/// Adds a rating for a music video in the Apple Music catalog.
7373
///
74-
/// Example:
74+
/// Example:
7575
/// ```swift
7676
/// do {
7777
/// let rating = try await MCatalog.addRating(for: musicVideo, rating: .like)
@@ -115,7 +115,8 @@ public extension MCatalog {
115115
///
116116
/// Use this method when you don't have the particular music item, but have access
117117
/// to the unique identifier of the music item.
118-
/// Example:
118+
///
119+
/// Example:
119120
/// ```swift
120121
/// do {
121122
/// let rating = try await MCatalog.addRating(for: "12345678", item: .playlist, rating: .dislike)

Sources/MusadoraKit/Ratings/Library/AddLibraryRating.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public extension MLibrary {
9595
///
9696
/// Use this method when you don't have the particular music item, but have access
9797
/// to the unique identifier of the music item.
98+
///
9899
/// Example:
99100
/// ```swift
100101
/// do {

0 commit comments

Comments
 (0)