File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -229,12 +229,14 @@ export const getProgress = (animeEntry: Media): number | undefined => {
229
229
const animeId = ( animeEntry . id || animeEntry ?. mediaListEntry ?. id ) as number ;
230
230
const lastWatched = getLastWatchedEpisode ( animeId ) ;
231
231
232
- if ( lastWatched !== undefined && lastWatched . data !== undefined ) {
233
- const progress = ( parseInt ( lastWatched . data . episode ?? "0" ) ) - ( ( lastWatched . duration as number * 0.85 ) > lastWatched . time ? 1 : 0 ) ;
234
- return Number . isNaN ( progress ) ? 0 : progress ;
232
+ const anilistProgress = animeEntry . mediaListEntry == null ? 0 : animeEntry . mediaListEntry . progress ;
233
+
234
+ if ( anilistProgress === 0 && lastWatched !== undefined && lastWatched . data !== undefined ) {
235
+ const localProgress = ( parseInt ( lastWatched . data . episode ?? "0" ) ) - ( ( lastWatched . duration as number * 0.85 ) > lastWatched . time ? 1 : 0 ) ;
236
+ return Number . isNaN ( localProgress ) ? 0 : localProgress ;
235
237
}
236
238
237
- return animeEntry . mediaListEntry == null ? 0 : animeEntry . mediaListEntry . progress ;
239
+ return anilistProgress ;
238
240
}
239
241
240
242
/**
You can’t perform that action at this time.
0 commit comments