mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -73,6 +73,7 @@ func GetTorrent(hashHex string) *Torrent {
|
||||
if tr != nil {
|
||||
tr.Title = tor.Title
|
||||
tr.Poster = tor.Poster
|
||||
tr.Data = tor.Data
|
||||
tr.Size = tor.Size
|
||||
tr.Timestamp = tor.Timestamp
|
||||
tr.GotInfo()
|
||||
@@ -128,6 +129,15 @@ func SetSettings(set *sets.BTSets) {
|
||||
bts.Connect()
|
||||
}
|
||||
|
||||
func SetDefSettings() {
|
||||
if sets.ReadOnly {
|
||||
return
|
||||
}
|
||||
bts.Disconnect()
|
||||
sets.SetDefault()
|
||||
bts.Connect()
|
||||
}
|
||||
|
||||
func Shutdown() {
|
||||
bts.Disconnect()
|
||||
sets.CloseDB()
|
||||
|
||||
@@ -46,20 +46,6 @@ func (t *Torrent) Stream(fileID int, req *http.Request, resp http.ResponseWriter
|
||||
|
||||
reader := t.NewReader(file)
|
||||
|
||||
//off := int64(0)
|
||||
//buf := make([]byte, 32*1024)
|
||||
//for true {
|
||||
// n, err := reader.Read(buf)
|
||||
// if err != nil {
|
||||
// fmt.Println("error read", err)
|
||||
// break
|
||||
// }
|
||||
// off = off + int64(n)
|
||||
// if off%(200*1024*1024) == 0 {
|
||||
// time.Sleep(time.Second * 15)
|
||||
// }
|
||||
//}
|
||||
|
||||
log.Println("Connect client")
|
||||
|
||||
sets.SetViewed(&sets.Viewed{t.Hash().HexString(), fileID})
|
||||
|
||||
Reference in New Issue
Block a user