Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a88a719
Add S3-compatible storage source
kurob1993 Oct 17, 2026
4063ed6
Fix intermittent cloud stream failures (S3 etc.)
kurob1993 Oct 17, 2026
b15c815
Add design doc for extension-based external download
kurob1993 Oct 17, 2026
2935745
Fix spec: embed_metadata tagging, defer repo-URL install, pin AAR pro…
kurob1993 Oct 17, 2026
1ef69dc
Spec: use_extensions/item_id contract, output_path staging, FLAC-only…
kurob1993 Oct 17, 2026
c2eea29
Spec: apply review advisories (actual_extension naming, provenance fi…
kurob1993 Oct 17, 2026
87d4a84
Add implementation plan for extension-based download
kurob1993 Oct 17, 2026
e524f1d
Add gobackend AAR from SpotiFLAC-Mobile (MIT) for extension downloads
kurob1993 Oct 17, 2026
5358a57
Add gobackend download wire models
kurob1993 Oct 17, 2026
855403c
Add download backend wrapper and settings
kurob1993 Oct 17, 2026
af5f8eb
Add download queue repository
kurob1993 Oct 17, 2026
42c958c
Add download worker with SAF publish and library scan
kurob1993 Oct 17, 2026
f3c9982
Add download screen and view model
kurob1993 Oct 17, 2026
bbf2c83
Add extensions management screen
kurob1993 Oct 17, 2026
28abf6b
Wire download screens into navigation
kurob1993 Oct 17, 2026
fc6492e
Ignore gomobile sources jar byproduct
kurob1993 Oct 17, 2026
09d40cd
Add extension repository browsing and install
kurob1993 Oct 17, 2026
65b8bd5
Make extension registry URL user-configurable
kurob1993 Oct 17, 2026
636b9ff
Style download text fields to match app M3 theme
kurob1993 Oct 17, 2026
4614213
Reduce build parallelism to keep cores free
kurob1993 Oct 17, 2026
2a176b7
Fix repo extensions list parsing (array response)
kurob1993 Oct 17, 2026
de78be1
Remove orphaned annotation
kurob1993 Oct 17, 2026
fd887a1
Add registry URL edit and remove actions
kurob1993 Oct 17, 2026
674db17
Fix screen bottom overlap and log backend failures
kurob1993 Oct 17, 2026
b7d6bc1
Translate S3 config strings to Indonesian
kurob1993 Oct 17, 2026
f68d394
Lift download snackbar above bottom navigation
kurob1993 Oct 17, 2026
3f903f6
Apply app language to all login activities and harden extension init
kurob1993 Oct 17, 2026
d5b8a5b
Keep S3 folder sync running after leaving dashboard
kurob1993 Oct 17, 2026
34c70b9
Install extension storage master key before Go init
kurob1993 Oct 17, 2026
ddd22fb
Show verification dialog on auth-required download failures
kurob1993 Oct 17, 2026
06ebd2a
Add extension and quality picker sheet before downloads
kurob1993 Oct 17, 2026
ade63e1
Fix extension downloads end to end and add Downloads catalog
kurob1993 Oct 17, 2026
742425f
Cap Gradle and Kotlin daemon CPU usage to 3 processors
kurob1993 Oct 17, 2026
40cc17d
Skip S3 auto-sync on open when every folder is already synced
kurob1993 Oct 17, 2026
202dd99
Polish extensions UI and localize download strings
kurob1993 Oct 17, 2026
c086255
Keep upstream Gradle parallelism settings
kurob1993 Oct 17, 2026
5a2a4f4
Add pull-to-refresh to the Downloads catalog
kurob1993 Oct 17, 2026
5154ef7
Use the library's expressive pull-to-refresh indicator on the catalog
kurob1993 Oct 17, 2026
622e24b
Search extensions by songs, albums or artists with detail pages
kurob1993 Oct 17, 2026
9662a9f
Match Downloads search chips to the app's pill filter style
kurob1993 Oct 17, 2026
80f6df2
Use the top bar back button on album and artist pages
kurob1993 Oct 17, 2026
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ markdown.xml
**/.env
**/.env.*
!**/.env.example
app/libs/gobackend-sources.jar
5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ kotlin {
}

dependencies {
// Embedded Go backend (SpotiFLAC-Mobile, MIT) — see scripts/build_gobackend_aar.sh
implementation(files("libs/gobackend.aar"))

// Core & Optimization
coreLibraryDesugaring(libs.desugar.jdk.libs)
implementation(libs.androidx.profileinstaller)
Expand Down Expand Up @@ -296,6 +299,8 @@ dependencies {
implementation(libs.androidx.media)
implementation(libs.coil.compose)
implementation(libs.taglib)
// Decrypts extension downloads (e.g. Amazon "ffmpeg.mov_key") before publishing.
implementation(libs.ffmpeg.kit.min)
implementation(libs.jaudiotagger)
implementation(libs.vorbisjava.core)
implementation(libs.wavy.slider)
Expand Down
Binary file added app/libs/gobackend.aar
Binary file not shown.
2,904 changes: 2,904 additions & 0 deletions app/schemas/com.theveloper.pixelplay.data.database.PixelPlayDatabase/43.json

Large diffs are not rendered by default.

2,909 changes: 2,909 additions & 0 deletions app/schemas/com.theveloper.pixelplay.data.database.PixelPlayDatabase/44.json

Large diffs are not rendered by default.

2,916 changes: 2,916 additions & 0 deletions app/schemas/com.theveloper.pixelplay.data.database.PixelPlayDatabase/45.json

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,23 @@
android:resource="@xml/shortcuts" />
</activity>

<!-- Browser redirect after a download extension's verification (callback URL is set by the extension). -->
<activity
android:name=".presentation.download.ExtensionCallbackActivity"
android:exported="true"
android:excludeFromRecents="true"
android:noHistory="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="spotiflac" android:host="session-grant" />
<data android:scheme="spotiflac" android:host="callback" />
<data android:scheme="spotiflac" android:host="spotify-callback" />
</intent-filter>
</activity>

<activity
android:name=".presentation.telegram.auth.TelegramLoginActivity"
android:exported="false"
Expand Down Expand Up @@ -120,6 +137,13 @@
android:theme="@style/Theme.PixelPlay"
android:windowSoftInputMode="adjustResize" />

<activity
android:name=".presentation.s3.auth.S3LoginActivity"
android:exported="false"
android:label="S3 Storage"
android:theme="@style/Theme.PixelPlay"
android:windowSoftInputMode="adjustResize" />


<activity
android:name=".ExternalPlayerActivity"
Expand Down Expand Up @@ -246,6 +270,13 @@
android:name=".data.service.wear.WatchTransferForegroundService"
android:foregroundServiceType="dataSync"
android:exported="false" />

<!-- WorkManager runs DownloadWorker via setForeground(dataSync); the library
manifest declares no type, which crashes on API 34+. -->
<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="dataSync"
tools:node="merge" />
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.hilt.work.HiltWorkerFactory
import androidx.work.Configuration
import coil.ImageLoader
import coil.ImageLoaderFactory
import com.theveloper.pixelplay.data.download.DownloadWorker
import com.theveloper.pixelplay.data.preferences.UserPreferencesRepository
import com.theveloper.pixelplay.data.diagnostics.AdvancedPerformanceDiagnosticsController
import com.theveloper.pixelplay.data.repository.ArtistImageRepository
Expand Down Expand Up @@ -116,6 +117,7 @@ class PixelPlayApplication : Application(), ImageLoaderFactory, Configuration.Pr
)
val notificationManager = getSystemService(NotificationManager::class.java)
notificationManager.createNotificationChannel(channel)
DownloadWorker.ensureNotificationChannel(this)
}

ProcessLifecycleOwner.get().lifecycle.addObserver(appLifecycleObserver)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ interface MusicDao {
@Query("SELECT id FROM songs WHERE source_type = 6")
suspend fun getAllJellyfinSongIds(): List<Long>

@Query("SELECT id FROM songs WHERE source_type = 7")
suspend fun getAllS3SongIds(): List<Long>

@Transaction
suspend fun deleteSongsAndRelatedData(songIds: List<Long>) {
if (songIds.isEmpty()) return
Expand Down Expand Up @@ -321,6 +324,13 @@ interface MusicDao {
deleteSongsAndRelatedData(jellyfinSongIds)
}

@Transaction
suspend fun clearAllS3Songs() {
val s3SongIds = getAllS3SongIds()
if (s3SongIds.isEmpty()) return
deleteSongsAndRelatedData(s3SongIds)
}

@Transaction
suspend fun clearAllTelegramSongs() {
val telegramSongIds = getAllTelegramSongIds()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ import androidx.sqlite.db.SupportSQLiteDatabase
TelegramTopicEntity::class,
JellyfinSongEntity::class,
JellyfinPlaylistEntity::class,
S3SongEntity::class,
S3FolderEntity::class,
AiCacheEntity::class,
AiUsageEntity::class
],
version = 42,
version = 45,
exportSchema = true
)
abstract class PixelPlayDatabase : RoomDatabase() {
Expand All @@ -54,6 +56,7 @@ abstract class PixelPlayDatabase : RoomDatabase() {
abstract fun qqmusicDao(): QqMusicDao
abstract fun navidromeDao(): NavidromeDao
abstract fun jellyfinDao(): JellyfinDao
abstract fun s3Dao(): S3Dao
abstract fun aiCacheDao(): AiCacheDao
abstract fun aiUsageDao(): AiUsageDao

Expand Down Expand Up @@ -747,6 +750,62 @@ abstract class PixelPlayDatabase : RoomDatabase() {
}
}

/**
* Add S3-compatible storage tables (s3_songs, s3_folders).
*/
val MIGRATION_42_43 = object : Migration(42, 43) {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("""
CREATE TABLE IF NOT EXISTS s3_songs (
id TEXT NOT NULL PRIMARY KEY,
object_key TEXT NOT NULL,
folder_id TEXT NOT NULL,
title TEXT NOT NULL,
artist TEXT NOT NULL,
album TEXT NOT NULL,
album_id INTEGER NOT NULL,
duration INTEGER NOT NULL,
mime_type TEXT NOT NULL,
bitrate INTEGER,
file_size INTEGER NOT NULL,
date_added INTEGER NOT NULL,
date_modified INTEGER NOT NULL
)
""".trimIndent())

db.execSQL("""
CREATE TABLE IF NOT EXISTS s3_folders (
id TEXT NOT NULL PRIMARY KEY,
name TEXT NOT NULL,
song_count INTEGER NOT NULL DEFAULT 0,
last_sync_time INTEGER NOT NULL DEFAULT 0
)
""".trimIndent())

db.execSQL("CREATE INDEX IF NOT EXISTS index_s3_songs_object_key ON s3_songs(object_key)")
db.execSQL("CREATE INDEX IF NOT EXISTS index_s3_songs_folder_id ON s3_songs(folder_id)")
db.execSQL("CREATE INDEX IF NOT EXISTS index_s3_songs_folder_id_date_added ON s3_songs(folder_id, date_added)")
}
}

/**
* Add embedded artwork column to s3_songs.
*/
val MIGRATION_43_44 = object : Migration(43, 44) {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE s3_songs ADD COLUMN album_art_uri TEXT")
}
}

/**
* Add tag-probe flag to s3_songs (background metadata queue).
*/
val MIGRATION_44_45 = object : Migration(44, 45) {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE s3_songs ADD COLUMN metadata_probed INTEGER NOT NULL DEFAULT 0")
}
}

