Bug 998956 - [MediaDB] Ignore the timezone offset when it is multiple of 10 minutes

I don't understand why lastModified is in the if condition. Are you checking whether it is null?  If it was, there would have been an exception on the line above.  So I think you don't need that.

It occurs to me now that in addition to checking that the time have an exact 10 minute offset, we should also check whether they are within +/- 12 hours of each other. (Is it possible to have a timezone offset that is more than +12 or -12?).  So maybe something like:

// In release 1.3 and before files reported local times, and in 1.4 and later they report UTC times. If the user has
// upgraded from 1.3 to 1.4 they may have files in the db whose times are in a local timezone. We want to recognize
// those files as matching existing files so we consider two files to have the same time if  they are within +/- 12
// hours of each other and if the difference in times is an exactly multiple of 10 minutes. (This assumes all world
// timezones are exact multiples of 10 minutes.)
var timeDifference = lastModified.getTime() - dbfile.date;
var sameTime = (timeDifference === 0 ||
   ((Math.abs(timeDifference) <= 12 * 60 * 60 * 1000) &&
     (timeDifference % 10 * 60 * 1000 === 0)))
var sameSize = dsfile.size === dbfile.size;

if (!sameTime || !sameSize) { ... }