QutEcoacoustics / baw-server

The acoustic workbench server for storing and managing ecoacoustic data. Manages the structure and audio data. Provides an API for clients access.
Apache License 2.0
9 stars 4 forks source link

Harvest: find_mapping_for_path could match the incorrect mapping #601

Closed atruskie closed 2 years ago

atruskie commented 2 years ago

Given the current code:

https://github.com/QutEcoacoustics/baw-server/blob/8914eb958b1f6bef3285a593e4954408d205cbbd/app/models/harvest.rb#L166-L182

and harvest item { path: a/b.wav}

would match mapping { path: aaaaaaaaaaaaa } over mapping { path: a }.

I need to change the matches so that whole path segments are matched individually.

The same applies to the match function on the Mapping struct.