Пример #1
0
        public void Add(SubFingerprintHash hash, SubFingerprintLookupEntry lookupEntry)
        {
            int index = -1;

            if (!trackToNumber.TryGetValue(lookupEntry.AudioTrack, out index))
            {
                index = trackToNumber.Count;
                trackToNumber.Add(lookupEntry.AudioTrack, index);
                numberToTrack.Add(index, lookupEntry.AudioTrack);
            }

            if (index == -1)
            {
                throw new Exception("something's wrong - this should not happen!!");
            }

            var dto = new DTO {
                Hash               = hash.Value,
                TrackNumber        = index,
                TrackPositionIndex = lookupEntry.Index
            };

            insertBuffer.Add(dto);

            if (insertBuffer.Count == 1000)
            {
                InsertBuffered();
            }

            //db.Insert();
        }
 public void Add(SubFingerprintHash hash, SubFingerprintLookupEntry lookupEntry)
 {
     if (!lookupTable.ContainsKey(hash))
     {
         lookupTable.Add(hash, new List <SubFingerprintLookupEntry>());
     }
     lookupTable[hash].Add(lookupEntry);
 }