Skip to content

Commit

Permalink
Update 2.5.2 - Fixed #56
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Pinheiro committed Oct 25, 2021
1 parent 19630c4 commit cc3cdd8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 6 deletions.
14 changes: 14 additions & 0 deletions on_audio_query/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## [2.5.2] - [10.25.2021]
### Fixes
#### Android
- **[Fixed]** wrong value returning from: - [#56](https://github.com/LucasPJS/on_audio_query/issues/56)
- `[is_music]`.
- `[is_alarm]`.
- `[is_notification]`.
- `[is_ringtone]`.
- `[is_podcast]`.
- `[is_audiobook]`.

### Documentation
- Updated `README` documentation.

## [2.5.1] - [10.19.2021]
### Fixes
#### Dart
Expand Down
4 changes: 2 additions & 2 deletions on_audio_query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NOTE: Feel free to help with readme translations

<!-- ✔️ | ❌ -->
| Methods | Android | IOS | Web |
|--------------|-----------------|-----------------|-----------------|
|-------|:----------:|:----------:|:----------:|
| `querySongs` | `✔️` | `✔️` | `✔️` | <br>
| `queryAlbums` | `✔️` | `✔️` | `✔️` | <br>
| `queryArtists` | `✔️` | `✔️` | `✔️` | <br>
Expand Down 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.1
on_audio_query: ^2.5.2
```
### Request Permission:
Expand Down
4 changes: 2 additions & 2 deletions on_audio_query/README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NOTE: Fique à vontade para ajudar nas traduções

<!-- ✔️ | ❌ -->
| Methods | Android | IOS | Web |
|--------------|-----------------|-----------------|-----------------|
|-------|:----------:|:----------:|:----------:|
| `querySongs` | `✔️` | `✔️` | `✔️` | <br>
| `queryAlbums` | `✔️` | `✔️` | `✔️` | <br>
| `queryArtists` | `✔️` | `✔️` | `✔️` | <br>
Expand Down 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.1
on_audio_query: ^2.5.2
```
#### Solicitar Permissões:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class OnAudioHelper {
//This method will separate [String] from [Int]
fun loadSongItem(itemProperty: String, cursor: Cursor): Any? {
return when (itemProperty) {
// Int
"_id",
"album_id",
"artist_id" -> {
Expand All @@ -48,14 +49,26 @@ class OnAudioHelper {
"date_modified",
"duration",
"track" -> cursor.getInt(cursor.getColumnIndex(itemProperty))
// Boolean
"is_alarm",
"is_audiobook",
"is_music",
"is_notification",
"is_podcast",
"is_ringtone" -> {
val value = cursor.getString(cursor.getColumnIndex(itemProperty))
if (value == "0") return false
return true
}
// String
else -> cursor.getString(cursor.getColumnIndex(itemProperty))
}
}

//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) {
Expand Down
2 changes: 1 addition & 1 deletion 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.1
version: 2.5.2
homepage: https://github.com/LucasPJS/on_audio_query/tree/main/on_audio_query
# pub.dev: https://pub.dev/packages/on_audio_query
# ========
Expand Down

0 comments on commit cc3cdd8

Please sign in to comment.