diff --git a/res/menu/nowplaying_context.xml b/res/menu/nowplaying_context.xml index 0d543bcc..51cea1ea 100644 --- a/res/menu/nowplaying_context.xml +++ b/res/menu/nowplaying_context.xml @@ -1,6 +1,9 @@ - + + diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 9787fec4..90b6d9be 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -371,6 +371,7 @@ All Songs by %s Show All Songs By Artist Add new entry in artist view to access all songs for an artist + Show Artist Aucun titre diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml index 3faa391c..c4e5191f 100644 --- a/res/values-hu/strings.xml +++ b/res/values-hu/strings.xml @@ -371,6 +371,7 @@ All Songs by %s Show All Songs By Artist Add new entry in artist view to access all songs for an artist + Show Artist Nincsenek dalok diff --git a/res/values/strings.xml b/res/values/strings.xml index ac5ea571..56ee3913 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -371,6 +371,7 @@ All Songs by %s Show All Songs By Artist Add new entry in artist view to access all songs for an artist + Show Artist No songs diff --git a/src/com/thejoshwa/ultrasonic/androidapp/activity/DownloadActivity.java b/src/com/thejoshwa/ultrasonic/androidapp/activity/DownloadActivity.java index 7da385f8..c4b87180 100644 --- a/src/com/thejoshwa/ultrasonic/androidapp/activity/DownloadActivity.java +++ b/src/com/thejoshwa/ultrasonic/androidapp/activity/DownloadActivity.java @@ -808,6 +808,17 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi menuItem.setVisible(false); } } + + if (Util.isOffline(this) || !Util.getShouldUseId3Tags(this)) + { + MenuItem menuItem = menu.findItem(R.id.menu_show_artist); + + if (menuItem != null) + { + menuItem.setVisible(false); + } + } + if (Util.isOffline(this)) { MenuItem menuItem = menu.findItem(R.id.menu_lyrics); @@ -852,6 +863,23 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi switch (menuItemId) { + case R.id.menu_show_artist: + if (entry == null) + { + return false; + } + + if (Util.getShouldUseId3Tags(DownloadActivity.this)) + { + Intent intent = new Intent(DownloadActivity.this, SelectAlbumActivity.class); + intent.putExtra(Constants.INTENT_EXTRA_NAME_ID, entry.getArtistId()); + intent.putExtra(Constants.INTENT_EXTRA_NAME_NAME, entry.getArtist()); + intent.putExtra(Constants.INTENT_EXTRA_NAME_PARENT_ID, entry.getArtistId()); + intent.putExtra(Constants.INTENT_EXTRA_NAME_ARTIST, true); + Util.startActivityWithoutTransition(DownloadActivity.this, intent); + } + + return true; case R.id.menu_show_album: if (entry == null) { diff --git a/src/com/thejoshwa/ultrasonic/androidapp/service/CachedMusicService.java b/src/com/thejoshwa/ultrasonic/androidapp/service/CachedMusicService.java index 6e7788a1..f7884562 100644 --- a/src/com/thejoshwa/ultrasonic/androidapp/service/CachedMusicService.java +++ b/src/com/thejoshwa/ultrasonic/androidapp/service/CachedMusicService.java @@ -44,6 +44,8 @@ import com.thejoshwa.ultrasonic.androidapp.util.Util; import org.apache.http.HttpResponse; +import java.util.Collections; +import java.util.Comparator; import java.util.List; import java.util.concurrent.TimeUnit; @@ -414,6 +416,15 @@ public class CachedMusicService implements MusicService cachedGenres.set(result); } + Collections.sort(result, new Comparator() + { + @Override + public int compare(Genre genre, Genre genre2) + { + return genre.getName().compareToIgnoreCase(genre2.getName()); + } + }); + return result; }