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:
		
							
								
								
									
										2
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.mod
									
									
									
									
									
								
							| @@ -6,7 +6,7 @@ require ( | |||||||
| 	crawshaw.io/sqlite v0.3.3-0.20210127221821-98b1f83c5508 | 	crawshaw.io/sqlite v0.3.3-0.20210127221821-98b1f83c5508 | ||||||
| 	github.com/anacrolix/go-libutp v1.0.4 | 	github.com/anacrolix/go-libutp v1.0.4 | ||||||
| 	github.com/anacrolix/log v0.9.0 | 	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/google/uuid v1.3.0 | ||||||
| 	github.com/gorilla/websocket v1.4.2 | 	github.com/gorilla/websocket v1.4.2 | ||||||
| 	github.com/jackc/pgx/v4 v4.13.0 | 	github.com/jackc/pgx/v4 v4.13.0 | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.sum
									
									
									
									
									
								
							| @@ -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.29.0/go.mod h1:40Hf2bWxFqTbTWbrdig57JnmYLCjShbWWjdbB3VN5n4= | ||||||
| github.com/anacrolix/torrent v1.30.4 h1:xZXQo1kL7NqRN/wY2OumUrGM4ekq9dyMFdKtF293gPU= | 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.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.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 h1:/Wi6l2ONI1FUFWN4cBwHOO90V4ylp4ud/eov6GUcVFk= | ||||||
| github.com/anacrolix/upnp v0.1.2-0.20200416075019-5e9378ed1425/go.mod h1:Pz94W3kl8rf+wxH3IbCa9Sq+DTJr8OSbV2Q3/y51vYs= | github.com/anacrolix/upnp v0.1.2-0.20200416075019-5e9378ed1425/go.mod h1:Pz94W3kl8rf+wxH3IbCa9Sq+DTJr8OSbV2Q3/y51vYs= | ||||||
|   | |||||||
| @@ -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()) | 		return filepath.Join(baseDir, infoHash.HexString()) | ||||||
| 	}, Engine.PcDb) | 	}, PieceCompletion: Engine.PcDb}) | ||||||
|  |  | ||||||
|  | 	tc.DefaultStorage = stor | ||||||
|  |  | ||||||
| 	Engine.Torc, err = torrent.NewClient(tc) | 	Engine.Torc, err = torrent.NewClient(tc) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| @@ -265,6 +267,7 @@ func Initialize() { | |||||||
| 				Warn.Println(err) | 				Warn.Println(err) | ||||||
| 			} | 			} | ||||||
| 		}() | 		}() | ||||||
|  | 		var stoperr error | ||||||
| 		stopsignal := make(chan os.Signal, 5) | 		stopsignal := make(chan os.Signal, 5) | ||||||
| 		signal.Notify(stopsignal, os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT) | 		signal.Notify(stopsignal, os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT) | ||||||
| 		sig := <-stopsignal | 		sig := <-stopsignal | ||||||
| @@ -274,9 +277,15 @@ func Initialize() { | |||||||
| 		Engine.TorDb.Close() | 		Engine.TorDb.Close() | ||||||
| 		Engine.TrackerDB.Close() | 		Engine.TrackerDB.Close() | ||||||
| 		Engine.TUDb.Close() | 		Engine.TUDb.Close() | ||||||
| 		_ = Engine.PcDb.Close() // Close PcDb at the end | 		stoperr = Engine.PcDb.Close() // Close PcDb at the end | ||||||
| 		// Stop The Engine | 		if stoperr != nil { | ||||||
| 		Engine.Torc.Close() | 			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) | 		os.Exit(1) | ||||||
| 	}() | 	}() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -36,7 +36,7 @@ var ( | |||||||
| 		DataDir   string | 		DataDir   string | ||||||
| 		TrntDir   string | 		TrntDir   string | ||||||
| 	}{} | 	}{} | ||||||
| 	Configmu sync.Mutex //TODO | 	Configmu sync.Mutex | ||||||
| ) | ) | ||||||
|  |  | ||||||
| type TorConfig struct { | type TorConfig struct { | ||||||
|   | |||||||
| @@ -1,3 +1,3 @@ | |||||||
| package core | package core | ||||||
|  |  | ||||||
| const Version string = "v0.0.1" | const Version string = "v0.0.2" | ||||||
|   | |||||||
| @@ -1,7 +1,16 @@ | |||||||
| <script lang="ts"> | <script lang="ts"> | ||||||
|  |   import { onDestroy } from 'svelte'; | ||||||
|   import { SignOut, Connect } from './core'; |   import { SignOut, Connect } from './core'; | ||||||
|  |  | ||||||
|  |   onDestroy(() => { | ||||||
|  |     document.title = 'exatorrent'; | ||||||
|  |   }); | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | <svelte:head> | ||||||
|  |   <title>exatorrent - Disconnected</title> | ||||||
|  | </svelte:head> | ||||||
|  |  | ||||||
| <div class="mx-auto max-w-xl"> | <div class="mx-auto max-w-xl"> | ||||||
|   <div class="flex justify-center p-10"> |   <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"> |     <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"> | ||||||
|   | |||||||
| @@ -21,9 +21,14 @@ | |||||||
|  |  | ||||||
|   onDestroy(() => { |   onDestroy(() => { | ||||||
|     filepagediscon.set(false); |     filepagediscon.set(false); | ||||||
|  |     document.title = 'exatorrent'; | ||||||
|   }); |   }); | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | <svelte:head> | ||||||
|  |   <title>{$fsfileinfo?.name}</title> | ||||||
|  | </svelte:head> | ||||||
|  |  | ||||||
| <div class="mx-auto max-w-xl"> | <div class="mx-auto max-w-xl"> | ||||||
|   <div class="flex justify-between h-16"> |   <div class="flex justify-between h-16"> | ||||||
|     <button |     <button | ||||||
|   | |||||||
| @@ -116,7 +116,8 @@ | |||||||
|     <div class="flex flex-col"> |     <div class="flex flex-col"> | ||||||
|       {#if devicestatsOpen === true} |       {#if devicestatsOpen === true} | ||||||
|         <div class="m-1 p-1 break-all">CPU Cycles: {$machstats?.cpucycles}</div> |         <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">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">Memory Percent: {$machstats?.mempercent} %</div> | ||||||
|         <div class="m-1 p-1 break-all">Go Mem: {fileSize($machstats?.gomem)}</div> |         <div class="m-1 p-1 break-all">Go Mem: {fileSize($machstats?.gomem)}</div> | ||||||
|   | |||||||
| @@ -15,6 +15,7 @@ | |||||||
|  |  | ||||||
|   onDestroy(() => { |   onDestroy(() => { | ||||||
|     Send({ command: 'stopstream' }); |     Send({ command: 'stopstream' }); | ||||||
|  |     document.title = 'exatorrent'; | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   let infohash = $slocation.pathname?.split('/').reverse()[0]; |   let infohash = $slocation.pathname?.split('/').reverse()[0]; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Var Bhat
					Var Bhat