fix: media list desc

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-12-27 15:10:44 +08:00
parent 0e8502b087
commit fedb67c809
3 changed files with 19 additions and 6 deletions

View File

@@ -517,6 +517,7 @@ class UserHttp {
int? otype, int? otype,
bool withCurrent = false, bool withCurrent = false,
bool desc = true, bool desc = true,
int sortField = 1,
}) async { }) async {
var res = await Request().get( var res = await Request().get(
Api.mediaList, Api.mediaList,
@@ -529,7 +530,7 @@ class UserHttp {
'ps': ps, 'ps': ps,
'direction': false, 'direction': false,
'desc': desc, 'desc': desc,
'sort_field': 1, 'sort_field': sortField,
'tid': 0, 'tid': 0,
'with_current': withCurrent, 'with_current': withCurrent,
}, },

View File

@@ -26,8 +26,8 @@ class MemberVideoCtr extends CommonController {
int? seriesId; int? seriesId;
final int mid; final int mid;
String? aid; String? aid;
RxString order = 'pubdate'.obs; late RxString order = 'pubdate'.obs;
RxString sort = 'desc'.obs; late RxString sort = 'desc'.obs;
RxInt count = (-1).obs; RxInt count = (-1).obs;
int? next; int? next;
EpisodicButton? episodicButton; EpisodicButton? episodicButton;
@@ -74,8 +74,8 @@ class MemberVideoCtr extends CommonController {
type: type, type: type,
mid: mid, mid: mid,
aid: type == ContributeType.video ? aid : null, aid: type == ContributeType.video ? aid : null,
order: order.value, order: type == ContributeType.video ? order.value : null,
sort: sort.value, sort: type == ContributeType.video ? null : sort.value,
pn: type == ContributeType.charging ? currentPage : null, pn: type == ContributeType.charging ? currentPage : null,
next: next, next: next,
seasonId: seasonId, seasonId: seasonId,
@@ -118,6 +118,9 @@ class MemberVideoCtr extends CommonController {
'mediaType': RegExp(r'page_type=([\d]+)') 'mediaType': RegExp(r'page_type=([\d]+)')
.firstMatch('${episodicButton?.uri}') .firstMatch('${episodicButton?.uri}')
?.group(1), ?.group(1),
'reverse': type == ContributeType.video
? order.value == 'click'
: sort.value == 'asc',
}, },
); );
break; break;

View File

@@ -333,13 +333,22 @@ class VideoDetailController extends GetxController
mediaList.length >= Get.arguments['count']) { mediaList.length >= Get.arguments['count']) {
return; return;
} }
bool desc =
_mediaType == 2 || Get.arguments['mediaType'] == '8' ? false : true;
var res = await UserHttp.getMediaList( var res = await UserHttp.getMediaList(
type: Get.arguments['mediaType'] ?? _mediaType, type: Get.arguments['mediaType'] ?? _mediaType,
bizId: Get.arguments['mediaId'] ?? -1, bizId: Get.arguments['mediaId'] ?? -1,
ps: 20, ps: 20,
oid: mediaList.isEmpty ? null : mediaList.last.id, oid: mediaList.isEmpty ? null : mediaList.last.id,
otype: mediaList.isEmpty ? null : mediaList.last.type, otype: mediaList.isEmpty ? null : mediaList.last.type,
desc: _mediaType == 2 || Get.arguments['mediaType'] == '8' ? false : true, desc:
Get.arguments['mediaType'] != null && Get.arguments['reverse'] == true
? desc.not
: desc,
sortField:
Get.arguments['mediaType'] == null && Get.arguments['reverse'] == true
? 2
: 1,
); );
if (res['status']) { if (res['status']) {
if (res['data'].isNotEmpty) { if (res['data'].isNotEmpty) {