From 0e89166dfc4647e23b2e8e833fa581a50c5b49b8 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 21 Jan 2014 15:01:32 -0800 Subject: #262 Fix playing status always being true even if paused --- src/github/daneren2005/dsub/util/Util.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java index e944f125..eecdcdeb 100644 --- a/src/github/daneren2005/dsub/util/Util.java +++ b/src/github/daneren2005/dsub/util/Util.java @@ -1247,11 +1247,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); @@ -1297,7 +1299,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()); @@ -1307,7 +1308,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", ""); -- cgit v1.2.3 From b270204acd661067f406e1afe8b3822fb7f45405 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 21 Jan 2014 15:42:39 -0800 Subject: Fix next with repeat all not working at end for some places --- .../daneren2005/dsub/activity/SubsonicFragmentActivity.java | 4 +--- src/github/daneren2005/dsub/fragments/DownloadFragment.java | 8 +++----- .../daneren2005/dsub/service/DownloadServiceLifecycleSupport.java | 4 +--- 3 files changed, 5 insertions(+), 11 deletions(-) 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/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/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: -- cgit v1.2.3 From a0ea69627b36abc28f5c75bf7c5651fbd2be7d98 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 21 Jan 2014 15:49:57 -0800 Subject: When pressing previous on first song with repeat == all, go back to end --- src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index 600f2d52..a50d2fe8 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -811,9 +811,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); } } -- cgit v1.2.3 From f1fd9a58e97ffb71807391ceac6fe66aa160f054 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 21 Jan 2014 16:44:38 -0800 Subject: #263 Add song/album totals to genre list --- res/layout/genre_list_item.xml | 42 ++++++++++++++++++++++ res/values/strings.xml | 2 ++ src/github/daneren2005/dsub/domain/Genre.java | 20 ++++++++++- .../dsub/service/parser/GenreParser.java | 2 ++ src/github/daneren2005/dsub/view/GenreView.java | 30 ++++++++++------ 5 files changed, 84 insertions(+), 12 deletions(-) create mode 100644 res/layout/genre_list_item.xml 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 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index b1fbb3c3..860d16ff 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -141,6 +141,8 @@ Failed to sync songs Blank + %d songs + %d albums This podcast had an error while downloading on the server. The server must download it first. This podcast has not been downloaded on the server. The server must download it first. 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 { @Override public int compare(Genre genre1, Genre genre2) { 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/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); + } } } -- cgit v1.2.3 From e851fcaabb00cf2570de3553fcda6003181d18e6 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 22 Jan 2014 21:24:52 -0800 Subject: Default to song list if album's in genre is 0 --- src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 93558a03..58cbf3fe 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -495,6 +495,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 { -- cgit v1.2.3 From 0d3eebaf1940c8fb6e604df6a1da33dcbb5b99e1 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 22 Jan 2014 21:43:08 -0800 Subject: Fix a few places where the index wasn't properly updated --- src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index a50d2fe8..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(); @@ -1546,6 +1549,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { revision++; } } + currentPlayingIndex = downloadList.indexOf(currentPlaying); if (revisionBefore != revision) { updateJukeboxPlaylist(); -- cgit v1.2.3 From 14d3b72202aaf9acd21bc2d09525b937893a2893 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 22 Jan 2014 21:45:19 -0800 Subject: Update hungarian translation --- res/values-hu/strings.xml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) 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 @@ Mentés Mégse Lejátszás - Véletlen sorrendű lejátszás + Lejátszás (Kevert sorrendben) Lejátszás (Következőként) Lejátszás (Utolsóként) Letöltés (Gyorsítótárba) @@ -44,7 +44,7 @@ \nFelhasznált tároló: %2$s/%3$s \nFelhasználható tároló: %4$s/%5$s Kiszolgáló kiválasztása - Véletlen sorrendű lejátszás + Lejátszás (Kevert sorrendben) Offline mód Online mód Beállítások @@ -61,7 +61,7 @@ Nyomja meg még egyszer a kilépéshez! Keresés - Véletlen sorrendű + Lejátszás (Kevert sorrendben) Frissítés Összes kijelölése Lejátszás @@ -141,6 +141,8 @@ A dalok szinkronizálása sikertelen! Üres + %d dal + %d album 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! Ez a podcast nem lett letöltve a kiszolgálóra! A kiszolgálónak kell letöltenie először! @@ -156,10 +158,10 @@ Érvénytelen podcast csatorna: %s A várólista üres! - Véletlen sorrendű lista betöltése... + Kevert sorrendű lista betöltése... Letöltés - %s Pufferelés - Véletlen sorrendű + Kevert sorrendű Ugrás az albumhoz Dalszöveg Eltávolítás a várólistáról @@ -167,10 +169,10 @@ Összes eltávolítása Kijelző be Kijelző ki - Véletlen sorrendű + Kevert sorrendű Váltás Mentés lejátszási listába - Véletlen sorrendű lejátszás + Kevert sorrendű lejátszás Mentés lejátszási listába Lejátszási lista neve: \"%s\" lejátszási lista mentése... @@ -244,6 +246,8 @@ Nem használt Név Kiszolgáló címe + Helyi hálózati SSID + Aktuális SSID: %s Belső hálózati cím Felhasználónév Jelszó @@ -393,7 +397,7 @@ Csillagozás opció megjelenítése a menüben. Megosztás opció megjelenítése a menüben. - Véletlen sorrend + Kevert sorrend Kezdő év: Befejező év: Műfaj: @@ -436,6 +440,7 @@ Hibás felhasználónév vagy jelszó! Nincs engedélyezve! Ellenőrizze a felhasználó jogosultságait a Subsonic kiszolgálón! %d előadó található a médiakönyvtárban. + Kiszolgáló hiba: %s Frissítés Mappa kiválasztása -- cgit v1.2.3 From 8823b311386d51e840781196b987ffc4af69e578 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 22 Jan 2014 21:49:29 -0800 Subject: Update 4.3.7 --- AndroidManifest.xml | 4 ++-- res/raw/changelog.xml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 2fc455ab..531f208c 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="84" + android:versionName="4.3.7"> diff --git a/res/raw/changelog.xml b/res/raw/changelog.xml index c07419af..14f79de9 100644 --- a/res/raw/changelog.xml +++ b/res/raw/changelog.xml @@ -1,5 +1,11 @@ + + Add stats to genres for 4.9Beta3+ Servers + Fix stuck Last.FM notification if you use it to scrobble + Fix shuffle play issue + Fix pressing next from bluetooth controls not looping back to start with repeat set to all + Added optional SSID to use for local network address (requires new permission: ACCESS_WIFI_STATE) Fix not being able to clear local network address -- cgit v1.2.3