Skip to content

Commit

Permalink
Remove from play archived songs for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Xwilarg committed Oct 31, 2024
1 parent ef72446 commit 9ad9497
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class MainActivity : AppCompatActivity() {

try {
data = Gson().fromJson(File(filesDir, "${currUrl}info.json").readText(), MusicData::class.java)
data.musics = data.musics.filter { !it.isArchived }.toTypedArray()
downloaded = data.musics.toMutableList()
}
catch (e: Exception) { }
Expand All @@ -104,6 +105,7 @@ class MainActivity : AppCompatActivity() {
text = URL("https://${currUrl}?json=1").readText()
File(filesDir, "${currUrl}info.json").writeText(text)
data = Gson().fromJson(File(filesDir, "${currUrl}info.json").readText(), MusicData::class.java)
data.musics = data.musics.filter { !it.isArchived }.toTypedArray()
} catch (e: Exception) {
// TODO: Handle exception
return@execute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.example.euphonia.data
import java.util.Dictionary

data class MusicData(
val musics: Array<Song>,
var musics: Array<Song>,
val highlight: Array<String>,
val playlists: Map<String, Playlist>?,
val albums: Map<String, Album>
Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/java/com/example/euphonia/data/Song.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ data class Song(
val playlist: String,
val album: String?,
val source: String?,
val type: String?
val type: String?,
val isArchived: Boolean
)

data class ExtendedSong(
Expand Down

0 comments on commit 9ad9497

Please sign in to comment.