mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2026-05-18 22:12:35 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 418f34c7e8 | |||
| 21c2ab21b2 | |||
| 1ace7318f3 | |||
| 48052b88db |
@@ -319,7 +319,11 @@ class UIDialogs {
|
||||
closeAction?.invoke()
|
||||
}, UIDialogs.ActionStyle.NONE),
|
||||
UIDialogs.Action(context.getString(R.string.retry), {
|
||||
retryAction?.invoke();
|
||||
try {
|
||||
retryAction?.invoke();
|
||||
} catch (e: Throwable) {
|
||||
Logger.e(TAG, "Unhandled exception retrying", e)
|
||||
}
|
||||
}, UIDialogs.ActionStyle.PRIMARY)
|
||||
);
|
||||
else
|
||||
@@ -333,7 +337,11 @@ class UIDialogs {
|
||||
closeAction?.invoke()
|
||||
}, UIDialogs.ActionStyle.NONE),
|
||||
UIDialogs.Action(context.getString(R.string.retry), {
|
||||
retryAction?.invoke();
|
||||
try {
|
||||
retryAction?.invoke();
|
||||
} catch (e: Throwable) {
|
||||
Logger.e(TAG, "Unhandled exception retrying", e)
|
||||
}
|
||||
}, UIDialogs.ActionStyle.PRIMARY)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,11 @@ class TaskHandler<TParameter, TResult> {
|
||||
handled = true;
|
||||
} catch (e: Throwable) {
|
||||
Logger.w(TAG, "Handled exception in TaskHandler onSuccess.", e);
|
||||
onError.emit(e, parameter);
|
||||
try {
|
||||
onError.emit(e, parameter);
|
||||
} catch (e: Throwable) {
|
||||
Logger.e(TAG, "Unhandled exception in .exception handler 1", e)
|
||||
}
|
||||
handled = true;
|
||||
}
|
||||
}
|
||||
@@ -99,10 +103,14 @@ class TaskHandler<TParameter, TResult> {
|
||||
if (id != _idGenerator)
|
||||
return@withContext;
|
||||
|
||||
if (!onError.emit(e, parameter)) {
|
||||
Logger.e(TAG, "Uncaught exception handled by TaskHandler.", e);
|
||||
} else {
|
||||
//Logger.w(TAG, "Handled exception in TaskHandler invoke.", e); (Prevents duplicate logs)
|
||||
try {
|
||||
if (!onError.emit(e, parameter)) {
|
||||
Logger.e(TAG, "Uncaught exception handled by TaskHandler.", e);
|
||||
} else {
|
||||
//Logger.w(TAG, "Handled exception in TaskHandler invoke.", e); (Prevents duplicate logs)
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
Logger.e(TAG, "Unhandled exception in .exception handler 2", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -619,6 +619,7 @@ class VideoDetailView : ConstraintLayout {
|
||||
loadCurrentVideo(lastPositionMilliseconds);
|
||||
updatePillButtonVisibilities();
|
||||
setCastEnabled(false);
|
||||
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,11 @@ class ItemMoveCallback : ItemTouchHelper.Callback {
|
||||
var onRowMoved = Event2<Int, Int>();
|
||||
var onRowSelected = Event1<ViewHolder>();
|
||||
var onRowClear = Event1<ViewHolder>();
|
||||
var canEdit = true
|
||||
|
||||
constructor() : super() { }
|
||||
|
||||
override fun isLongPressDragEnabled(): Boolean { return true; }
|
||||
override fun isLongPressDragEnabled(): Boolean { return canEdit; }
|
||||
override fun isItemViewSwipeEnabled(): Boolean { return false; }
|
||||
|
||||
override fun getMovementFlags(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder): Int {
|
||||
|
||||
@@ -26,6 +26,7 @@ class VideoListEditorView : FrameLayout {
|
||||
val onVideoOptions = Event1<IPlatformVideo>();
|
||||
val onVideoClicked = Event1<IPlatformVideo>();
|
||||
val isEmpty get() = _videos.isEmpty();
|
||||
val itemMoveCallback: ItemMoveCallback
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet? = null) : super(context, attrs) {
|
||||
val recyclerPlaylist = RecyclerView(context, attrs);
|
||||
@@ -34,14 +35,14 @@ class VideoListEditorView : FrameLayout {
|
||||
recyclerPlaylist.layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
|
||||
addView(recyclerPlaylist);
|
||||
|
||||
val callback = ItemMoveCallback();
|
||||
val touchHelper = ItemTouchHelper(callback);
|
||||
itemMoveCallback = ItemMoveCallback();
|
||||
val touchHelper = ItemTouchHelper(itemMoveCallback);
|
||||
val adapterVideos = VideoListEditorAdapter(touchHelper);
|
||||
recyclerPlaylist.adapter = adapterVideos;
|
||||
recyclerPlaylist.layoutManager = LinearLayoutManager(context);
|
||||
touchHelper.attachToRecyclerView(recyclerPlaylist);
|
||||
|
||||
callback.onRowMoved.subscribe { fromPosition, toPosition ->
|
||||
itemMoveCallback.onRowMoved.subscribe { fromPosition, toPosition ->
|
||||
synchronized(_videos) {
|
||||
if (fromPosition < toPosition) {
|
||||
for (i in fromPosition until toPosition)
|
||||
@@ -94,6 +95,7 @@ class VideoListEditorView : FrameLayout {
|
||||
synchronized(_videos) {
|
||||
_videos.clear();
|
||||
_videos.addAll(videos ?: listOf());
|
||||
itemMoveCallback.canEdit = canEdit
|
||||
_adapterVideos?.setVideos(_videos, canEdit);
|
||||
}
|
||||
}
|
||||
|
||||
Submodule app/src/stable/assets/sources/dailymotion updated: ffd40f2006...d115430011
Submodule app/src/stable/assets/sources/odysee updated: 215cd9bd70...6ea9fa7e4c
Submodule app/src/stable/assets/sources/patreon updated: e5dce87c9d...d98c7f8aee
Submodule app/src/stable/assets/sources/peertube updated: 6e7f943b0b...56bff39123
Submodule app/src/stable/assets/sources/rumble updated: 932fdf78de...3bbce81794
Submodule app/src/stable/assets/sources/soundcloud updated: f8234d6af8...5456431268
Submodule app/src/stable/assets/sources/spotify updated: 47e76a96e5...1d884f50ab
Submodule app/src/stable/assets/sources/youtube updated: a297a0a788...6d6838e2a4
Submodule app/src/unstable/assets/sources/apple-podcasts updated: 9aa31c5e87...089987f007
Submodule app/src/unstable/assets/sources/bitchute updated: b31ced36b9...b213f91c0b
Submodule app/src/unstable/assets/sources/dailymotion updated: ffd40f2006...d115430011
Submodule app/src/unstable/assets/sources/odysee updated: 215cd9bd70...6ea9fa7e4c
Submodule app/src/unstable/assets/sources/patreon updated: e5dce87c9d...d98c7f8aee
Submodule app/src/unstable/assets/sources/peertube updated: 6e7f943b0b...56bff39123
Submodule app/src/unstable/assets/sources/rumble updated: 932fdf78de...3bbce81794
Submodule app/src/unstable/assets/sources/soundcloud updated: f8234d6af8...5456431268
Submodule app/src/unstable/assets/sources/spotify updated: 47e76a96e5...1d884f50ab
Submodule app/src/unstable/assets/sources/youtube updated: a297a0a788...6d6838e2a4
Reference in New Issue
Block a user