aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--subsonic-android/res/menu/select_album_context_offline.xml4
-rw-r--r--subsonic-android/res/menu/select_song_context_offline.xml4
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java2
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java5
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/view/AlbumView.java4
5 files changed, 15 insertions, 4 deletions
diff --git a/subsonic-android/res/menu/select_album_context_offline.xml b/subsonic-android/res/menu/select_album_context_offline.xml
index af9272c2..70cf9da9 100644
--- a/subsonic-android/res/menu/select_album_context_offline.xml
+++ b/subsonic-android/res/menu/select_album_context_offline.xml
@@ -18,4 +18,8 @@
<item
android:id="@+id/album_menu_delete"
android:title="@string/common.delete"/>
+
+ <item
+ android:id="@+id/album_menu_star"
+ android:title="@string/common.star"/>
</menu> \ No newline at end of file
diff --git a/subsonic-android/res/menu/select_song_context_offline.xml b/subsonic-android/res/menu/select_song_context_offline.xml
index 8813d4a8..d19eaa70 100644
--- a/subsonic-android/res/menu/select_song_context_offline.xml
+++ b/subsonic-android/res/menu/select_song_context_offline.xml
@@ -24,4 +24,8 @@
<item
android:id="@+id/song_menu_delete"
android:title="@string/common.delete"/>
+
+ <item
+ android:id="@+id/song_menu_star"
+ android:title="@string/common.star"/>
</menu>
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
index 100fcbc6..8eb9e926 100644
--- a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
+++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
@@ -167,7 +167,7 @@ public class SubsonicFragment extends SherlockFragment {
}
}
- if (!Util.isOffline(context) && !entry.isVideo()) {
+ if (!entry.isVideo()) {
menu.findItem(entry.isDirectory() ? R.id.album_menu_star : R.id.song_menu_star).setTitle(entry.isStarred() ? R.string.common_unstar : R.string.common_star);
}
} else if(selected instanceof Artist) {
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java
index e5e41d00..ac564f29 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java
@@ -939,11 +939,14 @@ public class RESTMusicService implements MusicService {
} else {
String search = offline.getString(Constants.OFFLINE_STAR_SEARCH + i, "");
try{
- SearchCritera critera = new SearchCritera(search, 0, 0, 1);
+ SearchCritera critera = new SearchCritera(search, 0, 1, 1);
SearchResult result = searchNew(critera, context, progressListener);
if(result.getSongs().size() == 1){
Log.i(TAG, "Query '" + search + "' returned song " + result.getSongs().get(0).getTitle() + " by " + result.getSongs().get(0).getArtist() + " with id " + result.getSongs().get(0).getId());
setStarred(result.getSongs().get(0).getId(), starred, context, progressListener);
+ } else if(result.getAlbums().size() == 1){
+ Log.i(TAG, "Query '" + search + "' returned song " + result.getAlbums().get(0).getTitle() + " by " + result.getAlbums().get(0).getArtist() + " with id " + result.getAlbums().get(0).getId());
+ setStarred(result.getAlbums().get(0).getId(), starred, context, progressListener);
}
else{
throw new Exception("Song not found on server");
diff --git a/subsonic-android/src/github/daneren2005/dsub/view/AlbumView.java b/subsonic-android/src/github/daneren2005/dsub/view/AlbumView.java
index ff6eb71b..3a7b895e 100644
--- a/subsonic-android/src/github/daneren2005/dsub/view/AlbumView.java
+++ b/subsonic-android/src/github/daneren2005/dsub/view/AlbumView.java
@@ -74,7 +74,7 @@ public class AlbumView extends UpdateView {
artistView.setVisibility(album.getArtist() == null ? View.GONE : View.VISIBLE);
imageLoader.loadImage(coverArtView, album, false, true);
- starButton.setVisibility((Util.isOffline(getContext()) || !album.isStarred()) ? View.GONE : View.VISIBLE);
+ starButton.setVisibility(!album.isStarred() ? View.GONE : View.VISIBLE);
starButton.setFocusable(false);
update();
@@ -82,7 +82,7 @@ public class AlbumView extends UpdateView {
@Override
protected void update() {
- starButton.setVisibility((Util.isOffline(getContext()) || !album.isStarred()) ? View.GONE : View.VISIBLE);
+ starButton.setVisibility(!album.isStarred() ? View.GONE : View.VISIBLE);
File file = FileUtil.getAlbumDirectory(context, album);
if(file.exists()) {
moreButton.setImageResource(R.drawable.list_item_more_shaded);