This commit is contained in:
2026-07-31 10:23:23 +02:00
parent ad0d676853
commit 9daf7e7e3d
7 changed files with 126 additions and 3 deletions
+24
View File
@@ -29,6 +29,11 @@
(define (didl-lite-audio-item uri
#:protocol-info protocol-info
#:title [title "Media"]
#:artist [artist #f]
#:album [album #f]
#:genre [genre #f]
#:year [year #f]
#:track [track #f]
#:duration [duration #f]
#:size [size #f]
#:id [id "0"]
@@ -38,6 +43,18 @@
(check-string 'didl-lite-audio-item title)
(check-string 'didl-lite-audio-item id)
(check-string 'didl-lite-audio-item parent-id)
(for ([value (in-list (list artist album genre))])
(unless (or (not value) (string? value))
(raise-argument-error
'didl-lite-audio-item
"(or/c #f string?)"
value)))
(for ([value (in-list (list year track))])
(unless (or (not value) (exact-nonnegative-integer? value))
(raise-argument-error
'didl-lite-audio-item
"(or/c #f exact-nonnegative-integer?)"
value)))
(unless (or (not size)
(exact-nonnegative-integer? size))
(raise-argument-error
@@ -55,6 +72,13 @@
(restricted "1"))
(dc:title () ,title)
(upnp:class () "object.item.audioItem.musicTrack")
,@(if artist `((upnp:artist () ,artist)) '())
,@(if album `((upnp:album () ,album)) '())
,@(if genre `((upnp:genre () ,genre)) '())
,@(if year `((dc:date () ,(number->string year))) '())
,@(if track
`((upnp:originalTrackNumber () ,(number->string track)))
'())
(res
((protocolInfo ,protocol-info)
,@(if duration