1
0
mirror of https://github.com/varbhat/exatorrent.git synced 2021-09-19 22:57:02 +03:00

Updated go.mod

Use NewFileOpts
Increment Version
Fix Title Change in Web Client
This commit is contained in:
Var Bhat
2021-09-02 17:08:32 +05:30
parent 5c8eca0619
commit dd1d9a0f17
9 changed files with 36 additions and 9 deletions

2
go.mod
View File

@@ -6,7 +6,7 @@ require (
crawshaw.io/sqlite v0.3.3-0.20210127221821-98b1f83c5508
github.com/anacrolix/go-libutp v1.0.4
github.com/anacrolix/log v0.9.0
github.com/anacrolix/torrent v1.30.4
github.com/anacrolix/torrent v1.31.0
github.com/google/uuid v1.3.0
github.com/gorilla/websocket v1.4.2
github.com/jackc/pgx/v4 v4.13.0

2
go.sum
View File

@@ -153,6 +153,8 @@ github.com/anacrolix/torrent v1.28.1-0.20210622065255-582f0ccd48a0/go.mod h1:15V
github.com/anacrolix/torrent v1.29.0/go.mod h1:40Hf2bWxFqTbTWbrdig57JnmYLCjShbWWjdbB3VN5n4=
github.com/anacrolix/torrent v1.30.4 h1:xZXQo1kL7NqRN/wY2OumUrGM4ekq9dyMFdKtF293gPU=
github.com/anacrolix/torrent v1.30.4/go.mod h1:IUGa0cjbz4vo2S0jNx2RQXAiCew+WITcUoxaw2gF20o=
github.com/anacrolix/torrent v1.31.0 h1:G/vERyt+9oiJz6Ehpd+KqFIKh22/qfeUeWCwCVRGJKI=
github.com/anacrolix/torrent v1.31.0/go.mod h1:IUGa0cjbz4vo2S0jNx2RQXAiCew+WITcUoxaw2gF20o=
github.com/anacrolix/upnp v0.1.1/go.mod h1:LXsbsp5h+WGN7YR+0A7iVXm5BL1LYryDev1zuJMWYQo=
github.com/anacrolix/upnp v0.1.2-0.20200416075019-5e9378ed1425 h1:/Wi6l2ONI1FUFWN4cBwHOO90V4ylp4ud/eov6GUcVFk=
github.com/anacrolix/upnp v0.1.2-0.20200416075019-5e9378ed1425/go.mod h1:Pz94W3kl8rf+wxH3IbCa9Sq+DTJr8OSbV2Q3/y51vYs=

View File

@@ -248,9 +248,11 @@ func Initialize() {
}
}
tc.DefaultStorage = storage.NewFileWithCustomPathMakerAndCompletion(Dirconfig.TrntDir, func(baseDir string, info *metainfo.Info, infoHash metainfo.Hash) string {
stor := storage.NewFileOpts(storage.NewFileClientOpts{ClientBaseDir: Dirconfig.TrntDir, FilePathMaker: nil, TorrentDirMaker: func(baseDir string, info *metainfo.Info, infoHash metainfo.Hash) string {
return filepath.Join(baseDir, infoHash.HexString())
}, Engine.PcDb)
}, PieceCompletion: Engine.PcDb})
tc.DefaultStorage = stor
Engine.Torc, err = torrent.NewClient(tc)
if err != nil {
@@ -265,6 +267,7 @@ func Initialize() {
Warn.Println(err)
}
}()
var stoperr error
stopsignal := make(chan os.Signal, 5)
signal.Notify(stopsignal, os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
sig := <-stopsignal
@@ -274,9 +277,15 @@ func Initialize() {
Engine.TorDb.Close()
Engine.TrackerDB.Close()
Engine.TUDb.Close()
_ = Engine.PcDb.Close() // Close PcDb at the end
// Stop The Engine
Engine.Torc.Close()
stoperr = Engine.PcDb.Close() // Close PcDb at the end
if stoperr != nil {
Warn.Println("Error Closing PieceCompletion DB ", stoperr)
}
Engine.Torc.Close() // Close the Torrent Client
stoperr = stor.Close() // Close the storage.ClientImplCloser
if stoperr != nil {
Warn.Println("Error Closing Default Storage ", stoperr)
}
os.Exit(1)
}()

View File

@@ -36,7 +36,7 @@ var (
DataDir string
TrntDir string
}{}
Configmu sync.Mutex //TODO
Configmu sync.Mutex
)
type TorConfig struct {

View File

@@ -1,3 +1,3 @@
package core
const Version string = "v0.0.1"
const Version string = "v0.0.2"

View File

@@ -1,7 +1,16 @@
<script lang="ts">
import { onDestroy } from 'svelte';
import { SignOut, Connect } from './core';
onDestroy(() => {
document.title = 'exatorrent';
});
</script>
<svelte:head>
<title>exatorrent - Disconnected</title>
</svelte:head>
<div class="mx-auto max-w-xl">
<div class="flex justify-center p-10">
<svg xmlns="http://www.w3.org/2000/svg" class="h-11 w-11 text-red-600 animate-bounce" fill="none" viewBox="0 0 24 24" stroke="currentColor">

View File

@@ -21,9 +21,14 @@
onDestroy(() => {
filepagediscon.set(false);
document.title = 'exatorrent';
});
</script>
<svelte:head>
<title>{$fsfileinfo?.name}</title>
</svelte:head>
<div class="mx-auto max-w-xl">
<div class="flex justify-between h-16">
<button

View File

@@ -116,7 +116,8 @@
<div class="flex flex-col">
{#if devicestatsOpen === true}
<div class="m-1 p-1 break-all">CPU Cycles: {$machstats?.cpucycles}</div>
<div class="m-1 p-1 break-all">Disk Free: {$machstats?.diskfree}</div>
<div class="m-1 p-1 break-all">Disk Free: {fileSize($machstats?.diskfree)}</div>
<div class="m-1 p-1 break-all">Disk Free(Bytes): {$machstats?.diskfree}</div>
<div class="m-1 p-1 break-all">Disk Percent: {$machstats?.diskpercent} %</div>
<div class="m-1 p-1 break-all">Memory Percent: {$machstats?.mempercent} %</div>
<div class="m-1 p-1 break-all">Go Mem: {fileSize($machstats?.gomem)}</div>

View File

@@ -15,6 +15,7 @@
onDestroy(() => {
Send({ command: 'stopstream' });
document.title = 'exatorrent';
});
let infohash = $slocation.pathname?.split('/').reverse()[0];