Skip to content

Commit

Permalink
#212 Fix needsUpdate logic in MediaFileService
Browse files Browse the repository at this point in the history
  • Loading branch information
kagemomiji committed Dec 1, 2023
1 parent d9fd95f commit bc69629
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,12 @@ public MediaFile getParentOf(MediaFile mediaFile, boolean minimizeDiskAccess) {
}

private boolean needsUpdate(MediaFile mediaFile, boolean minimizeDiskAccess) {
return minimizeDiskAccess
return !minimizeDiskAccess
&& !mediaFile.isIndexedTrack() // ignore virtual track
&& (mediaFile.getVersion() < MediaFile.VERSION
|| settingsService.getFullScan()
|| mediaFile.getChanged().truncatedTo(ChronoUnit.MICROS).compareTo(FileUtil.lastModified(mediaFile.getFullPath()).truncatedTo(ChronoUnit.MICROS)) < 0
|| (!mediaFile.hasIndex() || mediaFile.getChanged().truncatedTo(ChronoUnit.MICROS).compareTo(FileUtil.lastModified(mediaFile.getFullIndexPath()).truncatedTo(ChronoUnit.MICROS)) < 0)
|| (mediaFile.hasIndex() && mediaFile.getChanged().truncatedTo(ChronoUnit.MICROS).compareTo(FileUtil.lastModified(mediaFile.getFullIndexPath()).truncatedTo(ChronoUnit.MICROS)) < 0)
);
}

Expand Down

0 comments on commit bc69629

Please sign in to comment.