node build fixed
This commit is contained in:
34
seanime-2.9.10/internal/torrentstream/history.go
Normal file
34
seanime-2.9.10/internal/torrentstream/history.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package torrentstream
|
||||
|
||||
import (
|
||||
"seanime/internal/database/db_bridge"
|
||||
hibiketorrent "seanime/internal/extension/hibike/torrent"
|
||||
"seanime/internal/util"
|
||||
)
|
||||
|
||||
type BatchHistoryResponse struct {
|
||||
Torrent *hibiketorrent.AnimeTorrent `json:"torrent"`
|
||||
}
|
||||
|
||||
func (r *Repository) GetBatchHistory(mId int) (ret *BatchHistoryResponse) {
|
||||
defer util.HandlePanicInModuleThen("torrentstream/GetBatchHistory", func() {
|
||||
ret = &BatchHistoryResponse{}
|
||||
})
|
||||
|
||||
torrent, err := db_bridge.GetTorrentstreamHistory(r.db, mId)
|
||||
if err != nil {
|
||||
return &BatchHistoryResponse{}
|
||||
}
|
||||
|
||||
return &BatchHistoryResponse{
|
||||
torrent,
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Repository) AddBatchHistory(mId int, torrent *hibiketorrent.AnimeTorrent) {
|
||||
go func() {
|
||||
defer util.HandlePanicInModuleThen("torrentstream/AddBatchHistory", func() {})
|
||||
|
||||
_ = db_bridge.InsertTorrentstreamHistory(r.db, mId, torrent)
|
||||
}()
|
||||
}
|
||||
Reference in New Issue
Block a user