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
Expand Up @@ -67,6 +67,16 @@ private const val SONG_LIST_PROJECTION = """
telegram_file_id, artists_json, source_type
"""

data class DeviceCapabilitySongRow(
val filePath: String,
val contentUriString: String,
val mimeType: String?,
val duration: Long,
val bitrate: Int?,
val sampleRate: Int?,
val sourceType: Int
)

@Dao
interface MusicDao {

Expand Down Expand Up @@ -442,6 +452,19 @@ interface MusicDao {
@Query("SELECT COUNT(*) FROM songs")
suspend fun getSongCountOnce(): Int

@Query("""
SELECT
file_path AS filePath,
content_uri_string AS contentUriString,
mime_type AS mimeType,
duration,
bitrate,
sample_rate AS sampleRate,
source_type AS sourceType
FROM songs
""")
suspend fun getDeviceCapabilitySongRows(): List<DeviceCapabilitySongRow>

/**
* Returns random songs for efficient shuffle without loading all songs into memory.
* Uses SQLite RANDOM() for true randomness.
Expand Down
Loading