Files
zurg/internal/torrent/latestState.go
2023-11-30 00:40:26 +01:00

30 lines
610 B
Go

package torrent
import (
"time"
"github.com/debridmediamanager/zurg/pkg/realdebrid"
)
type LibraryState struct {
TotalCount int
FirstTorrent *realdebrid.Torrent
DownloadingCount int
}
func (ls LibraryState) equal(a LibraryState) bool {
return a.TotalCount == ls.TotalCount && a.FirstTorrent.ID == ls.FirstTorrent.ID && a.DownloadingCount == ls.DownloadingCount
}
func EmptyState() LibraryState {
oldestTime := time.Time{}
return LibraryState{
TotalCount: 0,
FirstTorrent: &realdebrid.Torrent{
ID: "",
Added: oldestTime.Format(time.RFC3339),
},
DownloadingCount: 0,
}
}