Skip to content

legacy: add new route to resolve legacy file links#2179

Merged
zzacharo merged 1 commit intoCERNDocumentServer:mainfrom
zubeydecivelek:legacy-file-redirection
Apr 28, 2026
Merged

legacy: add new route to resolve legacy file links#2179
zzacharo merged 1 commit intoCERNDocumentServer:mainfrom
zubeydecivelek:legacy-file-redirection

Conversation

@zubeydecivelek
Copy link
Copy Markdown
Contributor

@zubeydecivelek zubeydecivelek commented Apr 24, 2026

@zubeydecivelek zubeydecivelek requested a review from zzacharo April 24, 2026 15:04
Comment thread cds/modules/legacy/redirector.py Outdated
except (NoResultFound, PIDDoesNotExistError, ResolverError, KeyError, TypeError):
abort(404)

# It's project, try the first video record
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here we have better utilities to be sure that it is a project. If we rely on this then it might be that video records without files are wrongly identified as "projects"

Comment thread cds/modules/legacy/redirector.py Outdated
if not record.get("_files", []):
videos = record.get("videos", [])
if videos:
video_pid = videos[0]["$ref"].split("/")[-1]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we iterate through all of them and "break" on the first time we find the file name?

@zubeydecivelek zubeydecivelek force-pushed the legacy-file-redirection branch from 7540ce1 to 7d67059 Compare April 28, 2026 09:26
@zubeydecivelek zubeydecivelek requested a review from zzacharo April 28, 2026 09:26
@zzacharo zzacharo merged commit 967bebd into CERNDocumentServer:main Apr 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants