Skip to content

Commit

Permalink
Add a new method for sectioned album and song
Browse files Browse the repository at this point in the history
  • Loading branch information
rudrankriyam committed Dec 12, 2023
1 parent b23f8e6 commit e0dafcf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 0 additions & 1 deletion Sources/MusadoraKit/Library/LibraryArtist.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public extension MLibrary {
}
}


/// Fetch multiple artists from the user's library by using their identifiers.
///
/// do {
Expand Down
6 changes: 6 additions & 0 deletions Sources/MusadoraKit/Music Player/APlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ public extension APlayer {
queue = [album]
try await play()
}

@available(iOS 16.0, *)
func play(album: MusicLibrarySection<Album, Song>) async throws {
queue = ApplicationMusicPlayer.Queue(for: album.items)
try await play()
}
}

@available(iOS 16, *, tvOS 16, *, macOS 14.0, macCatalyst 17.0, *)
Expand Down
7 changes: 4 additions & 3 deletions Sources/MusadoraKit/Ratings/Catalog/AddCatalogRating.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public extension MCatalog {

/// Adds a rating for an album in the Apple Music catalog.
///
/// Example:
/// Example:
/// ```swift
/// do {
/// let rating = try await MCatalog.addRating(for: album, rating: .like)
Expand Down Expand Up @@ -71,7 +71,7 @@ public extension MCatalog {

/// Adds a rating for a music video in the Apple Music catalog.
///
/// Example:
/// Example:
/// ```swift
/// do {
/// let rating = try await MCatalog.addRating(for: musicVideo, rating: .like)
Expand Down Expand Up @@ -115,7 +115,8 @@ public extension MCatalog {
///
/// Use this method when you don't have the particular music item, but have access
/// to the unique identifier of the music item.
/// Example:
///
/// Example:
/// ```swift
/// do {
/// let rating = try await MCatalog.addRating(for: "12345678", item: .playlist, rating: .dislike)
Expand Down
1 change: 1 addition & 0 deletions Sources/MusadoraKit/Ratings/Library/AddLibraryRating.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public extension MLibrary {
///
/// Use this method when you don't have the particular music item, but have access
/// to the unique identifier of the music item.
///
/// Example:
/// ```swift
/// do {
Expand Down

0 comments on commit e0dafcf

Please sign in to comment.