always check for correct index setup upon indexing a track

This commit is contained in:
Helmut Merz 2014-04-09 13:09:15 +02:00
parent 2bc3267e9b
commit cb365aaea2

View file

@ -140,11 +140,12 @@ class TrackingStorage(BTreeContainer):
def setupIndexes(self):
changed = False
for idx in self.indexAttributes:
for idx in self.trackFactory.index_attributes:
if idx not in self.indexes:
self.indexes[idx] = FieldIndex()
changed = True
if changed:
self.indexAttributes = self.trackFactory.index_attributes
self.reindexTracks()
def idFromNum(self, num):
@ -235,7 +236,7 @@ class TrackingStorage(BTreeContainer):
self.unindexTrack(trackNum, track)
def indexTrack(self, trackNum, track, idx=None):
#self.setupIndexes()
self.setupIndexes()
if not trackNum:
trackNum = int(track.__name__)
data = track.indexdata