Implement macOS local MP3 discovery foundation
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import Foundation
|
||||
import VelodyDomain
|
||||
|
||||
public struct LocalTrackMetadata: Hashable, Sendable {
|
||||
public var title: String?
|
||||
public var artist: String?
|
||||
public var album: String?
|
||||
public var durationSeconds: Double?
|
||||
|
||||
public init(
|
||||
title: String? = nil,
|
||||
artist: String? = nil,
|
||||
album: String? = nil,
|
||||
durationSeconds: Double? = nil
|
||||
) {
|
||||
self.title = title
|
||||
self.artist = artist
|
||||
self.album = album
|
||||
self.durationSeconds = durationSeconds
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
public protocol FolderAccessService: AnyObject {
|
||||
func chooseFolder() -> URL?
|
||||
func storedFolderURL() -> URL?
|
||||
}
|
||||
|
||||
public protocol MetadataReader {
|
||||
func readMetadata(for fileURL: URL) async throws -> LocalTrackMetadata
|
||||
}
|
||||
|
||||
public protocol LocalMusicScanner {
|
||||
func scanFolder(at folderURL: URL) async throws -> [LibraryTrack]
|
||||
}
|
||||
Reference in New Issue
Block a user