Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

import { APP_CONFIG, AppConfig } from '../../config/app-config.interface';
import { PAGE_NOT_FOUND_PATH } from '../app-routing-paths';
import { BitstreamDataService } from '../core/data/bitstream-data.service';
import { RemoteData } from '../core/data/remote-data';
Expand All @@ -30,6 +31,7 @@ export const legacyBitstreamURLRedirectGuard: CanActivateFn = (
bitstreamDataService: BitstreamDataService = inject(BitstreamDataService),
serverHardRedirectService: HardRedirectService = inject(HardRedirectService),
router: Router = inject(Router),
appConfig: AppConfig = inject(APP_CONFIG),
): Observable<UrlTree | boolean> => {
const prefix = route.params.prefix;
const suffix = route.params.suffix;
Expand All @@ -46,7 +48,9 @@ export const legacyBitstreamURLRedirectGuard: CanActivateFn = (
getFirstCompletedRemoteData(),
map((rd: RemoteData<Bitstream>) => {
if (rd.hasSucceeded && !rd.hasNoContent) {
serverHardRedirectService.redirect(new URL(`/bitstreams/${rd.payload.uuid}/download`, serverHardRedirectService.getCurrentOrigin()).href, 301);
const nameSpace = appConfig.ui.nameSpace?.replace(/\/$/, '') || '';
const redirectUrl = new URL(nameSpace + `/bitstreams/${rd.payload.uuid}/download`, serverHardRedirectService.getCurrentOrigin()).href;
serverHardRedirectService.redirect(redirectUrl, 301);
return false;
} else {
return router.createUrlTree([PAGE_NOT_FOUND_PATH]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ export class ClarinFilesSectionComponent implements OnInit {
return file.name;
});

const url = `${this.halService.getRootHref()}/core/items/${this.item.id}/allzip?handleId=${this.itemHandle}`;
this.command = `curl -o "allzip.zip" "${url}"`;
// Generate curl command for individual bitstream downloads
const baseUrl = `${this.halService.getRootHref()}/bitstream/${this.itemHandle}`;
const fileNamesFormatted = fileNames.map((fileName, index) => `/${index}/${fileName}`).join(',');
this.command = `curl -O ${baseUrl}{${fileNamesFormatted}}`;
}

loadDownloadZipConfigProperties() {
Expand Down
Loading