Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c89f98e
Init refactor
Piripe Jun 21, 2026
f3e097b
Reverted models in UI
Piripe Jun 24, 2026
995c7de
Added Retrofit
Piripe Jun 24, 2026
e11d2ff
implemented SubsonicMediaProvider.authenticate
Piripe Jun 27, 2026
b32b1ed
implemented MediaProviderManager init/save/load
Piripe Jun 27, 2026
9e4c70c
changed the package of every legacy files to avoid using them
Piripe Jun 27, 2026
9837e73
Renamed MediaItem to MediaModel
Piripe Jun 30, 2026
657e963
Added Album.toMediaItem
Piripe Jun 30, 2026
11d6c03
Updated AlbumRepository
Piripe Jun 30, 2026
69fadce
Updated ArtistRepository
Piripe Jun 30, 2026
7937305
Updated PlaylistRepository
Piripe Jun 30, 2026
7bbf8ad
Updated RadioRepository
Piripe Jun 30, 2026
e21f307
Updated SongRepository
Piripe Jun 30, 2026
3ca88a6
Updated StarredRepository
Piripe Jun 30, 2026
ced296a
Implemented MediaProviderManager addProvider/removeProvider/setProvid…
Piripe Jun 30, 2026
f198d50
Updated Application, MainActivity and MusicService
Piripe Jul 1, 2026
0387ce7
Added supported sorting in the MediaProvider
Piripe Jul 1, 2026
3fadaa8
Updated songs and radio screen view models
Piripe Jul 1, 2026
51ad43a
Updated the rest of the view models
Piripe Jul 1, 2026
0164faf
Updated some screens
Piripe Jul 1, 2026
b658ff3
Updated some more screens
Piripe Jul 1, 2026
915d70d
Removed most errors with minimal effort
Piripe Jul 1, 2026
0b15ed3
Deleted legacy files
Piripe Jul 2, 2026
492bc11
"Working" app
Piripe Jul 2, 2026
e28a45b
Some changes to SubsonicMediaProvider
Piripe Jul 2, 2026
faf31a5
Implemented MigrationManager
Piripe Jul 2, 2026
2802907
Fix Subsonic models and add Json Deserialization
CraftWorksMC Jul 2, 2026
a8afcb8
Fixed ProvidersRefactorMigration
Piripe Jul 2, 2026
670f957
Reverted ProvidersRefactorMigration changes
Piripe Jul 2, 2026
0562b47
Simplified the album model
Piripe Jul 2, 2026
9535880
Added LocalMediaProvider (unfinished)
Piripe Jul 2, 2026
ab77e7f
Make LocalMediaProvider serializable
Piripe Jul 2, 2026
6965f74
Switch to Ktorfit, implement more subsonic endpoints, playback working.
CraftWorksMC Jul 3, 2026
d118d9b
Some modifications to the models and media providers
Piripe Jul 5, 2026
d85da8e
Fix Subsonic providerId on model creation
Piripe Jul 5, 2026
bda3208
getAlbumList and getImageUrl for LocalMediaProvider
Piripe Jul 8, 2026
deeec31
Implemented LocalMediaProvider.getAlbumDetail and getStreamUrl
Piripe Jul 24, 2026
90e7836
Implemented SubsonicProvider.getSongList
Piripe Jul 24, 2026
f726352
Got the provider list working (kind of)
Piripe Jul 24, 2026
ffef52f
Added Set current provider button in the provider list
Piripe Jul 24, 2026
bcac56f
Implemented LocalMediaProvider.getSongList and fixed getImageUrl
Piripe Jul 24, 2026
7e661bb
Implemented LocalMediaProvider.getAlbumArtistList (without search)
Piripe Jul 24, 2026
a2bef15
Implemented LocalMediaProvider.getAlbumArtistDetail and getAlbumList …
Piripe Jul 24, 2026
4161d8a
Added OpenSubsonic logo
Piripe Jul 25, 2026
a396f66
Implemented SubsonicProvider.getAlbumArtistList
Piripe Jul 25, 2026
57d39e3
MediaProvider.getAlbumArtistDetail now returns albums
Piripe Jul 25, 2026
5b6a949
Implemented SubsonicMediaProvider.getPlaylistList
Piripe Jul 25, 2026
41f8fe2
Implemented SubsonicMediaProvider.getPlaylistSongList
Piripe Jul 25, 2026
9ecfef3
Dynamic nav bar depending on provider features
Piripe Jul 25, 2026
28368ed
Implemented SubsonicMediaProvider.createPlaylist addToPlaylist and re…
Piripe Jul 25, 2026
de5a93b
Remove every uses of navidromeID and Local id
Piripe Jul 26, 2026
671b5d0
Request image from the media provider
Piripe Jul 26, 2026
1195f4f
Merge branch master into refactor
Piripe Jul 26, 2026
e0733c9
Updated lyrics system for the new provider and implemented SubsonicMe…
Piripe Jul 27, 2026
c91dbee
Avoid crash with LocalMediaProvider.getLyrics
Piripe Jul 27, 2026
db3d0d1
Added Navidrome media provider
Piripe Jul 27, 2026
54b3fda
Removed ExplicitStatus and MediaModel.QueueSong
Piripe Jul 27, 2026
8026576
Removed Count methods in MediaProvider
Piripe Jul 27, 2026
96e9e30
Added album sort based on provider's supported sorting
Piripe Jul 27, 2026
11b843d
Implement artist biographies, remove RelatedArtist, make MediaModels …
CraftWorksMC Jul 27, 2026
6ca553d
Fix album duration
CraftWorksMC Jul 27, 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
5 changes: 4 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
plugins {
id("com.android.application")
id("com.google.devtools.ksp")
kotlin("plugin.serialization") version "2.4.0"
kotlin("plugin.serialization") version "2.3.21"
alias(libs.plugins.compose.compiler)
alias(libs.plugins.hilt)
alias(libs.plugins.ktorfit)
}

