diff --git a/app/build.gradle b/app/build.gradle
index 371a92a..ae2a4fc 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -116,7 +116,7 @@ dependencies {
implementation "net.gotev:uploadservice-okhttp:3.5.2"
implementation "com.google.code.gson:gson:2.8.6"
implementation 'androidx.media:media:1.2.0'
-
+ implementation 'com.github.ybq:Android-SpinKit:1.4.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
diff --git a/app/src/acad/res/values/strings.xml b/app/src/acad/res/values/strings.xml
index 0a7efae..e477011 100644
--- a/app/src/acad/res/values/strings.xml
+++ b/app/src/acad/res/values/strings.xml
@@ -199,7 +199,7 @@
Cache
- Set the cache for videos (default 100Mb)
+ Définir le cache pour les vidéos (défaut 100Mo)
Cache pour les vidéos: %d Mo
set_video_mode_choice
set_video_minimize_choice
diff --git a/app/src/acad/res/values/styles.xml b/app/src/acad/res/values/styles.xml
index aceb64c..7e44535 100644
--- a/app/src/acad/res/values/styles.xml
+++ b/app/src/acad/res/values/styles.xml
@@ -15,4 +15,7 @@
- @color/colorPrimaryDark
- @color/colorAccent
+
+
+
\ No newline at end of file
diff --git a/app/src/fdroid_acad/play/release-notes/en-US/default.txt b/app/src/fdroid_acad/play/release-notes/en-US/default.txt
index 029184f..753aa65 100644
--- a/app/src/fdroid_acad/play/release-notes/en-US/default.txt
+++ b/app/src/fdroid_acad/play/release-notes/en-US/default.txt
@@ -1,4 +1,4 @@
- Force le mode paysage lors du passage en mode plein écran
- Modifier la valeur du cache pour les vidéos
-- Définir la résolution pour les vidéos
+- Définir la résolution par défaut pour les vidéos
- Correction de bugs
\ No newline at end of file
diff --git a/app/src/full/res/values-ar/strings.xml b/app/src/full/res/values-ar/strings.xml
index cdea048..48b7fb0 100644
--- a/app/src/full/res/values-ar/strings.xml
+++ b/app/src/full/res/values-ar/strings.xml
@@ -1,6 +1,7 @@
Home
+ Local
Discover
Notifications
Recently added
@@ -103,8 +104,13 @@
Pick another instance
History
Edit
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Captions
Pick captions
None
diff --git a/app/src/full/res/values-de/strings.xml b/app/src/full/res/values-de/strings.xml
index 72e9c9b..b192f03 100644
--- a/app/src/full/res/values-de/strings.xml
+++ b/app/src/full/res/values-de/strings.xml
@@ -1,6 +1,7 @@
Startseite
+ Local
Mehr erfahren
Benachrichtigungen
Zuletzt hinzugefügt
@@ -103,8 +104,13 @@
Wähle eine andere Instanz
Verlauf
Bearbeiten
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Untertitel
Untertitel abholen
Keine
diff --git a/app/src/full/res/values-el/strings.xml b/app/src/full/res/values-el/strings.xml
index 7487cb1..1234bf2 100644
--- a/app/src/full/res/values-el/strings.xml
+++ b/app/src/full/res/values-el/strings.xml
@@ -1,6 +1,7 @@
Αρχική
+ Local
Ανακαλύψτε
Ειδοποιήσεις
Προστέθηκαν πρόσφατα
@@ -103,8 +104,13 @@
Επιλογή άλλης υπόστασης
Ιστορικό
Επεξεργασία
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Υπότιτλοι
Επιλογή υποτίτλων
Κανένας
diff --git a/app/src/full/res/values-es/strings.xml b/app/src/full/res/values-es/strings.xml
index 366a85d..8356432 100644
--- a/app/src/full/res/values-es/strings.xml
+++ b/app/src/full/res/values-es/strings.xml
@@ -1,6 +1,7 @@
Inicio
+ Local
Descubre
Notificaciones
Añadido recientemente
@@ -103,8 +104,13 @@
Selecciona otra instancia
Historia
Editar
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Subtítulos
Pies de foto de la camioneta
Ninguno
diff --git a/app/src/full/res/values-fr/strings.xml b/app/src/full/res/values-fr/strings.xml
index b3cf631..5aebe4d 100644
--- a/app/src/full/res/values-fr/strings.xml
+++ b/app/src/full/res/values-fr/strings.xml
@@ -1,6 +1,7 @@
Locale
+ Local
Découvrir
Notifications
Nouveautés
@@ -16,7 +17,7 @@
Choisissez une instance
Cette instance ne semble pas être valide !
Aucune vidéo !
- No notifications!
+ Aucune notification !
Favicon
Ouvrir avec
Modifier une liste de lecture
@@ -103,8 +104,13 @@
Changer d\'instance
Historique
Modifier
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Légendes
Options d\'envoi
Aucune
diff --git a/app/src/full/res/values-it/strings.xml b/app/src/full/res/values-it/strings.xml
index 8a97b0d..a466916 100644
--- a/app/src/full/res/values-it/strings.xml
+++ b/app/src/full/res/values-it/strings.xml
@@ -1,6 +1,7 @@
Inizio
+ Local
Esplora
Notifiche
Aggiunti di recente
@@ -103,8 +104,13 @@
Prendi un\'altra istanza
Cronologia
Modifica
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Didascalie
Scegliere le didascalie
Nessuno
diff --git a/app/src/full/res/values-ja/strings.xml b/app/src/full/res/values-ja/strings.xml
index b2efa75..5cd0ef5 100644
--- a/app/src/full/res/values-ja/strings.xml
+++ b/app/src/full/res/values-ja/strings.xml
@@ -1,6 +1,7 @@
ホーム
+ Local
発見
通知
最近追加された項目
@@ -103,8 +104,13 @@
Pick another instance
履歴
編集
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
字幕
字幕を選択
なし
diff --git a/app/src/full/res/values-ko/strings.xml b/app/src/full/res/values-ko/strings.xml
index cdea048..48b7fb0 100644
--- a/app/src/full/res/values-ko/strings.xml
+++ b/app/src/full/res/values-ko/strings.xml
@@ -1,6 +1,7 @@
Home
+ Local
Discover
Notifications
Recently added
@@ -103,8 +104,13 @@
Pick another instance
History
Edit
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Captions
Pick captions
None
diff --git a/app/src/full/res/values-nl/strings.xml b/app/src/full/res/values-nl/strings.xml
index 6ef562f..c61c874 100644
--- a/app/src/full/res/values-nl/strings.xml
+++ b/app/src/full/res/values-nl/strings.xml
@@ -1,6 +1,7 @@
Home
+ Local
Ontdek
Meldingen
Onlangs toegevoegd
@@ -103,8 +104,13 @@
Kies een andere instantie
Geschiedenis
Bewerk
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Bijschriften
Pick captions
Geen
diff --git a/app/src/full/res/values-pl/strings.xml b/app/src/full/res/values-pl/strings.xml
index a7568f2..85667af 100644
--- a/app/src/full/res/values-pl/strings.xml
+++ b/app/src/full/res/values-pl/strings.xml
@@ -1,6 +1,7 @@
Strona główna
+ Local
Odkryj
Powiadomienia
Ostatnio dodany
@@ -103,8 +104,13 @@
Wybierz inny przypadek
Historia
Edycja
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Podpisy
Wybierz podpisy
Brak
diff --git a/app/src/full/res/values-pt/strings.xml b/app/src/full/res/values-pt/strings.xml
index cdea048..48b7fb0 100644
--- a/app/src/full/res/values-pt/strings.xml
+++ b/app/src/full/res/values-pt/strings.xml
@@ -1,6 +1,7 @@
Home
+ Local
Discover
Notifications
Recently added
@@ -103,8 +104,13 @@
Pick another instance
History
Edit
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Captions
Pick captions
None
diff --git a/app/src/full/res/values-ro/strings.xml b/app/src/full/res/values-ro/strings.xml
index cdea048..48b7fb0 100644
--- a/app/src/full/res/values-ro/strings.xml
+++ b/app/src/full/res/values-ro/strings.xml
@@ -1,6 +1,7 @@
Home
+ Local
Discover
Notifications
Recently added
@@ -103,8 +104,13 @@
Pick another instance
History
Edit
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Captions
Pick captions
None
diff --git a/app/src/full/res/values-ru/strings.xml b/app/src/full/res/values-ru/strings.xml
index fecbd92..fbdeac4 100644
--- a/app/src/full/res/values-ru/strings.xml
+++ b/app/src/full/res/values-ru/strings.xml
@@ -1,15 +1,16 @@
- Главная страница
+ Главная
+ Локальные
Подборка
Уведомления
- Недавно добавленные
+ По добавлению
Популярные
Много лайков
Упс! Произошла ошибка!
Беззвучный
Каналы
- Не показывать
+ Скрыто
Размыть
Показать
Не выбрано
@@ -22,7 +23,7 @@
Редактировать плейлист
Закрыть
Загрузить
- Предпросмотр
+ Предпросмотр изображения
Выберите файл для загрузки
Канал
Видео
@@ -33,11 +34,11 @@
Скачать
Изображение профиля
Обновить видео
- %d с
- %d м
- %d ч
- %d д
- %s просмотров
+ %d сек.
+ %d мин.
+ %d час.
+ %d д.
+ Просмотры: %s
Хост экземпляра
Загрузка, пожалуйста, подождите…
Видео было загружено!
@@ -103,12 +104,17 @@
Выберите другой экземпляр
История
Редактировать
+ Настройки видео
+ Интерфейс
+ Кэш
+ Определите кеш для видео (по умолчанию 100 Мб)
Определить качество видео по умолчанию
Разрешение для видео
+ Видео кэш: %d Мб
Субтитры
Выбрать субтитры
Ничто
- Позволяет изменить режим воспроизведения видео (по умолчанию, потоковой или через браузер).
+ Позволяет изменить режим воспроизведения видео (по умолчанию потоковый или через браузер).
Удалить видео
Вы уверены, что хотите удалить это видео?
Нет видео для отображения!
@@ -120,8 +126,8 @@
%1$s успешно импортировано]]>
%1$s произошла ошибка]]>
%1$s опубликовал новое видео: %2$s]]>
- %1$s занесено в черный список]]>
- %1$s удалено из черного списка]]>
+ %1$s занесено в чёрный список]]>
+ %1$s удалено из чёрного списка]]>
%1$s]]>
Добавить публичный комментарий
Оставить комментарий
@@ -201,17 +207,17 @@
Выбрать этот экземпляр
Неприличные видео
Неприличный контент: %1$s
- %1$s подписчиков у экземпляра
+ Подписчиков у экземпляра: %1$s
Помощь
Выбрать категории
Выбрать языки
- Информация об обновлении
+ Обновить данные
Добавление аккаунта
Список аккаунтов
Пауза
Воспроизвести
Свернуть
- Быстрое перемотка
+ Быстрая перемотка
Перемотка вперед
Вид свёрнутого видео
Уменьшить размер видео, когда приложение находится в фоновом режиме (Android N+)
diff --git a/app/src/full/res/values-sv/strings.xml b/app/src/full/res/values-sv/strings.xml
index cdea048..48b7fb0 100644
--- a/app/src/full/res/values-sv/strings.xml
+++ b/app/src/full/res/values-sv/strings.xml
@@ -1,6 +1,7 @@
Home
+ Local
Discover
Notifications
Recently added
@@ -103,8 +104,13 @@
Pick another instance
History
Edit
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Captions
Pick captions
None
diff --git a/app/src/full/res/values-zh-rCN/strings.xml b/app/src/full/res/values-zh-rCN/strings.xml
index cdea048..48b7fb0 100644
--- a/app/src/full/res/values-zh-rCN/strings.xml
+++ b/app/src/full/res/values-zh-rCN/strings.xml
@@ -1,6 +1,7 @@
Home
+ Local
Discover
Notifications
Recently added
@@ -103,8 +104,13 @@
Pick another instance
History
Edit
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Captions
Pick captions
None
diff --git a/app/src/full/res/values-zh-rTW/strings.xml b/app/src/full/res/values-zh-rTW/strings.xml
index cdea048..48b7fb0 100644
--- a/app/src/full/res/values-zh-rTW/strings.xml
+++ b/app/src/full/res/values-zh-rTW/strings.xml
@@ -1,6 +1,7 @@
Home
+ Local
Discover
Notifications
Recently added
@@ -103,8 +104,13 @@
Pick another instance
History
Edit
+ Video settings
+ Interface
+ Cache
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
+ Video cache: %d Mb
Captions
Pick captions
None
diff --git a/app/src/full/res/values/strings.xml b/app/src/full/res/values/strings.xml
index 7d472aa..f366db4 100644
--- a/app/src/full/res/values/strings.xml
+++ b/app/src/full/res/values/strings.xml
@@ -145,7 +145,7 @@
set_video_quality_choice
set_video_cache_choice
Cache
- Définir le cache pour les vidéos (défaut 100Mo)
+ Set the cache for videos (default 100Mb)
Define a default quality for videos
Resolution for videos
Video cache: %d Mb
diff --git a/app/src/full/res/values/styles.xml b/app/src/full/res/values/styles.xml
index f4807f3..97c4971 100644
--- a/app/src/full/res/values/styles.xml
+++ b/app/src/full/res/values/styles.xml
@@ -14,4 +14,8 @@
- @color/colorPrimaryDark_full
- @color/colorAccent_full
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/app/fedilab/fedilabtube/AccountActivity.java b/app/src/main/java/app/fedilab/fedilabtube/AccountActivity.java
index 8f0ae77..a413d82 100644
--- a/app/src/main/java/app/fedilab/fedilabtube/AccountActivity.java
+++ b/app/src/main/java/app/fedilab/fedilabtube/AccountActivity.java
@@ -215,7 +215,7 @@ public class AccountActivity extends AppCompatActivity {
AlertDialog.Builder builderSingle = new AlertDialog.Builder(AccountActivity.this);
builderSingle.setTitle(getString(R.string.list_of_accounts));
- if( accounts != null) {
+ if (accounts != null) {
final OwnAccountsAdapter accountsListAdapter = new OwnAccountsAdapter(AccountActivity.this, accounts);
final Account[] accountArray = new Account[accounts.size()];
int i = 0;
diff --git a/app/src/main/java/app/fedilab/fedilabtube/AllPlaylistsActivity.java b/app/src/main/java/app/fedilab/fedilabtube/AllPlaylistsActivity.java
index e04ccf9..2c84ff9 100644
--- a/app/src/main/java/app/fedilab/fedilabtube/AllPlaylistsActivity.java
+++ b/app/src/main/java/app/fedilab/fedilabtube/AllPlaylistsActivity.java
@@ -354,7 +354,7 @@ public class AllPlaylistsActivity extends AppCompatActivity {
@Override
public void onItemSelected(AdapterView> parent, View view, int position, long id) {
idChannel = channelId[position];
- if( position > 0 ) {
+ if (position > 0) {
selectedChannel = myChannels.get(position - 1);
}
}
diff --git a/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java b/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java
index 8665854..335a813 100644
--- a/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java
+++ b/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java
@@ -98,12 +98,12 @@ public class MainActivity extends AppCompatActivity {
new Thread(() -> {
try {
Token token = new RetrofitPeertubeAPI(MainActivity.this).manageToken(oauthParams);
- if( token == null) {
+ if (token == null) {
runOnUiThread(() -> Helper.logoutCurrentUser(MainActivity.this, account));
return;
}
UserMe userMe = new RetrofitPeertubeAPI(MainActivity.this, instance, token.getAccess_token()).verifyCredentials();
- if( userMe != null && userMe.getAccount() != null) {
+ if (userMe != null && userMe.getAccount() != null) {
new AccountDAO(MainActivity.this, db).updateAccount(userMe.getAccount());
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString(Helper.PREF_KEY_ID, account.getId());
@@ -113,7 +113,7 @@ public class MainActivity extends AppCompatActivity {
Set videoLanguageServerSet = new TreeSet<>(videoLanguageServer);
videoLanguageServerSet.addAll(videoLanguageServer);
Set videoLanguageLocal = sharedpreferences.getStringSet(getString(R.string.set_video_language_choice), null);
- if( videoLanguageServerSet.size() > 0 && videoLanguageLocal != null) {
+ if (videoLanguageServerSet.size() > 0 && videoLanguageLocal != null) {
videoLanguageServer.addAll(videoLanguageLocal);
}
editor.putStringSet(getString(R.string.set_video_language_choice), videoLanguageServerSet);
diff --git a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java
index 2045682..ad389b5 100644
--- a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java
+++ b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java
@@ -86,7 +86,9 @@ import com.google.android.exoplayer2.util.Util;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import app.fedilab.fedilabtube.client.APIResponse;
@@ -154,7 +156,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
private List captions;
private TextView no_action_text;
private String max_id;
- private RecyclerView lv_comments;
+ private RecyclerView lv_comments;
private boolean flag_loading;
private List comments;
@@ -197,7 +199,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
String token = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
- if( Helper.isLoggedIn(PeertubeActivity.this)) {
+ if (Helper.isLoggedIn(PeertubeActivity.this)) {
Account account = new AccountDAO(PeertubeActivity.this, db).getAccountByToken(token);
Helper.loadGiF(PeertubeActivity.this, account.getAvatar() != null ? account.getAvatar().getPath() : null, my_pp);
}
@@ -255,7 +257,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
getWindow().setAttributes(attrs);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
peertube_information_container.setVisibility(View.GONE);
- setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} else {
WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
@@ -303,7 +305,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
if (firstVisibleItem + visibleItemCount == totalItemCount) {
if (!flag_loading) {
CommentVM commentViewModel = new ViewModelProvider(PeertubeActivity.this).get(CommentVM.class);
- commentViewModel.getThread(videoId, max_id).observe(PeertubeActivity.this, apiresponse ->manageVIewComment(apiresponse));
+ commentViewModel.getThread(videoId, max_id).observe(PeertubeActivity.this, apiresponse -> manageVIewComment(apiresponse));
}
}
}
@@ -363,11 +365,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
peertube_playlist.setVisibility(View.VISIBLE);
peertube_bookmark.setVisibility(View.GONE);
- List videoIds = new ArrayList<>();
- videoIds.add(videoId);
- if (Helper.isLoggedIn(PeertubeActivity.this)) {
- playlistsViewModel.videoExists(videoIds).observe(PeertubeActivity.this, this::manageVIewVideosExist);
- }
TimelineVM feedsViewModel = new ViewModelProvider(PeertubeActivity.this).get(TimelineVM.class);
feedsViewModel.getVideo(videoId).observe(PeertubeActivity.this, this::manageVIewVideo);
CaptionsVM captionsViewModel = new ViewModelProvider(PeertubeActivity.this).get(CaptionsVM.class);
@@ -513,7 +510,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
peertube = apiResponse.getPeertubes().get(0);
-
add_comment_read.setOnClickListener(v -> {
if (isLoggedIn(PeertubeActivity.this)) {
add_comment_read.setVisibility(View.GONE);
@@ -545,7 +541,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
peertube_playlist.setOnClickListener(v -> {
- if (playlists != null && peertube.getId() != null) {
+ if (playlists != null && videoId != null) {
PopupMenu popup = new PopupMenu(PeertubeActivity.this, peertube_playlist);
for (Playlist playlist : playlists) {
@@ -586,7 +582,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
playlistForVideo.remove(playlist.getId());
} else {
item1.setTitle("✔ " + playlist.getDisplayName());
- playlistsViewModel.manage(PlaylistsVM.action.ADD_VIDEOS, playlist, peertube.getId()).observe(PeertubeActivity.this, apiResponse3 -> manageVIewPlaylists(PlaylistsVM.action.ADD_VIDEOS, apiResponse3));
+ playlistsViewModel.manage(PlaylistsVM.action.ADD_VIDEOS, playlist, videoId).observe(PeertubeActivity.this, apiResponse3 -> manageVIewPlaylists(PlaylistsVM.action.ADD_VIDEOS, apiResponse3));
playlistForVideo.add(playlist.getId());
}
return false;
@@ -846,7 +842,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
}
-
@Override
public void onDestroy() {
super.onDestroy();
@@ -931,7 +926,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
final ArrayAdapter arrayAdapter = new ArrayAdapter<>(PeertubeActivity.this, android.R.layout.select_dialog_item);
for (File file : peertube.getFiles()) {
if (file.getResolutions() != null) {
- if( file.getResolutions().getLabel().compareTo("0p") != 0) {
+ if (file.getResolutions().getLabel().compareTo("0p") != 0) {
arrayAdapter.add(file.getResolutions().getLabel());
}
}
@@ -1026,10 +1021,10 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
fullScreenButton.setOnClickListener(v -> {
if (!fullScreenMode) {
openFullscreenDialog();
- setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
- }else {
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
+ } else {
closeFullscreenDialog();
- setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
Handler handler = new Handler();
handler.postDelayed(() -> setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR), 2000);
@@ -1074,19 +1069,23 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
}
public void manageVIewPlaylists(PlaylistsVM.action actionType, APIResponse apiResponse) {
-
if (actionType == GET_PLAYLISTS && apiResponse != null) {
playlists = apiResponse.getPlaylists();
+ playlistsViewModel.videoExists(videoId).observe(PeertubeActivity.this, this::manageVIewVideosExist);
}
}
public void manageVIewVideosExist(APIResponse apiResponse) {
- playlistForVideo = new ArrayList<>();
- if( apiResponse.getError() == null && apiResponse.getVideoExistPlaylist() != null) {
-
- List videoIds = apiResponse.getVideoExistPlaylist();
- for(PlaylistExist.VideoId videoId: videoIds) {
- playlistForVideo.add(videoId.getPlaylistId());
+ if (apiResponse.getError() == null && apiResponse.getVideoExistPlaylist() != null) {
+ Map> videoIds = apiResponse.getVideoExistPlaylist();
+ Iterator>> it = videoIds.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry> pair = it.next();
+ List playlistExistVideo = pair.getValue();
+ for (PlaylistExist playlistExist : playlistExistVideo) {
+ playlistForVideo.add(playlistExist.getPlaylistId());
+ }
+ it.remove();
}
}
}
diff --git a/app/src/main/java/app/fedilab/fedilabtube/PeertubeEditUploadActivity.java b/app/src/main/java/app/fedilab/fedilabtube/PeertubeEditUploadActivity.java
index 5a2901f..0f321cc 100644
--- a/app/src/main/java/app/fedilab/fedilabtube/PeertubeEditUploadActivity.java
+++ b/app/src/main/java/app/fedilab/fedilabtube/PeertubeEditUploadActivity.java
@@ -671,7 +671,7 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
set_upload_submit.setEnabled(true);
}
- @SuppressWarnings("unused")
+ @SuppressWarnings({"unused", "RedundantSuppression"})
public void manageVIewPostActions(RetrofitPeertubeAPI.ActionType statusAction, APIResponse apiResponse) {
Intent intent = new Intent(PeertubeEditUploadActivity.this, MainActivity.class);
intent.putExtra(Helper.INTENT_ACTION, Helper.RELOAD_MYVIDEOS);
diff --git a/app/src/main/java/app/fedilab/fedilabtube/client/APIResponse.java b/app/src/main/java/app/fedilab/fedilabtube/client/APIResponse.java
index 3899c18..72a330a 100644
--- a/app/src/main/java/app/fedilab/fedilabtube/client/APIResponse.java
+++ b/app/src/main/java/app/fedilab/fedilabtube/client/APIResponse.java
@@ -29,7 +29,7 @@ import app.fedilab.fedilabtube.client.data.VideoData;
import app.fedilab.fedilabtube.client.data.VideoPlaylistData.VideoPlaylist;
import app.fedilab.fedilabtube.client.entities.Error;
import app.fedilab.fedilabtube.client.entities.OverviewVideo;
-import app.fedilab.fedilabtube.client.entities.PlaylistExist.VideoId;
+import app.fedilab.fedilabtube.client.entities.PlaylistExist;
import app.fedilab.fedilabtube.client.entities.Rating;
@SuppressWarnings({"unused", "RedundantSuppression"})
@@ -41,7 +41,7 @@ public class APIResponse {
private String actionReturn = null;
private Rating rating;
private OverviewVideo overviewVideo = null;
- private List videoExistPlaylist = null;
+ private Map> videoExistPlaylist = null;
private List peertubes = null;
private List comments = null;
private List muted;
@@ -240,11 +240,11 @@ public class APIResponse {
this.videoPlaylist = videoPlaylist;
}
- public List getVideoExistPlaylist() {
+ public Map> getVideoExistPlaylist() {
return videoExistPlaylist;
}
- public void setVideoExistPlaylist(List videoExistPlaylist) {
+ public void setVideoExistPlaylist(Map> videoExistPlaylist) {
this.videoExistPlaylist = videoExistPlaylist;
}
}
diff --git a/app/src/main/java/app/fedilab/fedilabtube/client/PeertubeService.java b/app/src/main/java/app/fedilab/fedilabtube/client/PeertubeService.java
index c580543..9ceaf71 100644
--- a/app/src/main/java/app/fedilab/fedilabtube/client/PeertubeService.java
+++ b/app/src/main/java/app/fedilab/fedilabtube/client/PeertubeService.java
@@ -55,7 +55,7 @@ import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
-
+@SuppressWarnings({"unused", "RedundantSuppression"})
public interface PeertubeService {
@GET("instances")
Call getInstances(@QueryMap Map params, @Query("nsfwPolicy[]") String nsfwPolicy, @Query("categoriesOr[]") List categories, @Query("languagesOr[]") List languages);
@@ -238,7 +238,7 @@ public interface PeertubeService {
Call getVideosPlayList(@Header("Authorization") String credentials, @Path("id") String id);
@GET("users/me/video-playlists/videos-exist")
- Call getVideoExistsInPlaylist(@Header("Authorization") String credentials, @Query("videoIds") List videoIds);
+ Call