Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
Release of 1.2.0
Browse files Browse the repository at this point in the history
Change the `getImagePath` return from `String` to `Bytes(Uint8List)`. (✔️)
Fix `bug` with permission methods. (✔️)
Fix no `ALBUM` tag in `TagType`. (✔️)
Add feature to search inside all folders when using Android 10 or above. (✔️)
Change `readAudio`, `readAllAudio` and `readSpecificsAudioTags` return type from `Map` to `AudioModel`. (✔️)
Discontinue `readAllAudio` and `getImagePath`. (✔️)
Create `ImageModel`. (✔️)
Add `ALL` possible tag type. (✔️)
Add `ALL` possible getter to `AudioModel`. (✔️)
  • Loading branch information
LucJosin authored Oct 22, 2021
2 parents e6176d8 + e877222 commit e9a505c
Show file tree
Hide file tree
Showing 20 changed files with 1,279 additions and 773 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
## [1.2.0] - [10.22.2021]
### Features
- **[Added]** option to search inside all folders when using `[editAudio]` on Android 10 or above. - [#5](https://github.com/LucasPJS/on_audio_query/issues/5)
- **[Added]** `ALL` possible tag type.
- **[Added]** `ALL` possible getter to `[AudioModel]`.
- **[Created]** `[ImageModel]`.

### Fixes
- **[Fixed]** no ALBUM tag in TagType. - [#2](https://github.com/LucasPJS/on_audio_query/issues/2)
- **[Fixed]** bug with permission methods. - [#4](https://github.com/LucasPJS/on_audio_query/issues/4)

### Documentation
- Updated `README` documentation.

### Changes
#### Dart
- Changed `[readAudio]`, `[readAllAudio]` and `[readSpecificsAudioTags]` return type from `Map` to `AudioModel`.

### ⚠ Important Changes
#### Dart
- Now `[getImage]` a `[ImageModel]`. - [#1](https://github.com/LucasPJS/on_audio_query/issues/1)
- Now `[readAudio]`, `[readAllAudio ]` and `[readSpecificsAudioTags]` return type from `Map` to `AudioModel`.

#### @Deprecated
- `[readAllAudio]`.
- Use `[readAudio]` instead.
- `[getImagePath]`.
- Use `[getImage]` instead.
- `[id]` from `[AudioModel]`.

## [1.1.0] - [10.20.2021]
### Features
#### Dart
Expand Down
8 changes: 8 additions & 0 deletions DEPRECATED.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [1.2.0] - [10.20.2021] -> [X.X.X] - [XX.XX.XXXX]
### Deprecated
- `[readAllAudio]`.
- Use `[readAudio]` instead.
- `[getImagePath]`.
- Use `[getImage]` instead.
- `[id]` from `[AudioModel]`.

## [1.1.0] - [10.20.2021] -> [X.X.X] - [XX.XX.XXXX]
### Deprecated
- `[AudiosTagModel]`.
Expand Down
77 changes: 43 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ NOTE: Feel free to help with readme translations
Add the following code to your `pubspec.yaml`:
```yaml
dependencies:
on_audio_edit: ^1.1.0
on_audio_edit: ^1.2.0
```
#### Request Permission:
Expand Down Expand Up @@ -80,20 +80,36 @@ OnAudioEdit() // The main method to start using the plugin.
```
All types of methods on this plugin:

### Read methods

| Methods | Parameters | Return |
|--------------|-----------------|-----------------|
| [`readAudio`](#readaudio) | `(String)` | `Map<dynamic, dynamic>` | <br>
| [`readAllAudio`](#readallaudio) | `(String)` | `Map<TagsType, dynamic>` | <br>
| [`readAudios`](#readaudios) | `(List<String>)` | `List<AudiosTagModel>` | <br>
| [`readAudio`](#readaudio) | `(String)` | `AudioModel` | <br>
| [`readAudios`](#readaudios) | `(List<String>)` | `List<AudioModel>` | <br>
| [`readSingleAudioTag`](#readsingleaudiotag) | `(String, TagsType)` | `String` | <br>
| [`readSpecificsAudioTags`](#readspecificsaudiotags) | `(String, List<TagsType>)` | `Map<dynamic, dynamic>` | <br>
| [`readSpecificsAudioTags`](#readspecificsaudiotags) | `(String, List<TagsType>)` | `AudioModel` | <br>

### Edit methods

| Methods | Parameters | Return |
|--------------|-----------------|-----------------|
| [`editAudio`](#editaudio) | `(String, Map<TagsType, dynamic>)` | `bool` | <br>
| [`editAudios`](#editaudios) | `(List<String>, List<Map<TagsType, dynamic>>)` | `bool` | <br>
| [`editArtwork`](#editartwork) | `(String, bool, String, ArtworkFormat, int, String)` | `bool` | <br>

### Delete methods

| Methods | Parameters | Return |
|--------------|-----------------|-----------------|
| [`deleteArtwork`]() | **[W]**`(String)` | `bool` | <br>
| [`deleteArtworks`]() | **[W]**`(List<String>)` | `bool` | <br>
| [`deleteAudio`]() | **[W]**`(String)` | `bool` | <br>
| [`getImagePath`]() | | `String` | <br>

### Permission/Image methods

| Methods | Parameters | Return |
|--------------|-----------------|-----------------|
| [`getImage`]() | `ArtworkFormat, Quality` | `ImageModel` | <br>
| [`permissionsStatus`]() | | `bool` | <br>
| [`resetComplexPermission`]() | **[Q]** | `bool` | <br>
| [`requestComplexPermission`]() | **[Q]** | `bool` | <br>
Expand All @@ -111,47 +127,40 @@ All types of methods on this plugin:
| `ARTISTS` | `ORIGINAL_YEAR` | `LANGUAGE` | `TEMPO` | `CHANNELS` | <br>
| `BEATS_PER_MINUTE` | `PRODUCER` | `KEY` | `TAGS` | `COVER_ART` | <br>
| `COMPOSER` | `QUALITY` | `ISRC` | `SUBTITLE` | `TYPE` | <br>
| `COUNTRY` | `RATING` | `FIRST_ARTWORK` | `LENGTH` |
| `COUNTRY` | `RATING` | `FIRST_ARTWORK` | `LENGTH` | [`More`](https://github.com/LucasPJS/on_audio_edit/blob/main/lib/details/types/tag_type.dart) | <br>
| `GENRE` | `RECORD_LABEL` | `YEAR` | `BITRATE` | <br>

**Using [readAllAudio](#readallaudio) you can get more infos about audio. See all list in: [AllTags](https://github.com/LucasPJS/on_audio_edit/blob/main/lib/details/types/tag_type.dart)**

## Examples:

#### readAudio
#### OnAudioEdit
```dart
// data: "/storage/1E65-6GH3/SomeMusic.mp3" or "/storage/someFolder/SomeMusic.mp3"
Map<dynamic, dynamic> song = await OnAudioEdit().readAudio(data);
var songTitle = song["TITLE"];
var songArtist = song["ARTIST"];
final OnAudioEdit _audioEdit = OnAudioEdit();
```

#### readAllAudio
This method read all possible info from a audio. See all list in: [AllTags](https://github.com/LucasPJS/on_audio_edit/blob/main/lib/details/types/tag_type.dart)
#### readAudio
```dart
Map<dynamic, dynamic> song = await OnAudioEdit().readAllAudio(data);
var songInfo1 = song["MIXER"];
var songInfo2 = song["MUSICBRAINZ_ORIGINAL_RELEASE_ID"];
var songInfo3 = song["AMAZON_ID"];
var songInfo4 = song["CONDUCTOR"];
// data: "/storage/1E65-6GH3/SomeMusic.mp3" or "/storage/someFolder/SomeMusic.mp3"
AudioModel song = await _audioEdit.readAudio(data);
String songTitle = song.title;
String songArtist = song.artist ?? '<No Artist>';
```

#### readAudios
```dart
List<String> allData = [data0, data1, data2];
List<AudiosTagModel> song = await OnAudioEdit().readAudios(allData);
List<AudioModel> song = await _audioEdit.readAudios(allData);
...
var songTitle1 = song[1].title;
var songTitle2 = song[2].title;
var songTitle3 = song[3].title;
String songTitle1 = song[0].title;
String songTitle2 = song[1].title;
String songTitle3 = song[2].title;
```

#### readSingleAudioTag
```dart
String title = await OnAudioEdit().readSingleAudioTag(data, TagsType.TITLE);
String title = await _audioEdit.readSingleAudioTag(data, TagsType.TITLE);
print(title); // Ex: Heavy, California
...
String artist = await OnAudioEdit().readSingleAudioTag(data, TagsType.ARTIST);
String artist = await _audioEdit.readSingleAudioTag(data, TagsType.ARTIST);
print(artist); // Ex: Jungle
```

Expand All @@ -161,10 +170,10 @@ This method read all possible info from a audio. See all list in: [AllTags](http
TagsType.TITLE,
TagsType.ARTIST
];
var songSpecifics = await OnAudioEdit().readSpecificsAudioTags(data, tags);
AudioModel songSpecifics = await _audioEdit.readSpecificsAudioTags(data, tags);
...
var songTitle = songSpecifics["TITLE"];
var songArtist = songSpecifics["ARTIST"];
String songTitle = songSpecifics.title;
String songArtist = songSpecifics ?? '<No Artist>';
```

#### editAudio
Expand All @@ -173,7 +182,7 @@ This method read all possible info from a audio. See all list in: [AllTags](http
TagsType.TITLE: "New Title",
TagsType.ARTIST: "New Artist"
};
bool song = await OnAudioEdit().editAudio(data, tags);
bool song = await _audioEdit.editAudio(data, tags);
print(song); //True or False
```

Expand All @@ -193,16 +202,16 @@ This method read all possible info from a audio. See all list in: [AllTags](http
data.add(song1);
data.add(song2);
data.add(song3);
bool result = await OnAudioEdit().editAudios(data, tags);
bool result = await _audioEdit.editAudios(data, tags);
print(result); //True or False
```

#### editAudio
#### editArtwork
⚠ **Note: If openFilePicker is false, imagePath can't be null.**
```dart
// Parameters: openFilePicker, imagePath, format, size, description
// DEFAULT: true, null, ArtworkFormat.JPEG, 24, "artwork"
bool song = await OnAudioEdit().editArtwork(data);
bool song = await _audioEdit.editArtwork(data);
print(song); //True or False
```

Expand Down
81 changes: 45 additions & 36 deletions README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ NOTE: Fique à vontade para ajudar nas traduções
Adicione o seguinte codigo para seu `pubspec.yaml`:
```yaml
dependencies:
on_audio_edit: ^1.1.0
on_audio_edit: ^1.2.0
```
#### Solicitar Permissões:
Expand Down Expand Up @@ -80,20 +80,36 @@ OnAudioEdit() // O comando principal para usar o plugin.
```
Todos os tipos de métodos nesse plugin:

### Read methods

| Methods | Parameters | Return |
|--------------|-----------------|-----------------|
| [`readAudio`](#readaudio) | `(String)` | `Map<dynamic, dynamic>` | <br>
| [`readAllAudio`](#readallaudio) | `(String)` | `Map<TagsType, dynamic>` | <br>
| [`readAudios`](#readaudios) | `(List<String>)` | `List<AudiosTagModel>` | <br>
| [`readAudio`](#readaudio) | `(String)` | `AudioModel` | <br>
| [`readAudios`](#readaudios) | `(List<String>)` | `List<AudioModel>` | <br>
| [`readSingleAudioTag`](#readsingleaudiotag) | `(String, TagsType)` | `String` | <br>
| [`readSpecificsAudioTags`](#readspecificsaudiotags) | `(String, List<TagsType>)` | `Map<dynamic, dynamic>` | <br>
| [`readSpecificsAudioTags`](#readspecificsaudiotags) | `(String, List<TagsType>)` | `AudioModel` | <br>

### Edit methods

| Methods | Parameters | Return |
|--------------|-----------------|-----------------|
| [`editAudio`](#editaudio) | `(String, Map<TagsType, dynamic>)` | `bool` | <br>
| [`editAudios`](#editaudios) | `(List<String>, List<Map<TagsType, dynamic>>)` | `bool` | <br>
| [`editArtwork`](#editartwork) | `(String, bool, String, ArtworkFormat, int, String)` | `bool` | <br>

### Delete methods

| Methods | Parameters | Return |
|--------------|-----------------|-----------------|
| [`deleteArtwork`]() | **[W]**`(String)` | `bool` | <br>
| [`deleteArtworks`]() | **[W]**`(List<String>)` | `bool` | <br>
| [`deleteAudio`]() | **[W]**`(String)` | `bool` | <br>
| [`getImagePath`]() | | `String` | <br>

### Permission/Image methods

| Methods | Parameters | Return |
|--------------|-----------------|-----------------|
| [`getImage`]() | `ArtworkFormat, Quality` | `ImageModel` | <br>
| [`permissionsStatus`]() | | `bool` | <br>
| [`resetComplexPermission`]() | **[Q]** | `bool` | <br>
| [`requestComplexPermission`]() | **[Q]** | `bool` | <br>
Expand All @@ -111,47 +127,40 @@ Todos os tipos de métodos nesse plugin:
| `ARTISTS` | `ORIGINAL_YEAR` | `LANGUAGE` | `TEMPO` | `CHANNELS` | <br>
| `BEATS_PER_MINUTE` | `PRODUCER` | `KEY` | `TAGS` | `COVER_ART` | <br>
| `COMPOSER` | `QUALITY` | `ISRC` | `SUBTITLE` | `TYPE` | <br>
| `COUNTRY` | `RATING` | `FIRST_ARTWORK` | `LENGTH` |
| `COUNTRY` | `RATING` | `FIRST_ARTWORK` | `LENGTH` | [`More`](https://github.com/LucasPJS/on_audio_edit/blob/main/lib/details/types/tag_type.dart) | <br>
| `GENRE` | `RECORD_LABEL` | `YEAR` | `BITRATE` | <br>

**Usando [readAllAudio](#readallaudio) você pode ver mais informações sobre o/os audio/audios. Veja toda a lista em: [AllTags](https://github.com/LucasPJS/on_audio_edit/blob/main/lib/details/types/tag_type.dart)**

## Exemplos:

#### readAudio
#### OnAudioEdit
```dart
// data: "/storage/1E65-6GH3/SomeMusic.mp3" or "/storage/someFolder/SomeMusic.mp3"
Map<dynamic, dynamic> song = await OnAudioEdit().readAudio(data);
var songTitle = song["TITLE"];
var songArtist = song["ARTIST"];
final OnAudioEdit _audioEdit = OnAudioEdit();
```

#### readAllAudio
Esse método ler toda informação possível de um audio. Veja toda a lista em: [AllTags](https://github.com/LucasPJS/on_audio_edit/blob/main/lib/details/types/tag_type.dart)
#### readAudio
```dart
Map<dynamic, dynamic> song = await OnAudioEdit().readAllAudio(data);
var songInfo1 = song["MIXER"];
var songInfo2 = song["MUSICBRAINZ_ORIGINAL_RELEASE_ID"];
var songInfo3 = song["AMAZON_ID"];
var songInfo4 = song["CONDUCTOR"];
// data: "/storage/1E65-6GH3/SomeMusic.mp3" or "/storage/someFolder/SomeMusic.mp3"
AudioModel song = await _audioEdit.readAudio(data);
String songTitle = song.title;
String songArtist = song.artist ?? '<No Artist>';
```

#### readAudios
```dart
List<String> allData = [data0, data1, data2];
List<AudiosTagModel> song = await OnAudioEdit().readAudios(allData);
List<AudioModel> song = await _audioEdit.readAudios(allData);
...
var songTitle1 = song[1].title;
var songTitle2 = song[2].title;
var songTitle3 = song[3].title;
String songTitle1 = song[0].title;
String songTitle2 = song[1].title;
String songTitle3 = song[2].title;
```

#### readSingleAudioTag
```dart
String title = await OnAudioEdit().readSingleAudioTag(data, TagsType.TITLE);
String title = await _audioEdit.readSingleAudioTag(data, TagsType.TITLE);
print(title); // Ex: Heavy, California
...
String artist = await OnAudioEdit().readSingleAudioTag(data, TagsType.ARTIST);
String artist = await _audioEdit.readSingleAudioTag(data, TagsType.ARTIST);
print(artist); // Ex: Jungle
```

Expand All @@ -161,10 +170,10 @@ Esse método ler toda informação possível de um audio. Veja toda a lista em:
TagsType.TITLE,
TagsType.ARTIST
];
var songSpecifics = await OnAudioEdit().readSpecificsAudioTags(data, tags);
AudioModel songSpecifics = await _audioEdit.readSpecificsAudioTags(data, tags);
...
var songTitle = songSpecifics["TITLE"];
var songArtist = songSpecifics["ARTIST"];
String songTitle = songSpecifics.title;
String songArtist = songSpecifics ?? '<No Artist>';
```

#### editAudio
Expand All @@ -173,12 +182,12 @@ Esse método ler toda informação possível de um audio. Veja toda a lista em:
TagsType.TITLE: "New Title",
TagsType.ARTIST: "New Artist"
};
bool song = await OnAudioEdit().editAudio(data, tags);
bool song = await _audioEdit.editAudio(data, tags);
print(song); //True or False
```

#### editAudios
⚠ **Note: Esse método não está funcionando no Android 10 ou superior. Use: [editAudio](#editaudio)**
⚠ **Note: This method isn't implemented on Android 10 or above. Instead use: [editAudio](#editaudio)**
```dart
// Tags
List<<Map<TagsType, dynamic>> tags = [];
Expand All @@ -193,16 +202,16 @@ Esse método ler toda informação possível de um audio. Veja toda a lista em:
data.add(song1);
data.add(song2);
data.add(song3);
bool result = await OnAudioEdit().editAudios(data, tags);
bool result = await _audioEdit.editAudios(data, tags);
print(result); //True or False
```

#### editAudio
⚠ **Note: Se openFilePicker é falso, imagePath não pode ser nulo.**
#### editArtwork
⚠ **Note: If openFilePicker is false, imagePath can't be null.**
```dart
// Parameters: openFilePicker, imagePath, format, size, description
// DEFAULT: true, null, ArtworkFormat.JPEG, 24, "artwork"
bool song = await OnAudioEdit().editArtwork(data);
bool song = await _audioEdit.editArtwork(data);
print(song); //True or False
```

Expand Down
Loading

0 comments on commit e9a505c

Please sign in to comment.