diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-04-30 21:44:33 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-04-30 21:44:33 -0700 |
commit | 93d03bc7ab2b078e48baad33257606e06875f994 (patch) | |
tree | 57cf355137d478fa748a0ac10d5958a8b2e941f7 /subsonic-android/src/github | |
parent | b59d47572ce3b7936328cc9c985355eefe24faa5 (diff) | |
download | dsub-93d03bc7ab2b078e48baad33257606e06875f994.tar.gz dsub-93d03bc7ab2b078e48baad33257606e06875f994.tar.bz2 dsub-93d03bc7ab2b078e48baad33257606e06875f994.zip |
Merge callbacks for artists so search fragment can use them
Diffstat (limited to 'subsonic-android/src/github')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java | 32 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 26 |
2 files changed, 27 insertions, 31 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java index df49086d..95452eb6 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java @@ -113,32 +113,10 @@ public class SelectArtistFragment extends SubsonicFragment implements AdapterVie }
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuItem.getMenuInfo();
-
Artist artist = (Artist) artistList.getItemAtPosition(info.position);
if (artist != null) {
- switch (menuItem.getItemId()) {
- case R.id.artist_menu_play_now:
- downloadRecursively(artist.getId(), false, false, true, false, false);
- break;
- case R.id.artist_menu_play_shuffled:
- downloadRecursively(artist.getId(), false, false, true, true, false);
- break;
- case R.id.artist_menu_play_last:
- downloadRecursively(artist.getId(), false, true, false, false, false);
- break;
- case R.id.artist_menu_download:
- downloadRecursively(artist.getId(), false, true, false, false, true);
- break;
- case R.id.artist_menu_pin:
- downloadRecursively(artist.getId(), true, true, false, false, true);
- break;
- case R.id.artist_menu_delete:
- deleteRecursively(artist);
- break;
- default:
- return super.onContextItemSelected(menuItem);
- }
+ return onContextItemSelected(menuItem, artist);
} else if (info.position == 0) {
MusicFolder selectedFolder = menuItem.getItemId() == -1 ? null : musicFolders.get(menuItem.getItemId());
String musicFolderId = selectedFolder == null ? null : selectedFolder.getId();
@@ -217,12 +195,4 @@ public class SelectArtistFragment extends SubsonicFragment implements AdapterVie private void selectFolder() {
folderButton.showContextMenu();
}
-
- public void deleteRecursively(Artist artist) {
- File dir = FileUtil.getArtistDirectory(context, artist);
- Util.recursiveDelete(dir);
- if(Util.isOffline(context)) {
- refresh();
- }
- }
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 09d0e5d5..1284a99a 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -171,6 +171,24 @@ public class SubsonicFragment extends SherlockFragment { songs.add(entry);
switch (menuItem.getItemId()) {
+ case R.id.artist_menu_play_now:
+ downloadRecursively(artist.getId(), false, false, true, false, false);
+ break;
+ case R.id.artist_menu_play_shuffled:
+ downloadRecursively(artist.getId(), false, false, true, true, false);
+ break;
+ case R.id.artist_menu_play_last:
+ downloadRecursively(artist.getId(), false, true, false, false, false);
+ break;
+ case R.id.artist_menu_download:
+ downloadRecursively(artist.getId(), false, true, false, false, true);
+ break;
+ case R.id.artist_menu_pin:
+ downloadRecursively(artist.getId(), true, true, false, false, true);
+ break;
+ case R.id.artist_menu_delete:
+ deleteRecursively(artist);
+ break;
case R.id.album_menu_play_now:
downloadRecursively(entry.getId(), false, false, true, false, false);
break;
@@ -688,6 +706,14 @@ public class SubsonicFragment extends SherlockFragment { return check.isCompleteFileAvailable();
}
+ public void deleteRecursively(Artist artist) {
+ File dir = FileUtil.getArtistDirectory(context, artist);
+ Util.recursiveDelete(dir);
+ if(Util.isOffline(context)) {
+ refresh();
+ }
+ }
+
public void deleteRecursively(MusicDirectory.Entry album) {
File dir = FileUtil.getAlbumDirectory(context, album);
Util.recursiveDelete(dir);
|