Twelve: RequestStatus: type -> error

Change-Id: Ie104ee9fca6dd52a221bc2a004f82fec180a3cad
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/AddOrRemoveFromPlaylistsFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/AddOrRemoveFromPlaylistsFragment.kt
index c6ecf87..d62ba69 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/AddOrRemoveFromPlaylistsFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/AddOrRemoveFromPlaylistsFragment.kt
@@ -161,7 +161,7 @@
                 }
 
                 is RequestStatus.Error -> {
-                    Log.e(LOG_TAG, "Failed to load data, error: ${it.type}")
+                    Log.e(LOG_TAG, "Failed to load data, error: ${it.error}")
 
                     adapter.submitList(emptyList())
 
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/AlbumFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/AlbumFragment.kt
index b6880a9..8bf86a5 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/AlbumFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/AlbumFragment.kt
@@ -313,12 +313,12 @@
                         }
 
                         is RequestStatus.Error -> {
-                            Log.e(LOG_TAG, "Error loading album, error: ${it.type}")
+                            Log.e(LOG_TAG, "Error loading album, error: ${it.error}")
 
                             toolbar.title = ""
                             albumTitleTextView.text = ""
 
-                            if (it.type == RequestStatus.Error.Type.NOT_FOUND) {
+                            if (it.error == RequestStatus.Error.Type.NOT_FOUND) {
                                 // Get out of here
                                 findNavController().navigateUp()
                             }
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/AlbumsFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/AlbumsFragment.kt
index 5cfa535..4a4e69c 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/AlbumsFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/AlbumsFragment.kt
@@ -112,7 +112,7 @@
                 }
 
                 is RequestStatus.Error -> {
-                    Log.e(LOG_TAG, "Failed to load albums, error: ${it.type}")
+                    Log.e(LOG_TAG, "Failed to load albums, error: ${it.error}")
 
                     adapter.submitList(emptyList())
 
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/ArtistFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/ArtistFragment.kt
index f1442f0..14779e6 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/ArtistFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/ArtistFragment.kt
@@ -246,7 +246,7 @@
                 }
 
                 is RequestStatus.Error -> {
-                    Log.e(LOG_TAG, "Error loading artist, error: ${it.type}")
+                    Log.e(LOG_TAG, "Error loading artist, error: ${it.error}")
 
                     toolbar.title = ""
 
@@ -257,7 +257,7 @@
                     nestedScrollView.isVisible = false
                     noElementsNestedScrollView.isVisible = true
 
-                    if (it.type == RequestStatus.Error.Type.NOT_FOUND) {
+                    if (it.error == RequestStatus.Error.Type.NOT_FOUND) {
                         // Get out of here
                         findNavController().navigateUp()
                     }
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/ArtistsFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/ArtistsFragment.kt
index 8c505de..8bef4dd 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/ArtistsFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/ArtistsFragment.kt
@@ -111,7 +111,7 @@
                 }
 
                 is RequestStatus.Error -> {
-                    Log.e(LOG_TAG, "Failed to load artists, error: ${it.type}")
+                    Log.e(LOG_TAG, "Failed to load artists, error: ${it.error}")
 
                     adapter.submitList(emptyList())
 
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/AudioBottomSheetDialogFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/AudioBottomSheetDialogFragment.kt
index f2fed77..31fa7b2 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/AudioBottomSheetDialogFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/AudioBottomSheetDialogFragment.kt
@@ -139,9 +139,9 @@
                 }
 
                 is RequestStatus.Error -> {
-                    Log.e(LOG_TAG, "Failed to load audio, error: ${it.type}")
+                    Log.e(LOG_TAG, "Failed to load audio, error: ${it.error}")
 
-                    if (it.type == RequestStatus.Error.Type.NOT_FOUND) {
+                    if (it.error == RequestStatus.Error.Type.NOT_FOUND) {
                         // Get out of here
                         findNavController().navigateUp()
                     }
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/GenresFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/GenresFragment.kt
index 8261d55..85b266f 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/GenresFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/GenresFragment.kt
@@ -109,7 +109,7 @@
                 }
 
                 is RequestStatus.Error -> {
-                    Log.e(LOG_TAG, "Failed to load genres, error: ${it.type}")
+                    Log.e(LOG_TAG, "Failed to load genres, error: ${it.error}")
 
                     adapter.submitList(emptyList())
 
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/ManageProviderFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/ManageProviderFragment.kt
index 1b59fef..daa3ca8 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/ManageProviderFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/ManageProviderFragment.kt
@@ -247,7 +247,7 @@
                             is RequestStatus.Error -> {
                                 Log.e(LOG_TAG, "Failed to load provider")
 
-                                if (it.type == RequestStatus.Error.Type.NOT_FOUND) {
+                                if (it.error == RequestStatus.Error.Type.NOT_FOUND) {
                                     // Get out of here
                                     findNavController().navigateUp()
                                 }
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/PlaylistFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/PlaylistFragment.kt
index 28ff7db..6cd20bc 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/PlaylistFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/PlaylistFragment.kt
@@ -266,7 +266,7 @@
                 }
 
                 is RequestStatus.Error -> {
-                    Log.e(LOG_TAG, "Error loading playlist, error: ${it.type}")
+                    Log.e(LOG_TAG, "Error loading playlist, error: ${it.error}")
 
                     toolbar.title = ""
                     playlistNameTextView.text = ""
@@ -277,7 +277,7 @@
                     noElementsNestedScrollView.isVisible = true
                     playAllFloatingActionButton.isVisible = false
 
-                    if (it.type == RequestStatus.Error.Type.NOT_FOUND) {
+                    if (it.error == RequestStatus.Error.Type.NOT_FOUND) {
                         // Get out of here
                         findNavController().navigateUp()
                     }
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/PlaylistsFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/PlaylistsFragment.kt
index 1e5e644..957a915 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/PlaylistsFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/PlaylistsFragment.kt
@@ -139,7 +139,7 @@
                 }
 
                 is RequestStatus.Error -> {
-                    Log.e(LOG_TAG, "Failed to load playlists, error: ${it.type}")
+                    Log.e(LOG_TAG, "Failed to load playlists, error: ${it.error}")
 
                     adapter.submitList(emptyList())
 
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/SearchFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/SearchFragment.kt
index 6663985..cbfc28b 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/SearchFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/SearchFragment.kt
@@ -184,7 +184,7 @@
                 }
 
                 is RequestStatus.Error -> {
-                    Log.e(LOG_TAG, "Failed to load search results, error: ${it.type}")
+                    Log.e(LOG_TAG, "Failed to load search results, error: ${it.error}")
 
                     adapter.submitList(listOf())
 
diff --git a/app/src/main/java/org/lineageos/twelve/models/RequestStatus.kt b/app/src/main/java/org/lineageos/twelve/models/RequestStatus.kt
index 0373dc2..560bfa1 100644
--- a/app/src/main/java/org/lineageos/twelve/models/RequestStatus.kt
+++ b/app/src/main/java/org/lineageos/twelve/models/RequestStatus.kt
@@ -28,9 +28,9 @@
     /**
      * The request failed.
      *
-     * @param type The error type
+     * @param error The error
      */
-    class Error<T>(val type: Type) : RequestStatus<T>() {
+    class Error<T>(val error: Type) : RequestStatus<T>() {
         enum class Type {
             /**
              * This feature isn't implemented.
diff --git a/app/src/main/java/org/lineageos/twelve/services/MediaRepositoryTree.kt b/app/src/main/java/org/lineageos/twelve/services/MediaRepositoryTree.kt
index d1bc190..f9fc5f9 100644
--- a/app/src/main/java/org/lineageos/twelve/services/MediaRepositoryTree.kt
+++ b/app/src/main/java/org/lineageos/twelve/services/MediaRepositoryTree.kt
@@ -272,7 +272,7 @@
                 }
 
                 is RequestStatus.Error -> throw Exception(
-                    "Error while loading data, ${it.type}"
+                    "Error while loading data, ${it.error}"
                 )
             }
         }.first()