audeering / audb

Manage audio and video databases
https://audeering.github.io/audb/
Other
23 stars 1 forks source link

audb.publish() can look for wrong version number when updating existing archives #377

Closed hagenw closed 4 months ago

hagenw commented 4 months ago

When a file was deleted that is part of a previously published archive, and that archive was not published in previous_version, but earlier audb.publish() will fail to update that archive as it tries to download previous_version of that archive and not the version specified in the dependency table:

https://github.com/audeering/audb/blob/adf83dc3f8de1d8329405fc08e015f30489cb915/audb/core/publish.py#L408-L414

hagenw commented 4 months ago

It should be fixed by the following code:

 if missing_files: 
     with tempfile.TemporaryDirectory() as tmp_root: 
         backend.get_archive( 
             archive_file, 
             tmp_root, 
             deps.version(missing_files[0]), 
         )