Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit e150743

Browse files
committed
Fixed new replays flag for bookmark window
1 parent 52e391a commit e150743

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/electron/app/js/bookmarkswindow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function drawEntry() {
6868
if (parseInt(list[index].last_viewed) > 1514764800) d2 = prettydate.format(new Date(parseInt(list[index].last_viewed) * 1000))
6969

7070
let sex = parseInt(list[index].sex) < 0 ? '' : (parseInt(list[index].sex) == 0 ? 'female' : 'male')
71-
let isNew = parseInt(list[index].newest_replay) > parseInt(list[index].last_viewed) ? 'new' : ''
71+
let isNew = (list[index].newest_replay > list[index].last_viewed) || list[index].counts.changed ? 'new' : ''
7272
let monitored = list[index].lamd == undefined ? 'dim' : list[index].lamd.monitor ? 'bright yellow' : 'dim'
7373

7474
$('#bookmark-list').append(`

src/electron/app/js/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,11 +808,13 @@ async function _checkBookmark(b, dispatch) {
808808
b.counts.new_following = parseInt(user.count_info.following_count) - parseInt(b.counts.followings)
809809
b.counts.new_followers = parseInt(user.count_info.follower_count) - parseInt(b.counts.followers)
810810
b.counts.new_replays = parseInt(user.count_info.video_count) - parseInt(b.counts.replays)
811-
811+
812812
b.counts.replays = parseInt(user.count_info.video_count)
813813
b.counts.friends = parseInt(user.count_info.friends_count)
814814
b.counts.followers = parseInt(user.count_info.follower_count)
815815
b.counts.followings = parseInt(user.count_info.following_count)
816+
b.counts.changed = false // This is used as a secondary flag for new replays
817+
816818
b.signature = user.user_info.usign
817819
b.sex = user.user_info.sex
818820
b.face = user.user_info.face
@@ -837,8 +839,8 @@ async function _checkBookmark(b, dispatch) {
837839

838840
for (let i = 0; i < replays.length; i++) {
839841
if (replays[i].vtime - b.newest_replay > 0) {
840-
b.hasNewReplays = true
841-
b.newest_replay = parseInt(Math.floor(replays[0].vtime))
842+
b.counts.changed = true
843+
b.newest_replay = parseInt(replays[0].vtime)
842844
DataManager.updateBookmark(b)
843845

844846
if (appSettings.get('general.enableShowReplays') === true) {

src/electron/datamanager.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,6 @@ class DataManager {
465465
break
466466
}
467467
}
468-
fs.writeFileSync(bookmarksJson, JSON.stringify(bookmarks, null, 2))
469468
isBusy = false
470469
}
471470

0 commit comments

Comments
 (0)