detail: fix genre sort issue
Fix a problem where GenreDetailFragment would apply ASCENDING when ARTIST was selected in the sort menu. Turns out it was a bad constant match.
This commit is contained in:
parent
7e32763662
commit
d0835c3a0c
5 changed files with 9 additions and 11 deletions
|
@ -38,6 +38,7 @@ import org.oxycblt.auxio.util.logD
|
|||
|
||||
/**
|
||||
* The [DetailFragment] for a genre.
|
||||
* TODO: Fix issue where ARTIST order defaults to ASCENDING for some reason.
|
||||
* @author OxygenCobalt
|
||||
*/
|
||||
class GenreDetailFragment : DetailFragment() {
|
||||
|
|
|
@ -40,14 +40,13 @@ import org.oxycblt.auxio.util.logD
|
|||
*
|
||||
* You think that if you wanted to query a song's genre from a media database, you could just
|
||||
* put "genre" in the query and it would return it, right? But not with MediaStore! No, that's
|
||||
* too straightfoward for this SDK that was dropped on it's head as a baby. So instead, you
|
||||
* too straightfoward for this class that was dropped on it's head as a baby. So instead, you
|
||||
* have to query for each genre, query all the songs in each genre, and then iterate through those
|
||||
* songs to link every song with their genre. This is not documented anywhere in MediaStore's
|
||||
* documentation, and the O(mom im scared) algorithm you have to run to get it working
|
||||
* single-handedly DOUBLES Auxio's loading times. At no point have the devs considered that this
|
||||
* column is absolutely busted, and instead focused on adding infuriat- I mean nice proprietary
|
||||
* extensions to MediaStore for their own Google Play Music, and we all know how great that worked
|
||||
* out!
|
||||
* songs to link every song with their genre. This is not documented anywhere, and the
|
||||
* O(mom im scared) algorithm you have to run to get it working single-handedly DOUBLES Auxio's
|
||||
* loading times. At no point have the devs considered that this column is absolutely busted, and
|
||||
* instead focused on adding infuriat- I mean nice proprietary extensions to MediaStore for their
|
||||
* own Google Play Music, and we all know how great that worked out!
|
||||
*
|
||||
* It's not even ergonomics that makes this API bad. It's base implementation is completely borked
|
||||
* as well. Did you know that MediaStore doesn't accept dates that aren't from ID3v2.3 MP3 files?
|
||||
|
|
|
@ -170,7 +170,7 @@ enum class SortMode(@IdRes val itemId: Int) {
|
|||
return when (value) {
|
||||
INT_ASCENDING -> ASCENDING
|
||||
INT_DESCENDING -> DESCENDING
|
||||
INT_ARTIST -> ASCENDING
|
||||
INT_ARTIST -> ARTIST
|
||||
INT_ALBUM -> ALBUM
|
||||
INT_YEAR -> YEAR
|
||||
else -> null
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
style="@style/Widget.Auxio.TextView.Item.Primary"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/spacing_medium"
|
||||
android:text="@{song.name}"
|
||||
app:layout_constraintBottom_toTopOf="@+id/song_info"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -43,7 +42,6 @@
|
|||
style="@style/Widget.Auxio.TextView.Item.Secondary"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/spacing_medium"
|
||||
android:text="@{@string/fmt_two(song.album.artist.name, song.album.name)}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -64,7 +64,6 @@
|
|||
<style name="Widget.Auxio.Image.Full" parent="">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:outlineProvider">bounds</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Auxio.TabLayout.Label" parent="@style/TextAppearance.Design.Tab">
|
||||
|
@ -116,6 +115,7 @@
|
|||
|
||||
<style name="Widget.Auxio.TextView.Secondary" parent="Widget.Auxio.TextView.Base">
|
||||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:maxLines">1</item>
|
||||
<item name="android:textColor">?android:attr/textColorSecondary</item>
|
||||
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Subtitle1</item>
|
||||
</style>
|
||||
|
|
Loading…
Reference in a new issue