private fun ensureSongsTableHasDateAdded(db: SupportSQLiteDatabase) {
if (!tableExists(db, "songs")) {
recreateSongsTable(db)
Expand Down
68 changes: 68 additions & 0 deletions app/src/main/java/com/theveloper/pixelplay/data/database/S3Dao.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package com.theveloper.pixelplay.data.database

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import kotlinx.coroutines.flow.Flow

@Dao
interface S3Dao {

// --- Songs ---

@Query("SELECT * FROM s3_songs ORDER BY date_added DESC")
fun getAllS3Songs(): Flow<List<S3SongEntity>>

@Query("SELECT * FROM s3_songs ORDER BY date_added DESC")
suspend fun getAllS3SongsList(): List<S3SongEntity>

@Query("SELECT * FROM s3_songs WHERE folder_id = :folderId ORDER BY title ASC")
fun getSongsByFolder(folderId: String): Flow<List<S3SongEntity>>

@Query("SELECT * FROM s3_songs WHERE metadata_probed = 0 LIMIT :limit")
suspend fun getUnprobedBatch(limit: Int = 8): List<S3SongEntity>

@Query("SELECT COUNT(*) FROM s3_songs WHERE metadata_probed = 0")
fun countUnprobedFlow(): Flow<Int>

@Query(
"""UPDATE s3_songs SET title = :title, artist = :artist, album = :album,
duration = :duration, album_art_uri = :albumArtUri, metadata_probed = 1 WHERE id = :id"""
)
suspend fun applyProbeResult(
id: String, title: String, artist: String, album: String,
duration: Long, albumArtUri: String?
)

@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertSongs(songs: List<S3SongEntity>)

@Query("DELETE FROM s3_songs WHERE id IN (:ids)")
suspend fun deleteSongsByIds(ids: List<String>)

@Query("DELETE FROM s3_songs WHERE folder_id = :folderId")
suspend fun deleteSongsByFolder(folderId: String)

// --- Folders ---

@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertFolder(folder: S3FolderEntity)

@Query("SELECT * FROM s3_folders ORDER BY name ASC")
fun getAllFolders(): Flow<List<S3FolderEntity>>

@Query("SELECT * FROM s3_folders")
suspend fun getAllFoldersList(): List<S3FolderEntity>

@Query("DELETE FROM s3_folders WHERE id = :folderId")
suspend fun deleteFolder(folderId: String)

// --- Clear All ---

@Query("DELETE FROM s3_songs")
suspend fun clearAllSongs()

@Query("DELETE FROM s3_folders")
suspend fun clearAllFolders()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.theveloper.pixelplay.data.database

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey

@Entity(tableName = "s3_folders")
data class S3FolderEntity(
@PrimaryKey val id: String, // S3 prefix, e.g. "Music/"
val name: String, // display name (last segment)
@ColumnInfo(name = "song_count") val songCount: Int = 0,
@ColumnInfo(name = "last_sync_time") val lastSyncTime: Long = 0
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package com.theveloper.pixelplay.data.database

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
import com.theveloper.pixelplay.data.model.Song
import com.theveloper.pixelplay.data.s3.S3Repository

@Entity(
tableName = "s3_songs",
indices = [
Index(value = ["object_key"]),
Index(value = ["folder_id"]),
Index(value = ["folder_id", "date_added"])
]
)
data class S3SongEntity(
@PrimaryKey val id: String, // "{folderId}_{objectKey}"
@ColumnInfo(name = "object_key") val objectKey: String, // full S3 object key
@ColumnInfo(name = "folder_id") val folderId: String,
val title: String,
val artist: String,
val album: String,
@ColumnInfo(name = "album_id") val albumId: Long,
val duration: Long, // milliseconds (0 = unknown)
val mimeType: String,
val bitrate: Int?,
@ColumnInfo(name = "file_size") val fileSize: Long,
@ColumnInfo(name = "date_added") val dateAdded: Long,
@ColumnInfo(name = "date_modified") val dateModified: Long,
@ColumnInfo(name = "album_art_uri") val albumArtUri: String? = null,
@ColumnInfo(name = "metadata_probed", defaultValue = "0") val metadataProbed: Boolean = false
)

fun S3SongEntity.toSong(): Song {
return Song(
id = "s3_$objectKey",
title = title,
artist = artist,
artistId = artistIdFor(artist),
album = album,
albumId = albumIdFor(album),
path = "",
contentUriString = "s3://$objectKey",
albumArtUriString = albumArtUri,
duration = duration,
genre = S3Repository.S3_GENRE,
mimeType = mimeType,
bitrate = bitrate,
sampleRate = 0,
year = 0,
trackNumber = 0,
dateAdded = dateAdded,
isFavorite = false,
s3ObjectKey = objectKey
)
}

fun Song.toS3SongEntity(folderId: String): S3SongEntity {
val resolvedKey = s3ObjectKey ?: ""
return S3SongEntity(
id = "${folderId}_${resolvedKey}",
objectKey = resolvedKey,
folderId = folderId,
title = title,
artist = artist,
album = album,
albumId = albumId,
duration = duration,
mimeType = mimeType ?: "audio/mpeg",
bitrate = bitrate,
fileSize = 0L,
dateAdded = dateAdded,
dateModified = dateAdded
)
}

internal fun artistIdFor(artist: String): Long =
-(S3Repository.S3_ARTIST_ID_OFFSET + artist.lowercase().hashCode().toLong().let { if (it < 0) -it else it })

internal fun albumIdFor(album: String): Long =
-(S3Repository.S3_ALBUM_ID_OFFSET + album.lowercase().hashCode().toLong().let { if (it < 0) -it else it })
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ object SourceType {
const val QQMUSIC = 4
const val NAVIDROME = 5
const val JELLYFIN = 6
const val S3 = 7

/** Derive source type from a content URI string (fallback for migration / conversion). */
fun fromContentUri(uri: String): Int = when {
Expand All @@ -31,6 +32,7 @@ object SourceType {
uri.startsWith("qqmusic://") -> QQMUSIC
uri.startsWith("navidrome://") -> NAVIDROME
uri.startsWith("jellyfin://") -> JELLYFIN
uri.startsWith("s3://") -> S3
else -> LOCAL
}
}
Expand Down Expand Up @@ -145,6 +147,9 @@ private fun SongEntity.toSongInternal(artists: List<ArtistRef>): Song {
jellyfinId = if (this.contentUriString.startsWith("jellyfin://")) {
this.contentUriString.removePrefix("jellyfin://")
} else null,
s3ObjectKey = if (this.contentUriString.startsWith("s3://")) {
this.contentUriString.removePrefix("s3://")
} else null,
mimeType = this.mimeType,
bitrate = this.bitrate,
sampleRate = this.sampleRate
Expand Down
Loading