feat(*): subsonic client with avfoundation playback and apple music ui
This commit is contained in:
commit
e5bb559d7f
93 files changed
+7517
No files matched your search
@@ -0,0 +1,50 @@
|
||||
import Domain
|
||||
import Foundation
|
||||
|
||||
public enum AlbumSort: String, CaseIterable, Sendable {
|
||||
case recentlyAdded, title, artist, year
|
||||
}
|
||||
|
||||
public struct SearchResults: Sendable {
|
||||
public var artists: [Artist] = []
|
||||
public var albums: [Album] = []
|
||||
public var tracks: [Track] = []
|
||||
public var playlists: [Playlist] = []
|
||||
|
||||
public init() {}
|
||||
|
||||
public var isEmpty: Bool {
|
||||
artists.isEmpty && albums.isEmpty && tracks.isEmpty && playlists.isEmpty
|
||||
}
|
||||
}
|
||||
|
||||
public protocol Library: Sendable {
|
||||
func apply(_ changes: [Change]) async
|
||||
func cursor(for source: SourceID) async -> Cursor?
|
||||
func setCursor(_ cursor: Cursor, for source: SourceID) async
|
||||
func updates() async -> AsyncStream<Void>
|
||||
|
||||
func artists() async -> [Artist]
|
||||
func artist(_ id: EntityID) async -> Artist?
|
||||
func albums(sortedBy sort: AlbumSort) async -> [Album]
|
||||
func albums(byArtist id: EntityID) async -> [Album]
|
||||
func albums(inGenre genre: String) async -> [Album]
|
||||
func album(_ id: EntityID) async -> Album?
|
||||
func tracks() async -> [Track]
|
||||
func tracks(inAlbum id: EntityID) async -> [Track]
|
||||
func tracks(byArtist id: EntityID) async -> [Track]
|
||||
func tracks(inGenre genre: String) async -> [Track]
|
||||
func tracks(inPlaylist id: EntityID) async -> [Track]
|
||||
func playlists() async -> [Playlist]
|
||||
func stations() async -> [RadioStation]
|
||||
func genres() async -> [Genre]
|
||||
|
||||
func recentlyPlayed(limit: Int) async -> [Album]
|
||||
func mostPlayed(limit: Int) async -> [Album]
|
||||
func favoriteTracks() async -> [Track]
|
||||
func favorites() async -> Set<EntityID>
|
||||
func setFavorite(_ isFavorite: Bool, for id: EntityID) async
|
||||
func recordPlay(of track: Track, at date: Date) async
|
||||
|
||||
func search(_ query: String) async -> SearchResults
|
||||
}
|
||||
Reference in new issue
Block a user