aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AndroidManifest.xml2
-rw-r--r--src/github/daneren2005/dsub/domain/MusicDirectory.java9
-rw-r--r--src/github/daneren2005/dsub/service/CachedMusicService.java20
3 files changed, 20 insertions, 11 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 282936a0..62ad9f85 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="github.daneren2005.dsub"
android:installLocation="internalOnly"
- android:versionCode="121"
+ android:versionCode="122"
android:versionName="4.7.5">
<uses-permission android:name="android.permission.INTERNET"/>
diff --git a/src/github/daneren2005/dsub/domain/MusicDirectory.java b/src/github/daneren2005/dsub/domain/MusicDirectory.java
index a738f9bf..5b6bab26 100644
--- a/src/github/daneren2005/dsub/domain/MusicDirectory.java
+++ b/src/github/daneren2005/dsub/domain/MusicDirectory.java
@@ -139,6 +139,15 @@ public class MusicDirectory implements Serializable {
private Bookmark bookmark;
private int type = 0;
private int closeness;
+
+ public Entry() {
+
+ }
+ public Entry(Artist artist) {
+ this.id = artist.getId();
+ this.title = artist.getName();
+ this.directory = true;
+ }
public void loadMetadata(File file) {
try {
diff --git a/src/github/daneren2005/dsub/service/CachedMusicService.java b/src/github/daneren2005/dsub/service/CachedMusicService.java
index 58de141f..783f0b4d 100644
--- a/src/github/daneren2005/dsub/service/CachedMusicService.java
+++ b/src/github/daneren2005/dsub/service/CachedMusicService.java
@@ -20,6 +20,7 @@ package github.daneren2005.dsub.service;
import java.io.File;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
@@ -1252,7 +1253,7 @@ public class CachedMusicService implements MusicService {
boolean isTagBrowsing = Util.isTagBrowsing(context, musicService.getInstance(context));
// Run through each entry, trying to update the directory it is in
- List<Entry> songs;
+ final List<Entry> songs = new ArrayList<Entry>();
for(final Entry entry: entries) {
if(isTagBrowsing) {
// If starring album, needs to reference artist instead
@@ -1283,39 +1284,38 @@ public class CachedMusicService implements MusicService {
new IndexesUpdater(context, cacheName) {
@Override
public boolean checkResult(Artist check) {
- return checkResult(entry, new Entry(check));
+ return GenericEntryUpdater.this.checkResult(entry, new Entry(check));
}
@Override
public void updateResult(List<Artist> objects, Artist result) {
- updateResult(new Entry(result));
+ GenericEntryUpdater.this.updateResult(new Entry(result));
}
}.execute();
} else {
new MusicDirectoryUpdater(context, cacheName, parent) {
@Override
public boolean checkResult(Entry check) {
- return checkResult(entry, check);
+ return GenericEntryUpdater.this.checkResult(entry, check);
}
@Override
public void updateResult(List<Entry> objects, Entry result) {
- updateResult(result);
+ GenericEntryUpdater.this.updateResult(result);
}
}.execute();
}
if(entry instanceof PodcastEpisode) {
- PodcastEpisode episode = (PodcastEpisode) entry;
- new MusicDirectoryUpdater(context, cacheName, "p-" + entry.getId()) {
+ new MusicDirectoryUpdater(context, cacheName, "p-" + entry.getParent()) {
@Override
public boolean checkResult(Entry check) {
- return checkResult(entry, check);
+ return GenericEntryUpdater.this.checkResult(entry, check);
}
@Override
public void updateResult(List<Entry> objects, Entry result) {
- updateResult(result);
+ GenericEntryUpdater.this.updateResult(result);
}
}.execute();
} else if(!entry.isDirectory()) {
@@ -1329,7 +1329,7 @@ public class CachedMusicService implements MusicService {
@Override
public boolean checkResult(Entry check) {
for(Entry entry: songs) {
- if(checkResult(entry, check)) {
+ if(GenericEntryUpdater.this.checkResult(entry, check)) {
return true;
}
}