From 9f254059839ef038e2e73c514bb52c8379c7ebed Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 26 Sep 2020 19:36:10 +0200 Subject: [PATCH] Some fixes --- .../main/java/app/fedilab/fedilabtube/PeertubeActivity.java | 2 +- .../java/app/fedilab/fedilabtube/ShowChannelActivity.java | 2 +- .../fedilab/fedilabtube/fragment/DisplayVideosFragment.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java index aac322c..7fa58ca 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java @@ -189,7 +189,7 @@ public class PeertubeActivity extends AppCompatActivity { String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null); String instance = Helper.getLiveInstance(PeertubeActivity.this); Account account = new AccountDAO(PeertubeActivity.this, db).getUniqAccount(userId, instance); - Helper.loadGiF(PeertubeActivity.this, account.getAvatar().getPath(), my_pp); + Helper.loadGiF(PeertubeActivity.this, account.getAvatar()!=null?account.getAvatar().getPath():null, my_pp); if (Helper.isTablet(PeertubeActivity.this)) { diff --git a/app/src/main/java/app/fedilab/fedilabtube/ShowChannelActivity.java b/app/src/main/java/app/fedilab/fedilabtube/ShowChannelActivity.java index 6da9c41..560530c 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/ShowChannelActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/ShowChannelActivity.java @@ -241,7 +241,7 @@ public class ShowChannelActivity extends AppCompatActivity { manageNotes(channel); - Helper.loadGiF(ShowChannelActivity.this, channel.getAvatar().getPath(), account_pp); + Helper.loadGiF(ShowChannelActivity.this, channel.getAvatar()!=null?channel.getAvatar().getPath():null, account_pp); //Follow button String target = channel.getAcct(); 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 4827541..2f4313e 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayVideosFragment.java +++ b/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayVideosFragment.java @@ -203,7 +203,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta if (!flag_loading) { flag_loading = true; if (search_peertube == null) { //Not a Peertube search - if( type != TimelineVM.TimelineType.USER_VIDEOS){ + if( type == TimelineVM.TimelineType.USER_VIDEOS){ viewModelFeeds.getVideosInChannel(channelId, max_id).observe(DisplayVideosFragment.this.requireActivity(), apiResponse -> manageVIewVideos(apiResponse)); }else { viewModelFeeds.getVideos(type, max_id).observe(DisplayVideosFragment.this.requireActivity(), apiResponse -> manageVIewVideos(apiResponse)); @@ -226,7 +226,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta if (!flag_loading) { flag_loading = true; if (search_peertube == null) { //Not a Peertube search - if( type != TimelineVM.TimelineType.USER_VIDEOS){ + if( type == TimelineVM.TimelineType.USER_VIDEOS){ viewModelFeeds.getVideosInChannel(channelId, max_id).observe(DisplayVideosFragment.this.requireActivity(), apiResponse -> manageVIewVideos(apiResponse)); }else { viewModelFeeds.getVideos(type, max_id).observe(DisplayVideosFragment.this.requireActivity(), apiResponse -> manageVIewVideos(apiResponse)); @@ -401,7 +401,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta } if (search_peertube == null) { //Not a Peertube search - if( type != TimelineVM.TimelineType.USER_VIDEOS){ + if( type == TimelineVM.TimelineType.USER_VIDEOS){ viewModelFeeds.getVideosInChannel(channelId, "0").observe(this.requireActivity(), this::manageVIewVideos); }else { viewModelFeeds.getVideos(type, "0").observe(this.requireActivity(), this::manageVIewVideos);