-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from musicorum-app/dev
Update to 1.22-release
- Loading branch information
Showing
53 changed files
with
463 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
app/src/main/java/io/musicorum/mobile/datastore/AnalyticsConsent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.musicorum.mobile.datastore | ||
|
||
import androidx.datastore.preferences.core.booleanPreferencesKey | ||
|
||
object AnalyticsConsent { | ||
const val DataStoreName = "analyticsConsent" | ||
val CONSENT_KEY = booleanPreferencesKey("consent") | ||
} |
11 changes: 11 additions & 0 deletions
11
app/src/main/java/io/musicorum/mobile/datastore/LocalUser.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package io.musicorum.mobile.datastore | ||
|
||
import androidx.datastore.preferences.core.longPreferencesKey | ||
import androidx.datastore.preferences.core.stringPreferencesKey | ||
|
||
object LocalUser { | ||
const val DataStoreName = "partialUser" | ||
val USERNAME_KEY = stringPreferencesKey("usernameArg") | ||
val PROFILE_ICON_KEY = stringPreferencesKey("profilePictureUrl") | ||
val EXPIRES_IN_KEY = longPreferencesKey("expires_in") | ||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/io/musicorum/mobile/datastore/ScrobblePreferences.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.musicorum.mobile.datastore | ||
|
||
import androidx.datastore.preferences.core.booleanPreferencesKey | ||
import androidx.datastore.preferences.core.floatPreferencesKey | ||
import androidx.datastore.preferences.core.stringSetPreferencesKey | ||
|
||
object ScrobblePreferences { | ||
const val DataStoreName = "scrobblePrefs" | ||
val SCROBBLE_POINT_KEY = floatPreferencesKey("scrobblePoint") | ||
val ENABLED_KEY = booleanPreferencesKey("enabled") | ||
val ALLOWED_APPS_KEY = stringSetPreferencesKey("enabledApps") | ||
val UPDATED_NOWPLAYING_KEY = booleanPreferencesKey("updateNowPlaying") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.musicorum.mobile.datastore | ||
|
||
import androidx.datastore.preferences.core.stringPreferencesKey | ||
|
||
object UserData { | ||
const val DataStoreName = "userdata" | ||
val SESSION_KEY = stringPreferencesKey("session_key") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/src/main/java/io/musicorum/mobile/repositories/CachedScrobblesRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
app/src/main/java/io/musicorum/mobile/repositories/IPendingScrobbles.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.musicorum.mobile.repositories | ||
|
||
import io.musicorum.mobile.models.PendingScrobble | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface IPendingScrobbles { | ||
suspend fun getAllScrobblesStream(): Flow<List<PendingScrobble>> | ||
|
||
suspend fun deleteScrobble(scrobble: PendingScrobble) | ||
|
||
suspend fun insertScrobble(scrobble: PendingScrobble) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
app/src/main/java/io/musicorum/mobile/repositories/OfflineScrobblesRepository.kt
This file was deleted.
Oops, something went wrong.
11 changes: 7 additions & 4 deletions
11
app/src/main/java/io/musicorum/mobile/repositories/PendingScrobblesRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
package io.musicorum.mobile.repositories | ||
|
||
import io.musicorum.mobile.models.PendingScrobble | ||
import io.musicorum.mobile.repositories.daos.PendingScrobblesDao | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface PendingScrobblesRepository { | ||
suspend fun getAllScrobblesStream(): Flow<List<PendingScrobble>> | ||
class PendingScrobblesRepository(private val scrobblesDao: PendingScrobblesDao) : | ||
IPendingScrobbles { | ||
override suspend fun getAllScrobblesStream(): Flow<List<PendingScrobble>> = | ||
scrobblesDao.getAll() | ||
|
||
suspend fun deleteScrobble(scrobble: PendingScrobble) | ||
override suspend fun deleteScrobble(scrobble: PendingScrobble) = scrobblesDao.delete(scrobble) | ||
|
||
suspend fun insertScrobble(scrobble: PendingScrobble) | ||
override suspend fun insertScrobble(scrobble: PendingScrobble) = scrobblesDao.insert(scrobble) | ||
} |
2 changes: 1 addition & 1 deletion
2
...obile/database/daos/CachedScrobblesDao.kt → ...e/repositories/daos/CachedScrobblesDao.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...bile/database/daos/PendingScrobblesDao.kt → .../repositories/daos/PendingScrobblesDao.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.