Merge "pkg/index: bugfix; get mediatags by wholeRef when no corpus"

This commit is contained in:
mpl 2015-07-20 14:04:52 +00:00 committed by Gerrit Code Review
commit d01f0c52aa
1 changed files with 5 additions and 1 deletions

View File

@ -1231,7 +1231,11 @@ func (x *Index) GetMediaTags(fileRef blob.Ref) (tags map[string]string, err erro
if x.corpus != nil {
return x.corpus.GetMediaTags(fileRef)
}
it := x.queryPrefix(keyMediaTag, fileRef.String())
fi, err := x.GetFileInfo(fileRef)
if err != nil {
return nil, err
}
it := x.queryPrefix(keyMediaTag, fi.WholeRef.String())
defer closeIterator(it, &err)
for it.Next() {
tags[it.Key()] = it.Value()