mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-26 05:32:15 +03:00
Add Show Artist context menu item when using ID3 tags. Sort Genres to fix indexing.
This commit is contained in:
parent
de41e8c9b9
commit
a11c88d3af
@ -1,6 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:a="http://schemas.android.com/apk/res/android" >
|
<menu xmlns:a="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item
|
||||||
|
a:id="@+id/menu_show_artist"
|
||||||
|
a:title="@string/download.menu_show_artist"/>
|
||||||
<item
|
<item
|
||||||
a:id="@+id/menu_show_album"
|
a:id="@+id/menu_show_album"
|
||||||
a:title="@string/download.menu_show_album"/>
|
a:title="@string/download.menu_show_album"/>
|
||||||
|
@ -371,6 +371,7 @@
|
|||||||
<string name="select_album_all_songs">All Songs by %s</string>
|
<string name="select_album_all_songs">All Songs by %s</string>
|
||||||
<string name="settings.show_all_songs_by_artist">Show All Songs By Artist</string>
|
<string name="settings.show_all_songs_by_artist">Show All Songs By Artist</string>
|
||||||
<string name="settings.show_all_songs_by_artist_summary">Add new entry in artist view to access all songs for an artist</string>
|
<string name="settings.show_all_songs_by_artist_summary">Add new entry in artist view to access all songs for an artist</string>
|
||||||
|
<string name="download.menu_show_artist">Show Artist</string>
|
||||||
|
|
||||||
<plurals name="select_album_n_songs">
|
<plurals name="select_album_n_songs">
|
||||||
<item quantity="zero">Aucun titre</item>
|
<item quantity="zero">Aucun titre</item>
|
||||||
|
@ -371,6 +371,7 @@
|
|||||||
<string name="select_album_all_songs">All Songs by %s</string>
|
<string name="select_album_all_songs">All Songs by %s</string>
|
||||||
<string name="settings.show_all_songs_by_artist">Show All Songs By Artist</string>
|
<string name="settings.show_all_songs_by_artist">Show All Songs By Artist</string>
|
||||||
<string name="settings.show_all_songs_by_artist_summary">Add new entry in artist view to access all songs for an artist</string>
|
<string name="settings.show_all_songs_by_artist_summary">Add new entry in artist view to access all songs for an artist</string>
|
||||||
|
<string name="download.menu_show_artist">Show Artist</string>
|
||||||
|
|
||||||
<plurals name="select_album_n_songs">
|
<plurals name="select_album_n_songs">
|
||||||
<item quantity="zero">Nincsenek dalok</item>
|
<item quantity="zero">Nincsenek dalok</item>
|
||||||
|
@ -371,6 +371,7 @@
|
|||||||
<string name="select_album_all_songs">All Songs by %s</string>
|
<string name="select_album_all_songs">All Songs by %s</string>
|
||||||
<string name="settings.show_all_songs_by_artist">Show All Songs By Artist</string>
|
<string name="settings.show_all_songs_by_artist">Show All Songs By Artist</string>
|
||||||
<string name="settings.show_all_songs_by_artist_summary">Add new entry in artist view to access all songs for an artist</string>
|
<string name="settings.show_all_songs_by_artist_summary">Add new entry in artist view to access all songs for an artist</string>
|
||||||
|
<string name="download.menu_show_artist">Show Artist</string>
|
||||||
|
|
||||||
<plurals name="select_album_n_songs">
|
<plurals name="select_album_n_songs">
|
||||||
<item quantity="zero">No songs</item>
|
<item quantity="zero">No songs</item>
|
||||||
|
@ -808,6 +808,17 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi
|
|||||||
menuItem.setVisible(false);
|
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))
|
if (Util.isOffline(this))
|
||||||
{
|
{
|
||||||
MenuItem menuItem = menu.findItem(R.id.menu_lyrics);
|
MenuItem menuItem = menu.findItem(R.id.menu_lyrics);
|
||||||
@ -852,6 +863,23 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi
|
|||||||
|
|
||||||
switch (menuItemId)
|
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:
|
case R.id.menu_show_album:
|
||||||
if (entry == null)
|
if (entry == null)
|
||||||
{
|
{
|
||||||
|
@ -44,6 +44,8 @@ import com.thejoshwa.ultrasonic.androidapp.util.Util;
|
|||||||
|
|
||||||
import org.apache.http.HttpResponse;
|
import org.apache.http.HttpResponse;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@ -414,6 +416,15 @@ public class CachedMusicService implements MusicService
|
|||||||
cachedGenres.set(result);
|
cachedGenres.set(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Collections.sort(result, new Comparator<Genre>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public int compare(Genre genre, Genre genre2)
|
||||||
|
{
|
||||||
|
return genre.getName().compareToIgnoreCase(genre2.getName());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user