Make duration difference an absolute value so threshold check always works

This commit is contained in:
Etoh 2013-07-02 00:35:28 +01:00
parent 58260c56e1
commit 6687630131

View File

@ -430,7 +430,7 @@ class SyncplayUser(object):
return False return False
sameName = stripfilename(self.file['name']) == stripfilename(file_['name']) sameName = stripfilename(self.file['name']) == stripfilename(file_['name'])
sameSize = self.file['size'] == file_['size'] sameSize = self.file['size'] == file_['size']
sameDuration = int(self.file['duration']) - int(file_['duration']) < constants.DIFFFERENT_DURATION_THRESHOLD sameDuration = abs(int(self.file['duration']) - int(file_['duration'])) < constants.DIFFFERENT_DURATION_THRESHOLD
return sameName and sameSize and sameDuration return sameName and sameSize and sameDuration
def __lt__(self, other): def __lt__(self, other):