Use worker pool extensively
This commit is contained in:
29
internal/torrent/latestState.go
Normal file
29
internal/torrent/latestState.go
Normal file
@@ -0,0 +1,29 @@
|
||||
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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user