android {
Expand Down Expand Up @@ -100,6 +101,8 @@ dependencies {
implementation(libs.androidx.datastore.preferences)

implementation(libs.composefadingedges)
implementation(libs.ktorfit)
ksp(libs.kotlin.metadata.jvm)

testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/craftworks/music/Application.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.craftworks.music

import android.app.Application
import com.craftworks.music.managers.LocalProviderManager
import com.craftworks.music.managers.NavidromeManager
import com.craftworks.music.managers.MediaProviderManager
import com.craftworks.music.managers.MigrationManager
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class ChoraApplication : Application(){
override fun onCreate() {
super.onCreate()
NavidromeManager.init(this)
LocalProviderManager.init(this)
MigrationManager.init(this)
MediaProviderManager.init(this)
}
}
20 changes: 12 additions & 8 deletions app/src/main/java/com/craftworks/music/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ import androidx.tv.material3.NavigationDrawer
import androidx.tv.material3.NavigationDrawerItem
import androidx.tv.material3.rememberDrawerState
import com.craftworks.music.data.BottomNavItem
import com.craftworks.music.data.model.ProviderFeatures
import com.craftworks.music.data.model.Screen
import com.craftworks.music.managers.LocalProviderManager
import com.craftworks.music.managers.NavidromeManager
import com.craftworks.music.managers.MediaProviderManager
import com.craftworks.music.managers.settings.AppTheme
import com.craftworks.music.managers.settings.AppearanceSettingsManager
import com.craftworks.music.player.ChoraMediaLibraryService
Expand Down Expand Up @@ -334,13 +334,10 @@ class MainActivity : ComponentActivity() {
var showNoProvidersDialog by rememberSaveable { mutableStateOf(false) }

LaunchedEffect(Unit) {
val folders = LocalProviderManager.getAllFolders()
val servers = NavidromeManager.getAllServers()

showNoProvidersDialog = !(folders.isEmpty() && servers.isEmpty())
showNoProvidersDialog = MediaProviderManager.allProviders.value.isEmpty()
}

if (!showNoProvidersDialog) {
if (showNoProvidersDialog) {
if (isTv) {
OnboardingDialog { showNoProvidersDialog = true }
} else {
Expand Down Expand Up @@ -668,6 +665,7 @@ fun AnimatedBottomNavBar(
val backStackEntry by navController.currentBackStackEntryAsState()
val coroutineScope = rememberCoroutineScope()
val context = LocalContext.current
val currentProvider by MediaProviderManager.currentProvider.collectAsStateWithLifecycle()

val orderedNavItems = AppearanceSettingsManager(context).bottomNavItemsFlow.collectAsState(
initial = listOf(
Expand All @@ -687,6 +685,11 @@ fun AnimatedBottomNavBar(
)
).value

orderedNavItems.first {it.screenRoute == "radio_screen"}.enabled =
currentProvider?.featureFlags?.has(ProviderFeatures.INTERNET_RADIO) ?: false
orderedNavItems.first {it.screenRoute == "playlist_screen"}.enabled =
currentProvider?.featureFlags?.has(ProviderFeatures.PLAYLIST) ?: false

if (LocalConfiguration.current.orientation == Configuration.ORIENTATION_PORTRAIT) {
val expanded by remember { derivedStateOf { scaffoldState.bottomSheetState.targetValue == SheetValue.Expanded } }

Expand Down Expand Up @@ -820,7 +823,8 @@ fun AnimatedBottomNavBar(
}
}

fun formatMilliseconds(seconds: Int): String {
// TODO("Move these utils funtions to a separated utils package")
fun formatSeconds(seconds: Int): String {
return String.format(Locale.getDefault(), "%02d:%02d", seconds / 60, seconds % 60)
}

Expand Down
6 changes: 0 additions & 6 deletions app/src/main/java/com/craftworks/music/NavGraph.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import androidx.navigation.compose.composable
import androidx.navigation.compose.navigation
import androidx.navigation.navArgument
import com.craftworks.music.data.model.Screen
import com.craftworks.music.data.model.playlistList
import com.craftworks.music.data.repository.LyricsState
import com.craftworks.music.managers.settings.AppearanceSettingsManager
import com.craftworks.music.managers.settings.LocalDataSettingsManager
Expand Down Expand Up @@ -98,9 +97,6 @@ fun SetupNavGraph(
val isTv = LocalConfiguration.current.uiMode and
Configuration.UI_MODE_TYPE_MASK == Configuration.UI_MODE_TYPE_TELEVISION

playlistList =
LocalDataSettingsManager(context).localPlaylists.collectAsStateWithLifecycle(mutableListOf()).value

LyricsState.useLrcLib =
MediaProviderSettingsManager(context).lrcLibLyricsFlow.collectAsStateWithLifecycle(true).value

Expand All @@ -112,8 +108,6 @@ fun SetupNavGraph(

val animationSpec = MaterialTheme.LocalMotionScheme.current.slowSpatialSpec<Float>()



NavHost(
navController = navController,
startDestination = Screen.Home.route,
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class LrclibDataSource @Inject constructor(
suspend fun getLrcLibLyrics(metadata: MediaMetadata?, ignoreCachedResponse: Boolean = false): List<Lyric> = withContext(Dispatchers.IO) {
val baseUrl = settingsManager.lrcLibEndpointFlow.first()

val artist = metadata?.extras?.getString("lyricsArtist")
val artist = metadata?.extras?.getString("lyricsArtist") ?: metadata?.artist.toString()
val title = metadata?.title
val album = metadata?.albumTitle
val duration = metadata?.durationMs?.div(1000)
Expand Down
Loading