Skip to content

Commit

Permalink
Improve vod preview refresh
Browse files Browse the repository at this point in the history
Signed-off-by: fgl27 <fglfgl27@gmail.com>
  • Loading branch information
fgl27 committed Feb 17, 2021
1 parent 66e5a25 commit ce515d9
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions app/specific/UserLiveFeedobj.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ function UserLiveFeedobj_StartDefault(pos) {
if (UserLiveFeed_status[pos]) {

if (UserLiveFeed_ObjNotNull(pos))
Main_values.UserLiveFeed_LastPos[pos] = UserLiveFeed_DataObj[pos][UserLiveFeed_FeedPosY[pos]][14];
Main_values.UserLiveFeed_LastPos[pos] =
UserLiveFeed_DataObj[pos][UserLiveFeed_FeedPosY[pos]][UserLiveFeed_FeedPosX >= UserLiveFeedobj_UserVodPos ? 7 : 14];

}

Expand Down Expand Up @@ -370,14 +371,14 @@ function UserLiveFeedobj_ShowHistory() {

if (AddUser_UserIsSet()) {

UserLiveFeedobj_StartDefault(UserLiveFeedobj_UserHistoryPos);
UserLiveFeedobj_ShowFeedCheck(UserLiveFeedobj_UserHistoryPos, true);

}

}

function UserLiveFeedobj_History() {
UserLiveFeedobj_StartDefault(UserLiveFeedobj_UserHistoryPos);

var array = Main_values_History_data[AddUser_UsernameArray[0].id].live;

Expand All @@ -401,8 +402,10 @@ function UserLiveFeedobj_History() {
if (response_items) {

for (i; i < response_items; i++) {

cell = response[i];
id = cell.data[7];

if (!cell.forceVod) {

if (!UserLiveFeed_idObject[pos].hasOwnProperty(id) && cell.data[14] && cell.data[14] !== '') {
Expand Down Expand Up @@ -430,10 +433,14 @@ function UserLiveFeedobj_History() {
}

if (!itemsCount) UserLiveFeedobj_Empty(pos);

} else UserLiveFeedobj_Empty(pos);

UserLiveFeed_itemsCount[pos] = itemsCount;

if (UserLiveFeed_idObject[pos].hasOwnProperty(Main_values.UserLiveFeed_LastPos[pos]))
UserLiveFeed_FeedPosY[pos] = UserLiveFeed_idObject[pos][Main_values.UserLiveFeed_LastPos[pos]];

UserLiveFeed_loadDataSuccessFinish(pos);
}

Expand Down Expand Up @@ -1072,12 +1079,12 @@ function UserLiveFeedobj_loadDataBaseVodSuccess(responseText, pos) {
if (response_items) {

for (i; i < response_items; i++) {
id = response[i]._id;
mArray = ScreensObj_VodCellArray(response[i]);
id = mArray[7];

if (!UserLiveFeed_idObject[pos].hasOwnProperty(id)) {

UserLiveFeed_idObject[pos][id] = itemsCount;
mArray = ScreensObj_VodCellArray(response[i]);

// if (Main_A_includes_B(mArray[0] + '', '404_processing')) {
// mArray[0] = 'https://static-cdn.jtvnw.net/s3_vods/' + mArray[8].split('/')[3] +
Expand Down Expand Up @@ -1109,8 +1116,10 @@ function UserLiveFeedobj_loadDataBaseVodSuccess(responseText, pos) {
}

if (UserLiveFeed_obj[pos].loadingMore) {

UserLiveFeed_obj[pos].loadingMore = false;
if (pos === UserLiveFeed_FeedPosX) UserLiveFeed_CounterDialog(UserLiveFeed_FeedPosY[pos], UserLiveFeed_itemsCount[pos]);

} else {
Main_setTimeout(
function() {
Expand All @@ -1127,13 +1136,11 @@ function UserLiveFeedobj_loadDataBaseVodSuccess(responseText, pos) {
//User VOD end

//User VOD history
var UserLiveFeedobj_VodHistoryFeedOldUserName = '';
function UserLiveFeedobj_ShowUserVodHistory() {
UserLiveFeedobj_SetBottomText(UserLiveFeedobj_UserVodHistoryPos - 2);

if (AddUser_UserIsSet()) {
UserLiveFeedobj_ShowFeedCheck(UserLiveFeedobj_UserVodHistoryPos, (UserLiveFeedobj_VodHistoryFeedOldUserName !== AddUser_UsernameArray[0].name));
UserLiveFeedobj_VodHistoryFeedOldUserName = AddUser_UsernameArray[0].name;
UserLiveFeedobj_ShowFeedCheck(UserLiveFeedobj_UserVodHistoryPos, true);
}
}

Expand Down

0 comments on commit ce515d9

Please sign in to comment.