Add poster image support to Matrix download listings
Some checks failed
Test action / kaas (push) Failing after 2s
Some checks failed
Test action / kaas (push) Failing after 2s
- Fetch and display poster images for tracked items in Matrix - Show monitored/unmonitored icons in listings - Limit displayed items to 12, with count and overflow message - Add tests for image fetching and formatting - Enable Grafana datasources - Fix Sonarr/Radarr URL config bug
This commit is contained in:
parent
e07257e137
commit
100a218aed
9 changed files with 432 additions and 59 deletions
44
packages/arrtrix/pkg/matrixcmd/download_test.go
Normal file
44
packages/arrtrix/pkg/matrixcmd/download_test.go
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
package matrixcmd
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"sneeuwvlok/packages/arrtrix/pkg/arrclient"
|
||||
)
|
||||
|
||||
func TestFormatDownloadListFallbackCardUsesMonitoredIcon(t *testing.T) {
|
||||
item := arrclient.ManagedItem{
|
||||
ID: 1,
|
||||
Title: "Severance",
|
||||
Year: 2022,
|
||||
Monitored: true,
|
||||
}
|
||||
|
||||
fallback := formatDownloadListFallbackCard(item)
|
||||
if fallback != "👁 Severance (2022)" {
|
||||
t.Fatalf("unexpected monitored fallback %q", fallback)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFormatDownloadListFallbackCardUsesUnmonitoredIcon(t *testing.T) {
|
||||
item := arrclient.ManagedItem{
|
||||
ID: 7,
|
||||
Title: "Andor",
|
||||
Year: 2022,
|
||||
Monitored: false,
|
||||
}
|
||||
|
||||
fallback := formatDownloadListFallbackCard(item)
|
||||
if fallback != "🚫 Andor (2022)" {
|
||||
t.Fatalf("unexpected unmonitored fallback %q", fallback)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMonitoredIcon(t *testing.T) {
|
||||
if monitoredIcon(true) != "👁" {
|
||||
t.Fatalf("expected monitored icon, got %q", monitoredIcon(true))
|
||||
}
|
||||
if monitoredIcon(false) != "🚫" {
|
||||
t.Fatalf("expected unmonitored icon, got %q", monitoredIcon(false))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue