Skip to content

Commit c167d52

Browse files
InhishonorSebaUbuntu
authored andcommitted
Twelve: Get new random content every time app opens
Change-Id: Ib526fdb7164aa9e466d5ceed773097639033c695
1 parent e765cd7 commit c167d52

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

app/src/main/java/org/lineageos/twelve/datasources/MediaStoreDataSource.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ import org.lineageos.twelve.query.like
5757
import org.lineageos.twelve.query.neq
5858
import org.lineageos.twelve.query.query
5959
import org.lineageos.twelve.repositories.ProvidersRepository
60-
import java.time.LocalDateTime
61-
import kotlin.random.Random
6260

6361
/**
6462
* [MediaStore.Audio] backed data source.
@@ -175,8 +173,6 @@ class MediaStoreDataSource(
175173
artists(providerIdentifier, SortingRule(SortingStrategy.NAME)),
176174
genres(providerIdentifier, SortingRule(SortingStrategy.NAME)),
177175
) { mostPlayed, albums, artists, genres ->
178-
val now = LocalDateTime.now()
179-
180176
Result.Success(
181177
listOf(
182178
mostPlayed.map {
@@ -194,7 +190,7 @@ class MediaStoreDataSource(
194190
LocalizedString.StringResIdLocalizedString(
195191
R.string.activity_random_albums
196192
),
197-
it.shuffled(Random(now.dayOfYear)),
193+
it.shuffled(),
198194
)
199195
},
200196
artists.map {
@@ -203,7 +199,7 @@ class MediaStoreDataSource(
203199
LocalizedString.StringResIdLocalizedString(
204200
R.string.activity_random_artists
205201
),
206-
it.shuffled(Random(now.dayOfYear)),
202+
it.shuffled(),
207203
)
208204
},
209205
genres.map {
@@ -212,7 +208,7 @@ class MediaStoreDataSource(
212208
LocalizedString.StringResIdLocalizedString(
213209
R.string.activity_random_genres
214210
),
215-
it.shuffled(Random(now.dayOfYear)),
211+
it.shuffled(),
216212
)
217213
},
218214
).mapNotNull {

0 commit comments

Comments
 (0)