Use intent for album header name

This commit is contained in:
Joshua Bahnsen 2014-01-27 00:19:16 -07:00
parent 6362b5d266
commit 011174b601
2 changed files with 3 additions and 16 deletions

View File

@ -1073,8 +1073,6 @@ public class SelectAlbumActivity extends SubsonicTabActivity
Collections.sort(entries, new EntryByDiscAndTrackComparator());
}
String directoryName = musicDirectory.getName();
boolean allVideos = true;
int songCount = 0;
@ -1097,7 +1095,9 @@ public class SelectAlbumActivity extends SubsonicTabActivity
{
if (showHeader)
{
View header = createHeader(entries, directoryName, songCount);
String intentAlbumName = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_NAME);
String directoryName = musicDirectory.getName();
View header = createHeader(entries, intentAlbumName != null ? intentAlbumName : directoryName, songCount);
if (header != null)
{
@ -1199,7 +1199,6 @@ public class SelectAlbumActivity extends SubsonicTabActivity
AlbumHeader albumHeader = AlbumHeader.processEntries(SelectAlbumActivity.this, entries);
TextView titleView = (TextView) header.findViewById(R.id.select_album_title);
name = albumHeader.getAlbumNames().size() == 1 ? albumHeader.getAlbumNames().iterator().next() : name;
titleView.setText(name != null ? name : getActionBarSubtitle());
// Don't show a header if all entries are videos

View File

@ -14,7 +14,6 @@ public class AlbumHeader
private Set<String> artists;
private Set<String> grandParents;
private Set<String> genres;
private Set<String> albumNames;
private Set<Integer> years;
public boolean getIsAllVideo()
@ -42,11 +41,6 @@ public class AlbumHeader
return this.genres;
}
public Set<String> getAlbumNames()
{
return this.albumNames;
}
public Set<Integer> getYears()
{
return this.years;
@ -57,7 +51,6 @@ public class AlbumHeader
this.artists = new HashSet<String>();
this.grandParents = new HashSet<String>();
this.genres = new HashSet<String>();
this.albumNames = new HashSet<String>();
this.years = new HashSet<Integer>();
this.isAllVideo = true;
@ -99,11 +92,6 @@ public class AlbumHeader
albumHeader.genres.add(entry.getGenre());
}
if (entry.getAlbum() != null)
{
albumHeader.albumNames.add(entry.getAlbum());
}
if (entry.getYear() != null)
{
albumHeader.years.add(entry.getYear());