mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
committed by
GitHub
parent
6009668427
commit
3c34e43827
@@ -105,14 +105,11 @@ class RequestUtils {
|
||||
|
||||
static Future<void> actionRelationMod({
|
||||
required BuildContext context,
|
||||
required dynamic mid,
|
||||
required int mid,
|
||||
required bool isFollow,
|
||||
required ValueChanged<int>? callback,
|
||||
Map? followStatus,
|
||||
}) async {
|
||||
if (mid == null) {
|
||||
return;
|
||||
}
|
||||
feedBack();
|
||||
if (!isFollow) {
|
||||
var res = await VideoHttp.relationMod(
|
||||
@@ -283,23 +280,21 @@ class RequestUtils {
|
||||
// }
|
||||
// }
|
||||
|
||||
static Future<void> insertCreatedDyn(dynamic id) async {
|
||||
static Future<void> insertCreatedDyn(Object id) async {
|
||||
try {
|
||||
if (id != null) {
|
||||
await Future.delayed(const Duration(milliseconds: 200));
|
||||
var res = await DynamicsHttp.dynamicDetail(id: id);
|
||||
if (res['status']) {
|
||||
final ctr = Get.find<DynamicsTabController>(tag: 'all');
|
||||
if (ctr.loadingState.value.isSuccess) {
|
||||
List<DynamicItemModel>? list = ctr.loadingState.value.data;
|
||||
if (list != null) {
|
||||
list.insert(0, res['data']);
|
||||
ctr.loadingState.refresh();
|
||||
return;
|
||||
}
|
||||
await Future.delayed(const Duration(milliseconds: 200));
|
||||
var res = await DynamicsHttp.dynamicDetail(id: id);
|
||||
if (res['status']) {
|
||||
final ctr = Get.find<DynamicsTabController>(tag: 'all');
|
||||
if (ctr.loadingState.value.isSuccess) {
|
||||
List<DynamicItemModel>? list = ctr.loadingState.value.data;
|
||||
if (list != null) {
|
||||
list.insert(0, res['data']);
|
||||
ctr.loadingState.refresh();
|
||||
return;
|
||||
}
|
||||
ctr.loadingState.value = Success([res['data']]);
|
||||
}
|
||||
ctr.loadingState.value = Success([res['data']]);
|
||||
}
|
||||
} catch (e) {
|
||||
if (kDebugMode) debugPrint('create dyn $e');
|
||||
@@ -307,7 +302,7 @@ class RequestUtils {
|
||||
}
|
||||
|
||||
static Future<void> checkCreatedDyn({
|
||||
dynamic id,
|
||||
Object? id,
|
||||
String? dynText,
|
||||
bool isManual = false,
|
||||
}) async {
|
||||
@@ -386,8 +381,8 @@ class RequestUtils {
|
||||
required BuildContext context,
|
||||
required bool isCopy,
|
||||
required MultiSelectController<R, T> ctr,
|
||||
required dynamic mediaId,
|
||||
required dynamic mid,
|
||||
required Object? mediaId,
|
||||
required Object mid,
|
||||
}) {
|
||||
FavHttp.allFavFolders(mid).then((res) {
|
||||
if (context.mounted && res.dataOrNull?.list?.isNotEmpty == true) {
|
||||
@@ -439,7 +434,7 @@ class RequestUtils {
|
||||
isCopy: isCopy,
|
||||
isFav: ctr is! LaterController,
|
||||
srcMediaId: mediaId,
|
||||
tarMediaId: checkedId,
|
||||
tarMediaId: checkedId!,
|
||||
resources: removeList
|
||||
.map(
|
||||
(item) => ctr is LaterController
|
||||
|
||||
Reference in New Issue
Block a user