mirror of
https://github.com/playmusicexporter/playmusicexporter
synced 2024-05-15 05:26:43 +00:00
Artwork loading and path fixes.
This commit is contained in:
parent
bb2cd0cf80
commit
782ada5c12
|
@ -69,8 +69,13 @@ public class ArtworkLoader {
|
|||
if (!TextUtils.isEmpty(artworkUrl)) {
|
||||
// Tries to load the artwork via internet
|
||||
try {
|
||||
URL url = new URL(artworkUrl);
|
||||
bitmap = BitmapFactory.decodeStream(url.openStream());
|
||||
if (artworkUrl.contains("mediastore")) {
|
||||
Logger.getInstance().logError("LoadArtwork", "mediastore artwork");
|
||||
//TODO handle mediastore album art using ContentResolver
|
||||
} else {
|
||||
URL url = new URL(artworkUrl);
|
||||
bitmap = BitmapFactory.decodeStream(url.openStream());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Error
|
||||
Logger.getInstance().logError("LoadArtwork", e.toString());
|
||||
|
|
|
@ -137,7 +137,7 @@ public class PlayMusicManager {
|
|||
* @return Gets the temp path to the database
|
||||
*/
|
||||
private String getTempDatabasePath() {
|
||||
return getTempPath() + "/music.db";
|
||||
return getTempPath() + "music.db";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -443,8 +443,8 @@ public class PlayMusicManager {
|
|||
String path;
|
||||
|
||||
// Fix the path for Play Music 5.9.1854
|
||||
if (!artworkPath.startsWith("artwork2/folder/"))
|
||||
artworkPath = "artwork2/folder/" + artworkPath;
|
||||
if (!artworkPath.startsWith("artwork/"))
|
||||
artworkPath = "artwork/" + artworkPath;
|
||||
|
||||
// Search in the public data
|
||||
for (String publicData : mPathPublicData) {
|
||||
|
@ -496,7 +496,7 @@ public class PlayMusicManager {
|
|||
// Could not find the source file
|
||||
if (srcFile == null) return false;
|
||||
|
||||
String fileTmp = getTempPath() + "/tmp.mp3";
|
||||
String fileTmp = getTempPath() + "tmp.mp3";
|
||||
|
||||
// Copy to temp path failed
|
||||
if (!SuperUserTools.fileCopy(srcFile, fileTmp))
|
||||
|
@ -504,7 +504,7 @@ public class PlayMusicManager {
|
|||
|
||||
// Encrypt the file
|
||||
if (musicTrack.isEncoded()) {
|
||||
String fileTmpCrypt = getTempPath() + "/crypt.mp3";
|
||||
String fileTmpCrypt = getTempPath() + "crypt.mp3";
|
||||
|
||||
// Encrypts the file
|
||||
if (trackEncrypt(musicTrack, fileTmp, fileTmpCrypt)) {
|
||||
|
@ -530,7 +530,7 @@ public class PlayMusicManager {
|
|||
FileTools.directoryCreate(parentDirectory);
|
||||
} else {
|
||||
// Complex uri (Lollipop)
|
||||
dest = getTempPath() + "/final.mp3";
|
||||
dest = getTempPath() + "final.mp3";
|
||||
|
||||
// The root
|
||||
DocumentFile document = DocumentFile.fromTreeUri(mContext, uri);
|
||||
|
@ -793,8 +793,8 @@ public class PlayMusicManager {
|
|||
* Deletes all cache files
|
||||
*/
|
||||
private void cleanUp() {
|
||||
FileTools.fileDelete(getTempPath() + "/final.mp3");
|
||||
FileTools.fileDelete(getTempPath() + "/tmp.mp3");
|
||||
FileTools.fileDelete(getTempPath() + "/crypt.mp3");
|
||||
FileTools.fileDelete(getTempPath() + "final.mp3");
|
||||
FileTools.fileDelete(getTempPath() + "tmp.mp3");
|
||||
FileTools.fileDelete(getTempPath() + "crypt.mp3");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue