Skip to content

Commit

Permalink
conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
agahkarakuzu committed Dec 17, 2024
1 parent 56412b1 commit ac73138
Showing 1 changed file with 30 additions and 26 deletions.
56 changes: 30 additions & 26 deletions data/filters/conditional-archives.lua
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
function Meta(meta)

-- Check if each DOI is present and not set to 'N/A'
print("Repository DOI value:", meta.repository_doi and meta.repository_doi[1].text or "nil")
if meta.repository_doi and meta.repository_doi[1] and meta.repository_doi[1].text ~= 'N/A' then
meta.include_repository_doi = true
print("Including repository DOI")
-- Check repository DOI
print("Repository DOI value:", meta.repository_doi and type(meta.repository_doi[1]) == "table" and meta.repository_doi[1].text or "nil")
if meta.repository_doi and type(meta.repository_doi[1]) == "table" and meta.repository_doi[1].text and meta.repository_doi[1].text ~= 'N/A' then
meta.include_repository_doi = true
print("Including repository DOI")
end

print("Data DOI value:", meta.data_doi and meta.data_doi[1].text or "nil")
if meta.data_doi and meta.data_doi[1] and meta.data_doi[1].text ~= 'N/A' then
meta.include_data_doi = true
print("Including data DOI")
-- Check data DOI
print("Data DOI value:", meta.data_doi and type(meta.data_doi[1]) == "table" and meta.data_doi[1].text or "nil")
if meta.data_doi and type(meta.data_doi[1]) == "table" and meta.data_doi[1].text and meta.data_doi[1].text ~= 'N/A' then
meta.include_data_doi = true
print("Including data DOI")
end

print("Book DOI value:", meta.book_doi and meta.book_doi[1].text or "nil")
if meta.book_doi and meta.book_doi[1] and meta.book_doi[1].text ~= 'N/A' then
meta.include_book_doi = true
print("Including book DOI")
-- Check book DOI
print("Book DOI value:", meta.book_doi and type(meta.book_doi[1]) == "table" and meta.book_doi[1].text or "nil")
if meta.book_doi and type(meta.book_doi[1]) == "table" and meta.book_doi[1].text and meta.book_doi[1].text ~= 'N/A' then
meta.include_book_doi = true
print("Including book DOI")
end

print("Docker DOI value:", meta.docker_doi and meta.docker_doi[1].text or "nil")
if meta.docker_doi and meta.docker_doi[1] and meta.docker_doi[1].text ~= 'N/A' then
meta.include_docker_doi = true
print("Including docker DOI")
-- Check docker DOI
print("Docker DOI value:", meta.docker_doi and type(meta.docker_doi[1]) == "table" and meta.docker_doi[1].text or "nil")
if meta.docker_doi and type(meta.docker_doi[1]) == "table" and meta.docker_doi[1].text and meta.docker_doi[1].text ~= 'N/A' then
meta.include_docker_doi = true
print("Including docker DOI")
end

print("Software review URL value:", meta.software_review_url and meta.software_review_url[1].text or "nil")
if meta.software_review_url and meta.software_review_url[1] and meta.software_review_url[1].text ~= 'N/A' then
meta.include_software_review = true
print("Including software review")
-- Check software review URL
print("Software review URL value:", meta.software_review_url and type(meta.software_review_url[1]) == "table" and meta.software_review_url[1].text or "nil")
if meta.software_review_url and type(meta.software_review_url[1]) == "table" and meta.software_review_url[1].text and meta.software_review_url[1].text ~= 'N/A' then
meta.include_software_review = true
print("Including software review")
end

print("Book exec URL value:", meta.book_exec_url and meta.book_exec_url[1].text or "nil")
if meta.book_exec_url and meta.book_exec_url[1] and meta.book_exec_url[1].text ~= 'N/A' then
meta.include_book_exec = true
print("Including book exec")
-- Check book exec URL
print("Book exec URL value:", meta.book_exec_url and type(meta.book_exec_url[1]) == "table" and meta.book_exec_url[1].text or "nil")
if meta.book_exec_url and type(meta.book_exec_url[1]) == "table" and meta.book_exec_url[1].text and meta.book_exec_url[1].text ~= 'N/A' then
meta.include_book_exec = true
print("Including book exec")
end

return meta
Expand Down

0 comments on commit ac73138

Please sign in to comment.