Download all 20 track MP3s from Jellyfin and store them as page bundle resources (track.mp3). Update templates to use .Resources.GetMatch instead of .Params.audio, removing external API key dependencies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
642 B
JSON
23 lines
642 B
JSON
{{- $tracks := slice -}}
|
|
{{- range .Pages -}}
|
|
{{- $audio := "" -}}
|
|
{{- with .Resources.GetMatch "track.*" -}}
|
|
{{- $audio = .RelPermalink -}}
|
|
{{- end -}}
|
|
{{- $track := dict
|
|
"title" .Title
|
|
"url" .Permalink
|
|
"slug" .File.ContentBaseName
|
|
"audio" $audio
|
|
"duration" .Params.duration
|
|
"genre" .Params.genre
|
|
"image" ""
|
|
-}}
|
|
{{- with .Resources.GetMatch "cover.*" -}}
|
|
{{- $img := .Resize "200x webp q85" -}}
|
|
{{- $track = merge $track (dict "image" $img.RelPermalink) -}}
|
|
{{- end -}}
|
|
{{- $tracks = $tracks | append $track -}}
|
|
{{- end -}}
|
|
{{- dict "tracks" $tracks | jsonify (dict "indent" " ") -}}
|