diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/LibraryActivity.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/LibraryActivity.kt index d83d0eefc..9ba17219e 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/LibraryActivity.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/LibraryActivity.kt @@ -197,16 +197,16 @@ class LibraryActivity : BaseActivity(), pager.currentItem = savedInstanceState.getInt(PAGER_POSITION, 0) } - override fun refreshFailed() { - Snackbar.make(pager, R.string.refresh_failed, Snackbar.LENGTH_SHORT).show() + override fun syncFailure() { + Snackbar.make(pager, R.string.library__sync_failed, Snackbar.LENGTH_LONG).show() } - override fun showRefreshing() { + override fun showSyncProgress() { findViewById(R.id.sync_progress).isGone = false findViewById(R.id.sync_progress_text).isGone = false } - override fun hideRefreshing() { + override fun hideSyncProgress() { findViewById(R.id.sync_progress).isGone = true findViewById(R.id.sync_progress_text).isGone = true } diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/LibraryContract.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/LibraryContract.kt index 78c38aee7..24ffcce36 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/LibraryContract.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/LibraryContract.kt @@ -4,9 +4,9 @@ import com.kelsos.mbrc.mvp.BaseView import com.kelsos.mbrc.mvp.Presenter interface LibraryView : BaseView { - fun refreshFailed() - fun showRefreshing() - fun hideRefreshing() + fun syncFailure() + fun showSyncProgress() + fun hideSyncProgress() fun updateArtistOnlyPreference(albumArtistOnly: Boolean?) fun syncComplete(stats: LibraryStats) } diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/LibraryPresenterImpl.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/LibraryPresenterImpl.kt index 335623518..3a9119aaa 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/LibraryPresenterImpl.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/LibraryPresenterImpl.kt @@ -20,7 +20,7 @@ constructor( LibrarySyncInteractor.OnStartListener { override fun refresh() { - view?.showRefreshing() + view?.showSyncProgress() scope.launch { librarySyncInteractor.sync() } @@ -31,7 +31,7 @@ constructor( librarySyncInteractor.setOnCompleteListener(this) librarySyncInteractor.setOnStartListener(this) if (!librarySyncInteractor.isRunning()) { - view.hideRefreshing() + view.hideSyncProgress() } } @@ -43,13 +43,13 @@ constructor( override fun onTermination() { scope.launch { - view?.hideRefreshing() + view?.hideSyncProgress() } } override fun onFailure(throwable: Throwable) { scope.launch { - view?.refreshFailed() + view?.syncFailure() } } @@ -75,7 +75,7 @@ constructor( override fun onStart() { scope.launch { - view?.showRefreshing() + view?.showSyncProgress() } } } diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/albums/BrowseAlbumContract.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/albums/BrowseAlbumContract.kt index 164015048..f4a93c0b3 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/albums/BrowseAlbumContract.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/albums/BrowseAlbumContract.kt @@ -8,7 +8,6 @@ import com.raizlabs.android.dbflow.list.FlowCursorList interface BrowseAlbumView : BaseView { fun update(cursor: FlowCursorList) - fun failure(throwable: Throwable) fun search(term: String) fun queue(success: Boolean, tracks: Int) } diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/albums/BrowseAlbumFragment.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/albums/BrowseAlbumFragment.kt index fe9648611..c4033428e 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/albums/BrowseAlbumFragment.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/albums/BrowseAlbumFragment.kt @@ -120,10 +120,6 @@ class BrowseAlbumFragment : Fragment(), adapter.update(cursor) } - override fun failure(throwable: Throwable) { - Snackbar.make(recycler, R.string.refresh_failed, Snackbar.LENGTH_SHORT).show() - } - override fun queue(success: Boolean, tracks: Int) { val message = if (success) { getString(R.string.queue_result__success, tracks) diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/artists/BrowseArtistContract.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/artists/BrowseArtistContract.kt index bb0df058f..9ca9200f0 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/artists/BrowseArtistContract.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/artists/BrowseArtistContract.kt @@ -7,7 +7,6 @@ import com.raizlabs.android.dbflow.list.FlowCursorList interface BrowseArtistView : BaseView { fun update(data: FlowCursorList) - fun failure(throwable: Throwable) fun search(term: String) fun queue(success: Boolean, tracks: Int) } diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/artists/BrowseArtistFragment.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/artists/BrowseArtistFragment.kt index 38f06a237..0e4905353 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/artists/BrowseArtistFragment.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/artists/BrowseArtistFragment.kt @@ -120,8 +120,4 @@ class BrowseArtistFragment : Fragment(), override fun update(data: FlowCursorList) { adapter.update(data) } - - override fun failure(throwable: Throwable) { - Snackbar.make(recycler, R.string.refresh_failed, Snackbar.LENGTH_SHORT).show() - } } diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/gernes/BrowseGenreContract.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/gernes/BrowseGenreContract.kt index b0da1015f..2d14225d8 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/gernes/BrowseGenreContract.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/gernes/BrowseGenreContract.kt @@ -14,7 +14,6 @@ interface BrowseGenrePresenter : Presenter { interface BrowseGenreView : BaseView { fun update(cursor: FlowCursorList) - fun failure(it: Throwable) fun search(term: String) fun queue(success: Boolean, tracks: Int) } diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/gernes/BrowseGenreFragment.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/gernes/BrowseGenreFragment.kt index f4f2ac16d..9f3f714d1 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/gernes/BrowseGenreFragment.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/gernes/BrowseGenreFragment.kt @@ -124,10 +124,6 @@ class BrowseGenreFragment : Fragment(), actionHandler.genreSelected(genre, requireActivity()) } - override fun failure(it: Throwable) { - Snackbar.make(recycler, R.string.refresh_failed, Snackbar.LENGTH_SHORT).show() - } - override fun onDestroy() { Toothpick.closeScope(this) super.onDestroy() diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/gernes/BrowseGenrePresenterImpl.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/gernes/BrowseGenrePresenterImpl.kt index c351681aa..52456af6e 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/gernes/BrowseGenrePresenterImpl.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/gernes/BrowseGenrePresenterImpl.kt @@ -49,7 +49,6 @@ constructor( view?.update(getData(term)) } catch (e: Exception) { Timber.v(e, "Error while loading the data from the database") - view?.failure(e) } } } diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/tracks/BrowseTrackContract.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/tracks/BrowseTrackContract.kt index 610346860..1ec6a500c 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/tracks/BrowseTrackContract.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/tracks/BrowseTrackContract.kt @@ -8,7 +8,6 @@ import com.raizlabs.android.dbflow.list.FlowCursorList interface BrowseTrackView : BaseView { fun update(it: FlowCursorList) - fun failure(it: Throwable) fun search(term: String) fun queue(success: Boolean, tracks: Int) } diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/tracks/BrowseTrackFragment.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/tracks/BrowseTrackFragment.kt index 1dc00b2df..dda0a8338 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/tracks/BrowseTrackFragment.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/tracks/BrowseTrackFragment.kt @@ -118,8 +118,4 @@ class BrowseTrackFragment : Fragment(), override fun onItemClicked(track: Track) { presenter.queue(track) } - - override fun failure(it: Throwable) { - Snackbar.make(recycler, R.string.refresh_failed, Snackbar.LENGTH_SHORT).show() - } } diff --git a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/tracks/BrowseTrackPresenterImpl.kt b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/tracks/BrowseTrackPresenterImpl.kt index 146553e7a..38886422d 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/tracks/BrowseTrackPresenterImpl.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/ui/navigation/library/tracks/BrowseTrackPresenterImpl.kt @@ -49,7 +49,6 @@ constructor( view?.update(getData(term)) } catch (e: Exception) { Timber.v(e, "Error while loading the data from the database") - view?.failure(e) } } } diff --git a/app/src/main/res/raw/changelog.xml b/app/src/main/res/raw/changelog.xml index dc4be39fd..3527f41d9 100644 --- a/app/src/main/res/raw/changelog.xml +++ b/app/src/main/res/raw/changelog.xml @@ -3,6 +3,7 @@ + Improves visual feedback when performing a library metadata sync. Adds a feedback message when queueing tracks/albums/genres/artists. Adds the ability to queue the album or artist when browsing the track list. Fixes a bug that would prevent users from queueing albums when browsing an artist's albums. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f59388d42..9ac29aca8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -136,7 +136,7 @@ Albums Tracks Sorry could not find any results for your search! - Refresh failed + The library metadata sync was incomplete or failed completely. This might result in queueing not working properly.. Connect Button %1$02d:%2$02d Previous @@ -194,4 +194,5 @@ Play Now (Artist) Play Now (Album) "Sync completed successfully. %1$d genres(s), %2$d artist(s) %3$d album(s), %4$d tracks and %5$d playlist(s) are available." + Refresh was unsuccessful.