Skip to content

Commit

Permalink
Release of 2.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Pinheiro committed Oct 19, 2021
1 parent 36c6574 commit c75f6d4
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 13 deletions.
15 changes: 15 additions & 0 deletions on_audio_query/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## [2.5.1] - [10.19.2021]
### Fixes
#### Dart
- **[Fixed]** wrong value returning from `[artistId]` when using `[AlbumModel]`. - [#54](https://github.com/LucasPJS/on_audio_query/issues/54)

#### Android
- **[Fixed]** missing songs from `[queryAudiosFrom]` when using `GENRE`. - [#46](https://github.com/LucasPJS/on_audio_query/issues/46)

### Documentation
- Updated `README` documentation.

### ⚠ Important Changes
#### Dart
- Now `[artistId]` from `[AlbumModel]` return a `[int]`.

## [2.5.0] - [10.15.2021]
### Release
- `[2.5.0]` release.
Expand Down
2 changes: 1 addition & 1 deletion on_audio_query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ NOTE: Feel free to help with readme translations
Add the following code to your `pubspec.yaml`:
```yaml
dependencies:
on_audio_query: ^2.5.0
on_audio_query: ^2.5.1
```
### Request Permission:
Expand Down
2 changes: 1 addition & 1 deletion on_audio_query/README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ NOTE: Fique à vontade para ajudar nas traduções
Adicione o seguinte codigo para seu `pubspec.yaml`:
```yaml
dependencies:
on_audio_query: ^2.5.0
on_audio_query: ^2.5.1
```
#### Solicitar Permissões:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ class OnAudiosFromQuery : ViewModel() {
//Loading in Background
private suspend fun loadSongsFrom(): ArrayList<MutableMap<String, Any?>> =
withContext(Dispatchers.IO) {
// TODO: Add a [sortType].
// Setup the cursor with [uri], [projection], [selection](where) and [values](whereVal).
val cursor = resolver.query(uri, songProjection(), where, arrayOf(whereVal), sortType)
// Empty list.
Expand All @@ -125,6 +124,7 @@ class OnAudiosFromQuery : ViewModel() {
val tempExtraData = helper.loadSongExtraInfo(uri, tempData)
tempData.putAll(tempExtraData)

//
songsFromList.add(tempData)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ class OnAudioHelper {
//This method will separate [String] from [Int]
fun loadAlbumItem(itemProperty: String, cursor: Cursor): Any? {
return when (itemProperty) {
"_id" -> {
"_id",
"artist_id" -> {
// The [album] id from Android >= 30/R is a [Long] instead of [Int].
if (Build.VERSION.SDK_INT >= 30) {
cursor.getLong(cursor.getColumnIndex(itemProperty))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import android.provider.MediaStore
@SuppressLint("InlinedApi")
fun checkAudiosFromType(sortType: Int): String {
return when (sortType) {
0 -> MediaStore.Audio.Media.ALBUM + "=?"
1 -> MediaStore.Audio.Media.ALBUM_ID + "=?"
2 -> MediaStore.Audio.Media.ARTIST + "=?"
3 -> MediaStore.Audio.Media.ARTIST_ID + "=?"
4 -> MediaStore.Audio.Media.GENRE + "=?"
5 -> MediaStore.Audio.Media.GENRE_ID + "=?"
0 -> MediaStore.Audio.Media.ALBUM + " like ?"
1 -> MediaStore.Audio.Media.ALBUM_ID + " like ?"
2 -> MediaStore.Audio.Media.ARTIST + " like ?"
3 -> MediaStore.Audio.Media.ARTIST_ID + " like ?"
// Use the [TRIM] to remove all empty space from genre name.
4 -> "TRIM(\"" + MediaStore.Audio.Media.GENRE + "\")" + " like ?"
5 -> MediaStore.Audio.Media.GENRE_ID + " like ?"
else -> throw Exception("[checkAudiosFromType] value don't exist!")
}
}
6 changes: 3 additions & 3 deletions on_audio_query/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: on_audio_query
description: Flutter Plugin used to query audios/songs infos [title, artist, album, etc..] from device storage.
version: 2.5.0
version: 2.5.1
homepage: https://github.com/LucasPJS/on_audio_query/tree/main/on_audio_query
# pub.dev: https://pub.dev/packages/on_audio_query
# ========
Expand All @@ -14,8 +14,8 @@ environment:

dependencies:
# on_audio_query
on_audio_query_platform_interface: ^1.3.0
on_audio_query_web: ^1.3.1
on_audio_query_platform_interface: ^1.3.1
on_audio_query_web: ^1.3.2

# Flutter
flutter:
Expand Down

0 comments on commit c75f6d4

Please sign in to comment.