Skip to content

Commit

Permalink
Update 2.5.3 - Fixed #61 and Fixed #60
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Pinheiro committed Nov 10, 2021
1 parent cc3cdd8 commit d9eda85
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 76 deletions.
9 changes: 9 additions & 0 deletions on_audio_query/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [2.5.3] - [11.10.2021]
### Fixes
#### IOS
- **[Fixed]** song/artist/album from `Apple Music` returning when 'querying' - [#61](https://github.com/LucasPJS/on_audio_query/issues/61)
- **[Fixed]** wrong `artistId` returning from `[AlbumModel]` - [#60](https://github.com/LucasPJS/on_audio_query/issues/60)

### Documentation
- Updated `README` documentation.

## [2.5.2] - [10.25.2021]
### Fixes
#### Android
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.2
on_audio_query: ^2.5.3
```
### 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.2
on_audio_query: ^2.5.3
```
#### Solicitar Permissões:
Expand Down
68 changes: 34 additions & 34 deletions on_audio_query/example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
5887815DA2DBC8F11DF9CF8A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0581C187F55F6FBFD98A791A /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
B951C617F003C1AC49578FE3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0444FD517CDB154D93806F7A /* Pods_Runner.framework */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -30,12 +30,11 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0444FD517CDB154D93806F7A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
0581C187F55F6FBFD98A791A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
28CE67D0C2CDF48174EF0944 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3FEC31BE8C84BCB3D0AE46FB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
54A6A9B8133081670DD84280 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
Expand All @@ -46,15 +45,16 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A8CCD89F0C87D07CE6757B4D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
9C0A18ED452288083D2FC804 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
E0DE3BC8CA1E4AA713367B72 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B951C617F003C1AC49578FE3 /* Pods_Runner.framework in Frameworks */,
5887815DA2DBC8F11DF9CF8A /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -64,9 +64,9 @@
47B71ED6578BEB388DFE7ED6 /* Pods */ = {
isa = PBXGroup;
children = (
A8CCD89F0C87D07CE6757B4D /* Pods-Runner.debug.xcconfig */,
54A6A9B8133081670DD84280 /* Pods-Runner.release.xcconfig */,
3FEC31BE8C84BCB3D0AE46FB /* Pods-Runner.profile.xcconfig */,
9C0A18ED452288083D2FC804 /* Pods-Runner.debug.xcconfig */,
E0DE3BC8CA1E4AA713367B72 /* Pods-Runner.release.xcconfig */,
28CE67D0C2CDF48174EF0944 /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
Expand All @@ -82,14 +82,22 @@
name = Flutter;
sourceTree = "<group>";
};
97A6687458915406189255FD /* Frameworks */ = {
isa = PBXGroup;
children = (
0581C187F55F6FBFD98A791A /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
47B71ED6578BEB388DFE7ED6 /* Pods */,
D5EC4C02B1B7ABF79FDDFD57 /* Frameworks */,
97A6687458915406189255FD /* Frameworks */,
);
sourceTree = "<group>";
};
Expand All @@ -116,29 +124,21 @@
path = Runner;
sourceTree = "<group>";
};
D5EC4C02B1B7ABF79FDDFD57 /* Frameworks */ = {
isa = PBXGroup;
children = (
0444FD517CDB154D93806F7A /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
21206A07CFFB65C64E8FA636 /* [CP] Check Pods Manifest.lock */,
1E80063B4A79F5597C66A2ED /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
9133B65728143C8E6502BF40 /* [CP] Embed Pods Frameworks */,
308D7FDF12FC5F39971BB53B /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -197,7 +197,7 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
21206A07CFFB65C64E8FA636 /* [CP] Check Pods Manifest.lock */ = {
1E80063B4A79F5597C66A2ED /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -219,36 +219,36 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
308D7FDF12FC5F39971BB53B /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "Thin Binary";
outputPaths = (
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9133B65728143C8E6502BF40 /* [CP] Embed Pods Frameworks */ = {
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
6 changes: 4 additions & 2 deletions on_audio_query/ios/Classes/query/OnAlbumsQuery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ class OnAlbumsQuery {
// into a [Map<String, dynamic>], all keys are based on [Android]
// platforms so, if you change some key, will have to change the [Android] too.
for album in cursor {
let albumData = loadAlbumItem(album: album)
listOfAlbums.append(albumData)
if !album.items[0].isCloudItem && album.items[0].assetURL != nil {
let albumData = loadAlbumItem(album: album)
listOfAlbums.append(albumData)
}
}

// After finish the "query", go back to the "main" thread(You can only call flutter
Expand Down
7 changes: 5 additions & 2 deletions on_audio_query/ios/Classes/query/OnArtistQuery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ class OnArtistsQuery {
// into a [Map<String, dynamic>], all keys are based on [Android]
// platforms so, if you change some key, will have to change the [Android] too.
for artist in cursor {
let artistData = loadArtistItem(artist: artist)
listOfArtists.append(artistData)
// If the first song file don't has a assetURL, is a Cloud item.
if !artist.items[0].isCloudItem && artist.items[0].assetURL != nil {
let artistData = loadArtistItem(artist: artist)
listOfArtists.append(artistData)
}
}

// After finish the "query", go back to the "main" thread(You can only call flutter
Expand Down
7 changes: 5 additions & 2 deletions on_audio_query/ios/Classes/query/OnAudioQuery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ class OnAudioQuery {
// into a [Map<String, dynamic>], all keys are based on [Android]
// platforms so, if you change some key, will have to change the [Android] too.
for song in cursor.items! {
let songData = loadSongItem(song: song)
listOfSongs.append(songData)
// If the song file don't has a assetURL, is a Cloud item.
if !song.isCloudItem && song.assetURL != nil {
let songData = loadSongItem(song: song)
listOfSongs.append(songData)
}
}

// After finish the "query", go back to the "main" thread(You can only call flutter
Expand Down
21 changes: 15 additions & 6 deletions on_audio_query/ios/Classes/query/OnAudiosFromQuery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ class OnAudiosFromQuery {
// into a [Map<String, dynamic>], all keys are based on [Android]
// platforms so, if you change some key, will have to change the [Android] too.
for song in cursor.items! {
let songData = loadSongItem(song: song)
listOfSongs.append(songData)
// If the song file don't has a assetURL, is a Cloud item.
if !song.isCloudItem && song.assetURL != nil {
let songData = loadSongItem(song: song)
listOfSongs.append(songData)
}
}

// After finish the "query", go back to the "main" thread(You can only call flutter
Expand Down Expand Up @@ -105,17 +108,23 @@ class OnAudiosFromQuery {
if iPlaylist.name == iWhere as? String {
//For each song, format and add to the list
for song in playlist.items {
let songData = loadSongItem(song: song)
listOfSongs.append(songData)
// If the song file don't has a assetURL, is a Cloud item.
if !song.isCloudItem && song.assetURL != nil {
let songData = loadSongItem(song: song)
listOfSongs.append(songData)
}
}
}
} else {
//Check if playlist id is equal to defined id
if iPlaylist.persistentID == iWhere as! Int {
//For each song, format and add to the list
for song in playlist.items {
let songData = loadSongItem(song: song)
listOfSongs.append(songData)
// If the song file don't has a assetURL, is a Cloud item.
if !song.isCloudItem && song.assetURL != nil {
let songData = loadSongItem(song: song)
listOfSongs.append(songData)
}
}
}
}
Expand Down
16 changes: 9 additions & 7 deletions on_audio_query/ios/Classes/query/OnGenresQuery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ class OnGenresQuery {
// into a [Map<String, dynamic>], all keys are based on [Android]
// platforms so, if you change some key, will have to change the [Android] too.
for genre in cursor {
var genreData = loadGenreItem(genre: genre)

// Count and add the number of songs for every genre.
let tmpMediaCount = getMediaCount(type: 0, id: genreData["_id"] as! UInt64)
genreData["num_of_songs"] = tmpMediaCount

listOfGenres.append(genreData)
if !genre.items[0].isCloudItem && genre.items[0].assetURL != nil {
var genreData = loadGenreItem(genre: genre)

// Count and add the number of songs for every genre.
let tmpMediaCount = getMediaCount(type: 0, id: genreData["_id"] as! UInt64)
genreData["num_of_songs"] = tmpMediaCount

listOfGenres.append(genreData)
}
}

// After finish the "query", go back to the "main" thread(You can only call flutter
Expand Down
17 changes: 10 additions & 7 deletions on_audio_query/ios/Classes/query/OnPlaylistsQuery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ class OnPlaylistsQuery {
// into a [Map<String, dynamic>], all keys are based on [Android]
// platforms so, if you change some key, will have to change the [Android] too.
for playlist in cursor {
var playlistData = loadPlaylistItem(playlist: playlist)

// Count and add the number of songs for every genre.
let tmpMediaCount = getMediaCount(type: 1, id: playlistData["_id"] as! UInt64)
playlistData["num_of_songs"] = tmpMediaCount

listOfPlaylists.append(playlistData)
// If the first song file don't has a assetURL, is a Cloud item.
if !playlist.items[0].isCloudItem && playlist.items[0].assetURL != nil {
var playlistData = loadPlaylistItem(playlist: playlist)

// Count and add the number of songs for every genre.
let tmpMediaCount = getMediaCount(type: 1, id: playlistData["_id"] as! UInt64)
playlistData["num_of_songs"] = tmpMediaCount

listOfPlaylists.append(playlistData)
}
}

// After finish the "query", go back to the "main" thread(You can only call flutter
Expand Down
Loading

0 comments on commit d9eda85

Please sign in to comment.