Files
racket-upnp/scribblings/didl-lite.scrbl
T
2026-07-31 10:23:23 +02:00

53 lines
1.6 KiB
Racket

#lang scribble/manual
@(require
(for-label
racket/base
(file "../didl-lite.rkt")))
@title{DIDL-Lite Metadata}
@defmodule[(file "../didl-lite.rkt")]
DIDL-Lite describes the resource passed to a renderer. Some renderers only
advertise seeking after the current URI has metadata containing its media
type, duration, and byte-range capability.
@defproc[(didl-lite-audio-item
[uri string?]
[#:protocol-info protocol-info string?]
[#:title title string? "Media"]
[#:artist artist (or/c #f string?) #f]
[#:album album (or/c #f string?) #f]
[#:genre genre (or/c #f string?) #f]
[#:year year (or/c #f exact-nonnegative-integer?) #f]
[#:track track (or/c #f exact-nonnegative-integer?) #f]
[#:duration duration (or/c #f nonnegative-real?) #f]
[#:size size (or/c #f exact-nonnegative-integer?) #f]
[#:id id string? "0"]
[#:parent-id parent-id string? "0"])
string?]{
Returns an XML DIDL-Lite audio-item description. Text and attribute values
are XML-escaped automatically.
The @racket[protocol-info] value must describe the HTTP resource accurately.
For example:
@racketblock[
(didl-lite-audio-item
"http://10.7.3.118:8080/media/test.flac"
#:protocol-info
"http-get:*:audio/flac:DLNA.ORG_OP=01;DLNA.ORG_CI=0"
#:title "Test track"
#:artist "Test artist"
#:album "Test album"
#:duration 639
#:size 50357462)
]
Use @racket[media-file-server-didl-lite] when the URI was published with this
package; it fills in the protocol information and file size from the actual
publication.
}