unset primary bitstream on bitstream service

This commit is contained in:
Paulo Graça
2023-10-19 08:58:08 +01:00
parent 48b0b71c63
commit 47ca74bc42

View File

@@ -276,6 +276,10 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
//Remove our bitstream from all our bundles
final List<Bundle> bundles = bitstream.getBundles();
for (Bundle bundle : bundles) {
//We also need to remove the bitstream id when it's set as bundle's primary bitstream
if(bitstream.equals(bundle.getPrimaryBitstream())) {
bundle.unsetPrimaryBitstreamID();
}
bundle.removeBitstream(bitstream);
}