diff options
-rw-r--r-- | AndroidManifest.xml | 4 | ||||
-rw-r--r-- | res/layout/genre_list_item.xml | 42 | ||||
-rw-r--r-- | res/raw/changelog.xml | 14 | ||||
-rw-r--r-- | res/values-hu/strings.xml | 21 | ||||
-rw-r--r-- | res/values/strings.xml | 2 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java | 4 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/domain/Genre.java | 20 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/fragments/DownloadFragment.java | 8 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 3 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 10 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java | 4 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/service/parser/GenreParser.java | 2 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/util/Util.java | 4 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/view/GenreView.java | 30 |
14 files changed, 123 insertions, 45 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index bc7acd49..531f208c 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="github.daneren2005.dsub"
android:installLocation="internalOnly"
- android:versionCode="83"
- android:versionName="4.4.0 Beta2">
+ android:versionCode="84"
+ android:versionName="4.3.7">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
diff --git a/res/layout/genre_list_item.xml b/res/layout/genre_list_item.xml new file mode 100644 index 00000000..658d9cd6 --- /dev/null +++ b/res/layout/genre_list_item.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:background="@android:color/transparent">
+
+ <TextView
+ android:id="@+id/genre_name"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:gravity="left|center_vertical"
+ android:paddingLeft="6dip"
+ android:paddingRight="6dip"
+ android:minHeight="50dip"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:background="@android:color/transparent"/>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+ android:gravity="right|center_vertical"
+ android:paddingRight="10dip"
+ android:background="@android:color/transparent">
+
+ <TextView
+ android:id="@+id/genre_songs"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceSmall"/>
+
+ <TextView
+ android:id="@+id/genre_albums"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceSmall"/>
+ </LinearLayout>
+</LinearLayout>
\ No newline at end of file diff --git a/res/raw/changelog.xml b/res/raw/changelog.xml index cd03c47c..14f79de9 100644 --- a/res/raw/changelog.xml +++ b/res/raw/changelog.xml @@ -1,14 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <changelog> - <release version="4.4 Beta2" versioncode="83" releasedate="1/21/2014"> - <change>Fix Show All Media</change> - <change>Fix play/cache</change> - <change>Fix Show Artist/Album</change> - <change>Fix albums not showing as cached</change> - </release> - <release version="4.4.0 Beta1" versioncode="82" releasedate="1/19/2014"> - <change>Browse by ID3 Tags instead of folder structure (off by default)</change> - <change>Probably a good idea to clear existing cache since there will be many songs that don't match up</change> + <release version="4.3.7" versioncode="84" releasedate="1/22/2014"> + <change>Add stats to genres for 4.9Beta3+ Servers</change> + <change>Fix stuck Last.FM notification if you use it to scrobble</change> + <change>Fix shuffle play issue</change> + <change>Fix pressing next from bluetooth controls not looping back to start with repeat set to all</change> </release> <release version="4.3.6" versioncode="81" releasedate="1/19/2014"> <change>Added optional SSID to use for local network address (requires new permission: ACCESS_WIFI_STATE)</change> diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml index 1cf6075f..9ed55267 100644 --- a/res/values-hu/strings.xml +++ b/res/values-hu/strings.xml @@ -6,7 +6,7 @@ <string name="common.save">Mentés</string>
<string name="common.cancel">Mégse</string>
<string name="common.play_now">Lejátszás</string>
- <string name="common.play_shuffled">Véletlen sorrendű lejátszás</string>
+ <string name="common.play_shuffled">Lejátszás (Kevert sorrendben)</string>
<string name="common.play_next">Lejátszás (Következőként)</string>
<string name="common.play_last">Lejátszás (Utolsóként)</string>
<string name="common.download">Letöltés (Gyorsítótárba)</string>
@@ -44,7 +44,7 @@ \nFelhasznált tároló: %2$s/%3$s
\nFelhasználható tároló: %4$s/%5$s</string>
<string name="main.select_server">Kiszolgáló kiválasztása</string>
- <string name="main.shuffle">Véletlen sorrendű lejátszás</string>
+ <string name="main.shuffle">Lejátszás (Kevert sorrendben)</string>
<string name="main.offline">Offline mód</string>
<string name="main.online">Online mód</string>
<string name="main.settings">Beállítások</string>
@@ -61,7 +61,7 @@ <string name="main.back_confirm">Nyomja meg még egyszer a kilépéshez!</string>
<string name="menu.search">Keresés</string>
- <string name="menu.shuffle">Véletlen sorrendű</string>
+ <string name="menu.shuffle">Lejátszás (Kevert sorrendben)</string>
<string name="menu.refresh">Frissítés</string>
<string name="menu.select">Összes kijelölése</string>
<string name="menu.play">Lejátszás</string>
@@ -141,6 +141,8 @@ <string name="offline.sync_error">A dalok szinkronizálása sikertelen!</string>
<string name="select_genre.blank">Üres</string>
+ <string name="select_genre.songs">%d dal</string>
+ <string name="select_genre.albums">%d album</string>
<string name="select_podcasts.error">A podcast hibát jelzett a kiszolgálóra történő letöltés közben! A kiszolgálónak kell letöltenie először!</string>
<string name="select_podcasts.skipped">Ez a podcast nem lett letöltve a kiszolgálóra! A kiszolgálónak kell letöltenie először!</string>
@@ -156,10 +158,10 @@ <string name="select_podcasts.invalid_podcast_channel">Érvénytelen podcast csatorna: %s</string>
<string name="download.empty">A várólista üres!</string>
- <string name="download.shuffle_loading">Véletlen sorrendű lista betöltése...</string>
+ <string name="download.shuffle_loading">Kevert sorrendű lista betöltése...</string>
<string name="download.playerstate_downloading">Letöltés - %s</string>
<string name="download.playerstate_buffering">Pufferelés</string>
- <string name="download.playerstate_playing_shuffle">Véletlen sorrendű</string>
+ <string name="download.playerstate_playing_shuffle">Kevert sorrendű</string>
<string name="download.menu_show_album">Ugrás az albumhoz</string>
<string name="download.menu_lyrics">Dalszöveg</string>
<string name="download.menu_remove">Eltávolítás a várólistáról</string>
@@ -167,10 +169,10 @@ <string name="download.menu_remove_all">Összes eltávolítása</string>
<string name="download.menu_screen_on">Kijelző be</string>
<string name="download.menu_screen_off">Kijelző ki</string>
- <string name="download.menu_shuffle">Véletlen sorrendű</string>
+ <string name="download.menu_shuffle">Kevert sorrendű</string>
<string name="download.menu_toggle">Váltás</string>
<string name="download.menu_save">Mentés lejátszási listába</string>
- <string name="download.menu_shuffle_notification">Véletlen sorrendű lejátszás</string>
+ <string name="download.menu_shuffle_notification">Kevert sorrendű lejátszás</string>
<string name="download.playlist_title">Mentés lejátszási listába</string>
<string name="download.playlist_name">Lejátszási lista neve:</string>
<string name="download.playlist_saving">\"%s\" lejátszási lista mentése...</string>
@@ -244,6 +246,8 @@ <string name="settings.server_unused">Nem használt</string>
<string name="settings.server_name">Név</string>
<string name="settings.server_address">Kiszolgáló címe</string>
+ <string name="settings.server_local_network_ssid" >Helyi hálózati SSID</string>
+ <string name="settings.server_local_network_ssid_hint">Aktuális SSID: %s</string>
<string name="settings.server_internal_address">Belső hálózati cím</string>
<string name="settings.server_username">Felhasználónév</string>
<string name="settings.server_password">Jelszó</string>
@@ -393,7 +397,7 @@ <string name="settings.menu_options.star_summary">Csillagozás opció megjelenítése a menüben.</string>
<string name="settings.menu_options.shared_summary">Megosztás opció megjelenítése a menüben.</string>
- <string name="shuffle.title">Véletlen sorrend</string>
+ <string name="shuffle.title">Kevert sorrend</string>
<string name="shuffle.startYear">Kezdő év:</string>
<string name="shuffle.endYear">Befejező év:</string>
<string name="shuffle.genre">Műfaj:</string>
@@ -436,6 +440,7 @@ <string name="parser.not_authenticated">Hibás felhasználónév vagy jelszó!</string>
<string name="parser.not_authorized">Nincs engedélyezve! Ellenőrizze a felhasználó jogosultságait a Subsonic kiszolgálón!</string>
<string name="parser.artist_count">%d előadó található a médiakönyvtárban.</string>
+ <string name="parser.server_error">Kiszolgáló hiba: %s</string>
<string name="select_artist.refresh">Frissítés</string>
<string name="select_artist.folder">Mappa kiválasztása</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml index 5c2a4614..b52498ea 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -141,6 +141,8 @@ <string name="offline.sync_error">Failed to sync songs</string>
<string name="select_genre.blank">Blank</string>
+ <string name="select_genre.songs">%d songs</string>
+ <string name="select_genre.albums">%d albums</string>
<string name="select_podcasts.error">This podcast had an error while downloading on the server. The server must download it first.</string>
<string name="select_podcasts.skipped">This podcast has not been downloaded on the server. The server must download it first.</string>
diff --git a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index 423e1c23..9b1d307a 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -189,9 +189,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity { return null;
}
- if (getDownloadService().getCurrentPlayingIndex() < getDownloadService().size() - 1) {
- getDownloadService().next();
- }
+ getDownloadService().next();
return null;
}
diff --git a/src/github/daneren2005/dsub/domain/Genre.java b/src/github/daneren2005/dsub/domain/Genre.java index 25d226d7..4ca4c387 100644 --- a/src/github/daneren2005/dsub/domain/Genre.java +++ b/src/github/daneren2005/dsub/domain/Genre.java @@ -14,7 +14,9 @@ import github.daneren2005.dsub.util.Util; public class Genre implements Serializable {
private String name;
private String index;
-
+ private Integer albumCount;
+ private Integer songCount;
+
public String getName() {
return name;
}
@@ -36,6 +38,22 @@ public class Genre implements Serializable { return name;
}
+ public Integer getAlbumCount() {
+ return albumCount;
+ }
+
+ public void setAlbumCount(Integer albumCount) {
+ this.albumCount = albumCount;
+ }
+
+ public Integer getSongCount() {
+ return songCount;
+ }
+
+ public void setSongCount(Integer songCount) {
+ this.songCount = songCount;
+ }
+
public static class GenreComparator implements Comparator<Genre> {
@Override
public int compare(Genre genre1, Genre genre2) {
diff --git a/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/src/github/daneren2005/dsub/fragments/DownloadFragment.java index f345334f..ea8e8c3c 100644 --- a/src/github/daneren2005/dsub/fragments/DownloadFragment.java +++ b/src/github/daneren2005/dsub/fragments/DownloadFragment.java @@ -1281,11 +1281,9 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe // Right to Left swipe
if (e1.getX() - e2.getX() > swipeDistance && Math.abs(velocityX) > swipeVelocity) {
warnIfNetworkOrStorageUnavailable();
- if (downloadService.getCurrentPlayingIndex() < downloadService.size() - 1) {
- downloadService.next();
- onCurrentChanged();
- onProgressChanged();
- }
+ downloadService.next();
+ onCurrentChanged();
+ onProgressChanged();
return true;
}
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index f88de757..4776295e 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -506,6 +506,9 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter result = service.getStarredList(context, this);
} else if(("genres".equals(albumListType) && Util.checkServerVersion(context, "1.10.0")) || "years".equals(albumListType)) {
result = service.getAlbumList(albumListType, albumListExtra, size, 0, context, this);
+ if(result.getChildrenSize() == 0 && "genres".equals(albumListType)) {
+ result = service.getSongsByGenre(albumListExtra, size, 0, context, this);
+ }
} else if("genres".equals(albumListType)) {
result = service.getSongsByGenre(albumListExtra, size, 0, context, this);
} else {
diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index 600f2d52..e1ea56ef 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -414,6 +414,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { downloadList.remove(getCurrentPlayingIndex()); downloadList.add(0, currentPlaying); } + currentPlayingIndex = downloadList.indexOf(currentPlaying); revision++; lifecycleSupport.serializeDownloadQueue(); updateJukeboxPlaylist(); @@ -557,6 +558,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { @Override public synchronized void remove(int which) { downloadList.remove(which); + currentPlayingIndex = downloadList.indexOf(currentPlaying); } @Override @@ -570,6 +572,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { setCurrentPlaying(null, false); } downloadList.remove(downloadFile); + currentPlayingIndex = downloadList.indexOf(currentPlaying); backgroundDownloadList.remove(downloadFile); revision++; lifecycleSupport.serializeDownloadQueue(); @@ -811,9 +814,13 @@ public class DownloadServiceImpl extends Service implements DownloadService { } // Restart song if played more than five seconds. - if (getPlayerPosition() > 5000 || index == 0) { + if (getPlayerPosition() > 5000 || (index == 0 && getRepeatMode() != RepeatMode.ALL)) { play(index); } else { + if(index == 0) { + index = size(); + } + play(index - 1); } } @@ -1542,6 +1549,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { revision++; } } + currentPlayingIndex = downloadList.indexOf(currentPlaying); if (revisionBefore != revision) { updateJukeboxPlaylist(); diff --git a/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java b/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java index f0b7ceb1..021c214a 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java @@ -323,9 +323,7 @@ public class DownloadServiceLifecycleSupport { break; case RemoteControlClient.FLAG_KEY_MEDIA_NEXT: case KeyEvent.KEYCODE_MEDIA_NEXT: - if (downloadService.getCurrentPlayingIndex() < downloadService.size() - 1) { - downloadService.next(); - } + downloadService.next(); break; case RemoteControlClient.FLAG_KEY_MEDIA_STOP: case KeyEvent.KEYCODE_MEDIA_STOP: diff --git a/src/github/daneren2005/dsub/service/parser/GenreParser.java b/src/github/daneren2005/dsub/service/parser/GenreParser.java index f572b564..35913ba9 100644 --- a/src/github/daneren2005/dsub/service/parser/GenreParser.java +++ b/src/github/daneren2005/dsub/service/parser/GenreParser.java @@ -97,6 +97,8 @@ public class GenreParser extends AbstractParser { String name = getElementName();
if ("genre".equals(name)) {
genre = new Genre();
+ genre.setSongCount(getInteger("songCount"));
+ genre.setAlbumCount(getInteger("albumCount"));
} else if ("error".equals(name)) {
handleError();
} else {
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java index 5dd639c4..28a8c138 100644 --- a/src/github/daneren2005/dsub/util/Util.java +++ b/src/github/daneren2005/dsub/util/Util.java @@ -1255,11 +1255,13 @@ public final class Util { File albumArtFile = FileUtil.getAlbumArtFile(context, song); intent.putExtra("coverart", albumArtFile.getAbsolutePath()); + avrcpIntent.putExtra("playing", true); } else { intent.putExtra("title", ""); intent.putExtra("artist", ""); intent.putExtra("album", ""); intent.putExtra("coverart", ""); + avrcpIntent.putExtra("playing", false); } addTrackInfo(context, song, avrcpIntent); @@ -1305,7 +1307,6 @@ public final class Util { DownloadService downloadService = (DownloadServiceImpl)context; File albumArtFile = FileUtil.getAlbumArtFile(context, song); - intent.putExtra("playing", true); intent.putExtra("track", song.getTitle()); intent.putExtra("artist", song.getArtist()); intent.putExtra("album", song.getAlbum()); @@ -1315,7 +1316,6 @@ public final class Util { intent.putExtra("position", (long) downloadService.getPlayerPosition()); intent.putExtra("coverart", albumArtFile.getAbsolutePath()); } else { - intent.putExtra("playing", false); intent.putExtra("track", ""); intent.putExtra("artist", ""); intent.putExtra("album", ""); diff --git a/src/github/daneren2005/dsub/view/GenreView.java b/src/github/daneren2005/dsub/view/GenreView.java index 6a8e04ef..cbd5f081 100644 --- a/src/github/daneren2005/dsub/view/GenreView.java +++ b/src/github/daneren2005/dsub/view/GenreView.java @@ -21,8 +21,6 @@ package github.daneren2005.dsub.view; import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
-import android.widget.ImageButton;
-import android.widget.ImageView;
import android.widget.TextView;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.Genre;
@@ -31,20 +29,30 @@ public class GenreView extends UpdateView { private static final String TAG = GenreView.class.getSimpleName();
private TextView titleView;
+ private TextView songsView;
+ private TextView albumsView;
public GenreView(Context context) {
super(context);
- LayoutInflater.from(context).inflate(R.layout.basic_list_item, this, true);
-
- titleView = (TextView) findViewById(R.id.item_name);
- starButton = (ImageButton) findViewById(R.id.item_star);
- starButton.setFocusable(false);
- moreButton = (ImageView) findViewById(R.id.item_more);
- moreButton.setVisibility(View.GONE);
- moreButton.setClickable(false);
+ LayoutInflater.from(context).inflate(R.layout.genre_list_item, this, true);
+
+ titleView = (TextView) findViewById(R.id.genre_name);
+ songsView = (TextView) findViewById(R.id.genre_songs);
+ albumsView = (TextView) findViewById(R.id.genre_albums);
}
public void setObjectImpl(Object obj) {
- titleView.setText(((Genre)obj).getName());
+ Genre genre = (Genre) obj;
+ titleView.setText(genre.getName());
+
+ if(genre.getAlbumCount() != null) {
+ songsView.setVisibility(View.VISIBLE);
+ albumsView.setVisibility(View.VISIBLE);
+ songsView.setText(context.getResources().getString(R.string.select_genre_songs, genre.getSongCount()));
+ albumsView.setText(context.getResources().getString(R.string.select_genre_albums, genre.getAlbumCount()));
+ } else {
+ songsView.setVisibility(View.GONE);
+ albumsView.setVisibility(View.GONE);
+ }
}
}
|