Refactor: Eliminate duplicate types - Use handler types directly

- Deleted templates.CollectionDetailData - using templates.CollectionData everywhere
- Deleted templates.BookData - using handlers.BookInfo everywhere
- Deleted templates.DeviceData - using handlers.DeviceInfo everywhere
- Deleted templates.ProgressItemData - using handlers.ProgressWithMedia everywhere
- Deleted templates.convertDevices() helper - Use handlers types directly in templates
- Enhanced handlers.ProgressWithMedia with device metadata fields
- Added handlers.getDeviceIcon() helper
- Updated all templates to import handlers package
- Cleaned up unused imports

This aligns codebase with templ's design philosophy (use Go types directly, no parallel type system)
This commit is contained in:
2026-02-12 19:48:07 -05:00
parent b5745e1554
commit 2a64ca423f
15 changed files with 639 additions and 168 deletions
-41
View File
@@ -23,21 +23,6 @@ type CollectionData struct {
Icon string
}
type CollectionDetailData struct {
ID string
Name string
Description string
Color string
Icon string
}
type BookData struct {
MediaItemID string
Title string
Author string
CoverImagePath string
}
type LibraryData struct {
ID string
Name string
@@ -45,17 +30,6 @@ type LibraryData struct {
TypeName string
}
type DeviceData struct {
ID string
DeviceName string
DeviceType string
SyncEnabled bool
AutoSync bool
SyncFrequency int32
LastSync string
LastSeen string
}
type PendingRegistrationData struct {
RegistrationID string
DeviceName string
@@ -96,21 +70,6 @@ type DeviceShelfMappingData struct {
CreatedAt string
}
type ProgressItemData struct {
MediaItemID string
Title string
Author string
CoverImagePath string
CurrentPage int32
TotalPages int32
ProgressPercentage float64
LastUpdated string
DeviceName string
DeviceType string
DeviceIcon string
EpubCFI string
}
type UnlinkedBookData struct {
ProgressID string
DeviceID string