Skip to content

Commit

Permalink
fix: mapping for COPYRIGHT_LAW / COPYRIGHT_FREE ('license.internal')
Browse files Browse the repository at this point in the history
- docs: add explanations with regard to how these 'internal'-values are displayed in the edu-sharing frontend

Signed-off-by: criamos <[email protected]>
  • Loading branch information
Criamos committed Dec 7, 2023
1 parent 9d25732 commit 14295c8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion converter/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class Constants:
"PDM": [LICENSE_PDM],
}

LICENSE_COPYRIGHT_LAW: Final[str] = "COPYRIGHT_FREE"
LICENSE_COPYRIGHT_FREE: Final[str] = "COPYRIGHT_FREE" # edu-sharing Frontend: "Copyright, freier Zugang"
LICENSE_COPYRIGHT_LAW: Final[str] = "COPYRIGHT_LICENSE" # edu-sharing Frontend: "Copyright, lizenzpflichtig"
LICENSE_CUSTOM: Final[str] = "CUSTOM" # Custom License, use the license description field for arbitrary values
LICENSE_NONPUBLIC: Final[str] = "NONPUBLIC"
LICENSE_SCHULFUNK: Final[str] = "SCHULFUNK" # "Schulfunk (§47 UrhG)"
Expand Down
2 changes: 1 addition & 1 deletion converter/es_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def map_license(self, spaces, license):
)
if "internal" in license:
match license["internal"]:
case "CC_0" | "CC_BY" | "CC_BY_NC" | "CC_BY_NC_ND" | "CC_BY_NC_SA" | "CC_BY_ND" | "CC_BY_SA" | "PDM" | Constants.LICENSE_COPYRIGHT_LAW | Constants.LICENSE_SCHULFUNK | Constants.LICENSE_UNTERRICHTS_UND_SCHULMEDIEN:
case "CC_0" | "CC_BY" | "CC_BY_NC" | "CC_BY_NC_ND" | "CC_BY_NC_SA" | "CC_BY_ND" | "CC_BY_SA" | "PDM" | Constants.LICENSE_COPYRIGHT_FREE | Constants.LICENSE_COPYRIGHT_LAW | Constants.LICENSE_SCHULFUNK | Constants.LICENSE_UNTERRICHTS_UND_SCHULMEDIEN:
spaces["ccm:commonlicense_key"] = license["internal"]
case Constants.LICENSE_CUSTOM:
spaces["ccm:commonlicense_key"] = "CUSTOM"
Expand Down
1 change: 1 addition & 0 deletions converter/util/test_license_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def test_get_license_url(self, test_input, expected_result):
[
("Copyright Zweites Deutsches Fernsehen, ZDF", Constants.LICENSE_COPYRIGHT_LAW),
(" © ", Constants.LICENSE_COPYRIGHT_LAW),
# ToDo: find valid test-cases for LICENSE.COPYRIGHT_FREE
# ToDo: regularly check if new enums for the 'internal' field need to be added here or in Constants.py
("jemand erwähnt CC0 in einem Freitext", "CC_0"),
("CC-0", "CC_0"),
Expand Down

0 comments on commit 14295c8

Please sign in to comment.