diff --git a/README.md b/README.md index 4ebd0ac..8297c8f 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Si vous connectez votre compte, vous pourrez interagir avec les vidéos : -#### TubeLab (coming soon) +#### TubeLab [Fdroid](https://f-droid.org/packages/app.fedilab.tubelab/) diff --git a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java index a67ee3d..a07f04e 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java @@ -31,7 +31,6 @@ import android.os.Bundle; import android.os.Handler; import android.support.v4.media.session.MediaSessionCompat; import android.text.Html; -import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; @@ -1034,11 +1033,9 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd } public void manageVIewPlaylists(APIResponse apiResponse) { - Log.v(Helper.TAG,"manageVIewPlaylists: " + apiResponse); if (apiResponse.getError() != null) { return; } - Log.v(Helper.TAG,"apiResponse.getPlaylists(): " + apiResponse.getPlaylists()); if (apiResponse.getPlaylists() != null && apiResponse.getPlaylists().size() > 0) { androidx.appcompat.app.AlertDialog.Builder builder = new androidx.appcompat.app.AlertDialog.Builder(PeertubeActivity.this); builder.setTitle(R.string.modify_playlists); diff --git a/app/src/main/java/app/fedilab/fedilabtube/client/RetrofitPeertubeAPI.java b/app/src/main/java/app/fedilab/fedilabtube/client/RetrofitPeertubeAPI.java index 9284679..fdadd52 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/client/RetrofitPeertubeAPI.java +++ b/app/src/main/java/app/fedilab/fedilabtube/client/RetrofitPeertubeAPI.java @@ -21,7 +21,6 @@ import android.content.SharedPreferences; import android.database.sqlite.SQLiteDatabase; import android.os.Handler; import android.os.Looper; -import android.util.Log; import java.io.File; import java.io.IOException; @@ -93,6 +92,8 @@ public class RetrofitPeertubeAPI { _context = context; instance = Helper.getLiveInstance(context); finalUrl = "https://" + Helper.getLiveInstance(context) + "/api/v1/"; + SharedPreferences sharedpreferences = _context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE); + count = String.valueOf(sharedpreferences.getInt(Helper.SET_VIDEOS_PER_PAGE, Helper.VIDEOS_PER_PAGE)); } public RetrofitPeertubeAPI(Context context, String instance, String token) { @@ -237,7 +238,7 @@ public class RetrofitPeertubeAPI { APIResponse apiResponse = new APIResponse(); PeertubeService peertubeService = init(); - Call notificationsCall = peertubeService.getNotifications("Bearer " + token, max_id, count, since_id); + Call notificationsCall = peertubeService.getNotifications("Bearer " + token, max_id, "20", since_id); try { Response response = notificationsCall.execute(); if (response.isSuccessful() && response.body() != null) { @@ -1113,8 +1114,6 @@ public class RetrofitPeertubeAPI { setError(apiResponse, response.code(), response.errorBody()); } } else if (type == PlaylistsVM.action.GET_LIST_VIDEOS) { - Log.v(Helper.TAG,"playlistId: " + playlistId); - Log.v(Helper.TAG,"max_id2: " + max_id); Call videosPlayList = peertubeService.getVideosPlayList(getToken(), playlistId, max_id, count); Response response = videosPlayList.execute(); if (response.isSuccessful() && response.body() != null) { diff --git a/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayNotificationsFragment.java b/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayNotificationsFragment.java index 25f570d..f25dae7 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayNotificationsFragment.java +++ b/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayNotificationsFragment.java @@ -38,6 +38,7 @@ import app.fedilab.fedilabtube.R; import app.fedilab.fedilabtube.client.APIResponse; import app.fedilab.fedilabtube.client.data.NotificationData.Notification; import app.fedilab.fedilabtube.drawer.PeertubeNotificationsListAdapter; +import app.fedilab.fedilabtube.helper.Helper; import app.fedilab.fedilabtube.viewmodel.NotificationsVM; import es.dmoral.toasty.Toasty; @@ -70,7 +71,7 @@ public class DisplayNotificationsFragment extends Fragment { context = getContext(); notifications = new ArrayList<>(); - max_id = null; + max_id = "0"; firstLoad = true; flag_loading = true; swiped = false; @@ -159,7 +160,7 @@ public class DisplayNotificationsFragment extends Fragment { public void pullToRefresh() { - max_id = null; + max_id = "0"; notifications = new ArrayList<>(); firstLoad = true; flag_loading = true; @@ -182,7 +183,7 @@ public class DisplayNotificationsFragment extends Fragment { } int previousPosition = notifications.size(); - max_id = apiResponse.getMax_id(); + max_id = String.valueOf(Integer.parseInt(max_id) + 20); List notifications = apiResponse.getPeertubeNotifications(); if (!swiped && firstLoad && (notifications == null || notifications.size() == 0)) textviewNoAction.setVisibility(View.VISIBLE); diff --git a/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayVideosFragment.java b/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayVideosFragment.java index d4294ec..3af9cc7 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayVideosFragment.java +++ b/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayVideosFragment.java @@ -19,7 +19,6 @@ import android.content.SharedPreferences; import android.graphics.Rect; import android.os.Bundle; import android.os.Handler; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -202,7 +201,6 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta if (firstVisibleItem + visibleItemCount == totalItemCount && context != null) { if (!flag_loading) { flag_loading = true; - Log.v(Helper.TAG,"max_id: " + max_id); loadTimeline(max_id); nextElementLoader.setVisibility(View.VISIBLE); }