본문으로 이동

모듈:PD-US-music

위키문헌, 우리 모두의 도서관.
모듈 설명문서[보기] [편집] [역사] [새로 고침]

{{PD-US-music}}을 생성합니다.

--[=[
Implements [[Template:PD-US-music]]
]=]

require('strict')

local p = {} --p stands for package

local getArgs = require('Module:Arguments').getArgs
local PD = require('Module:PD')

function p._PD_US_music(args)
	local deathyear = PD.getAuthorDeathYear({args[1], args['사망연도'], args.deathyear})
	
	-- Pre-1923 recordings are PD
	-- 1923–1946 recordings are PD after 100 years: 2024–2047
	-- 1947–1956 recordings are PD after 110 years: 2058–2067
	-- Post-1956 recordings are PD on February 15, 2067
	local cutoff
	if PD.currentyear > 2067 or (PD.currentyear == 2067 and PD.currentmonth > 2) or (PD.currentyear == 2067 and PD.currentmonth == 2 and PD.currentday >= 15) then
		cutoff = ""
	else
		local maxyear
		if PD.currentyear < 2024 then
			maxyear = 1923
		elseif PD.currentyear < 2048 then
			maxyear = PD.currentyear - 100
		elseif PD.currentyear < 2058 then
			maxyear = 1947
		else
			maxyear = PD.currentyear - 110
		end
		cutoff = maxyear .. "년 전에 공표된"
	end
	
	local text = PD.license_scope() .. " 미국 클래식 보호 및 접근법([https://www.law.cornell.edu/uscode/text/17/1401 17 U.S.C. § 1401])에 따라, 1972년 2월 15일 전에 녹음되었고 " .. cutoff .. " 소리의 녹음본이므로 '''미국'''에서 '''[[위키문헌:퍼블릭 도메인|퍼블릭 도메인]]'''입니다." .. PD.shorter_term_text(deathyear)
	
	return PD.license({
		['image'] = PD.PD_image,
		['image_r'] = PD.US_flag_image,
		['text'] = text,
		['category'] = args['분류'] or args.category or "PD-US-music"
	})
end

function p.PD_US_music(frame)
	return p._PD_US_music(getArgs(frame))
end

return p