diff --git a/server/cmd/main.go b/server/cmd/main.go index de434cf..7e7a845 100644 --- a/server/cmd/main.go +++ b/server/cmd/main.go @@ -146,7 +146,7 @@ func watchTDir(dir string) { if strings.ToLower(filepath.Ext(file.Name())) == ".torrent" { sp, err := openFile(filename) if err == nil { - tor, err := torr.AddTorrent(sp, "", "", "") + tor, err := torr.AddTorrent(sp, "", "", "", "") if err == nil { if tor.GotInfo() { if tor.Title == "" { diff --git a/server/go.sum b/server/go.sum index 2173d83..ec3752e 100644 --- a/server/go.sum +++ b/server/go.sum @@ -2,7 +2,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797/go.mod h1:sXBiorCo8c46JlQV3oXPKINnZ8mcqnye1EkVkqsectk= crawshaw.io/sqlite v0.3.2/go.mod h1:igAO5JulrQ1DbdZdtVq48mnZUBAPOeFzer7VhDWNtW4= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= @@ -15,10 +14,8 @@ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWX github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= -github.com/alecthomas/assert/v2 v2.0.0-alpha3 h1:pcHeMvQ3OMstAWgaeaXIAL8uzB9xMm2zlxt+/4ml8lk= github.com/alecthomas/atomic v0.1.0-alpha2 h1:dqwXmax66gXvHhsOS4pGPZKqYOlTkapELkLb3MNdlH8= github.com/alecthomas/atomic v0.1.0-alpha2/go.mod h1:zD6QGEyw49HIq19caJDc2NMXAy8rNi9ROrxtMXATfyI= -github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142 h1:8Uy0oSf5co/NZXje7U1z8Mpep++QJOldL2hs/sBQf48= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -37,7 +34,6 @@ github.com/anacrolix/dms v1.6.0/go.mod h1:5fAMpBcPFG4WQFh91zhf2E7/KYZ3/WmmRAf/WM github.com/anacrolix/envpprof v0.0.0-20180404065416-323002cec2fa/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c= github.com/anacrolix/envpprof v1.0.0/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c= github.com/anacrolix/envpprof v1.1.0/go.mod h1:My7T5oSqVfEn4MD4Meczkw/f5lSIndGAKu/0SM/rkf4= -github.com/anacrolix/envpprof v1.3.0 h1:WJt9bpuT7A/CDCxPOv/eeZqHWlle/Y0keJUvc6tcJDk= github.com/anacrolix/ffprobe v1.0.0/go.mod h1:BIw+Bjol6CWjm/CRWrVLk2Vy+UYlkgmBZ05vpSYqZPw= github.com/anacrolix/ffprobe v1.1.0 h1:eKBudnERW9zRJ0+ge6FzkQ0pWLyq142+FJrwRwSRMT4= github.com/anacrolix/ffprobe v1.1.0/go.mod h1:MXe+zG/RRa5OdIf5+VYYfS/CfsSqOH7RrvGIqJBzqhI= @@ -79,7 +75,6 @@ github.com/anacrolix/upnp v0.1.3/go.mod h1:Qyhbqo69gwNWvEk1xNTXsS5j7hMHef9hdr984 github.com/anacrolix/utp v0.2.0 h1:65Cdmr6q9WSw2KsM+rtJFu7rqDzLl2bdysf4KlNPcFI= github.com/anacrolix/utp v0.2.0/go.mod h1:HGk4GYQw1O/3T1+yhqT/F6EcBd+AAwlo9dYErNy7mj8= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/benbjohnson/immutable v0.2.0/go.mod h1:uc6OHo6PN2++n98KHLxW8ef4W42ylHiQSENghE1ezxI= github.com/benbjohnson/immutable v0.4.3 h1:GYHcksoJ9K6HyAUpGxwZURrbTkXA0Dh4otXGqbhdrjA= @@ -111,7 +106,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -124,14 +118,12 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/gin-contrib/cors v1.4.0 h1:oJ6gwtUl3lqV0WEIwM/LxPF1QZ5qe2lGWdY2+bz7y0g= github.com/gin-contrib/cors v1.4.0/go.mod h1:bs9pNM0x/UsmHPBWT2xZz9ROh8xYjYkiURUfmBoMlcs= -github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= github.com/gin-contrib/location v0.0.2 h1:QZKh1+K/LLR4KG/61eIO3b7MLuKi8tytQhV6texLgP4= github.com/gin-contrib/location v0.0.2/go.mod h1:NGoidiRlf0BlA/VKSVp+g3cuSMeTmip/63PhEjRhUAc= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -166,7 +158,6 @@ github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+ github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -210,7 +201,6 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -220,7 +210,6 @@ github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORR github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= @@ -248,11 +237,9 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= @@ -297,7 +284,6 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -318,7 +304,6 @@ github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4 github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/dnscache v0.0.0-20230804202142-fc85eb664529 h1:18kd+8ZUlt/ARXhljq+14TwAoKa61q6dX8jtwOf6DH8= github.com/rs/dnscache v0.0.0-20230804202142-fc85eb664529/go.mod h1:qe5TWALJ8/a1Lqznoc5BDHpYX/8HU60Hm2AwRmqzxqA= @@ -344,7 +329,6 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= @@ -355,7 +339,7 @@ github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg0 github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tsynik/torrent v1.2.11 h1:viD8HWicqyCCEyHVTM10UILmbvG1v+eZroPqFaLEbbY= +github.com/tsynik/torrent v1.2.11 h1:wPJfxhO/ri10T1Xfi4X8DftwOF3A8geZ4cRQWKxnC2s= github.com/tsynik/torrent v1.2.11/go.mod h1:AjuETm1Xae+Vk31UrvrSrb29bBunwMKGZLXK6T+AgPo= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= @@ -397,7 +381,6 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -506,7 +489,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -518,7 +500,6 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/server/settings/torrent.go b/server/settings/torrent.go index 40361cb..d539c40 100644 --- a/server/settings/torrent.go +++ b/server/settings/torrent.go @@ -12,9 +12,10 @@ import ( type TorrentDB struct { *torrent.TorrentSpec - Title string `json:"title,omitempty"` - Poster string `json:"poster,omitempty"` - Data string `json:"data,omitempty"` + Title string `json:"title,omitempty"` + Category string `json:"category,omitempty"` + Poster string `json:"poster,omitempty"` + Data string `json:"data,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` Size int64 `json:"size,omitempty"` diff --git a/server/torr/apihelper.go b/server/torr/apihelper.go index 1384ec0..3a005d7 100644 --- a/server/torr/apihelper.go +++ b/server/torr/apihelper.go @@ -37,7 +37,7 @@ func LoadTorrent(tor *Torrent) *Torrent { return tr } -func AddTorrent(spec *torrent.TorrentSpec, title, poster string, data string) (*Torrent, error) { +func AddTorrent(spec *torrent.TorrentSpec, title, poster string, data string, category string) (*Torrent, error) { torr, err := NewTorrent(spec, bts) if err != nil { log.TLogln("error add torrent:", err) @@ -55,6 +55,17 @@ func AddTorrent(spec *torrent.TorrentSpec, title, poster string, data string) (* torr.Title = torr.Info().Name } } + + // Category can be override + torr.Category = category + if torr.Category == "" { + if torDB != nil { + torr.Category = torDB.Category + } else { + torr.Category = "Unknown" + } + } + if torr.Poster == "" { torr.Poster = poster if torr.Poster == "" && torDB != nil { diff --git a/server/torr/dbwrapper.go b/server/torr/dbwrapper.go index 4aca82f..2c01db4 100644 --- a/server/torr/dbwrapper.go +++ b/server/torr/dbwrapper.go @@ -22,6 +22,7 @@ func AddTorrentDB(torr *Torrent) { t := new(settings.TorrentDB) t.TorrentSpec = torr.TorrentSpec t.Title = torr.Title + t.Category = torr.Category if torr.Data == "" { files := new(tsFiles) files.TorrServer.Files = torr.Status().FileStats diff --git a/server/torr/state/state.go b/server/torr/state/state.go index 39a96e2..e46ee6c 100644 --- a/server/torr/state/state.go +++ b/server/torr/state/state.go @@ -32,6 +32,7 @@ const ( type TorrentStatus struct { Title string `json:"title"` + Category string `json:"category"` Poster string `json:"poster"` Data string `json:"data,omitempty"` Timestamp int64 `json:"timestamp"` diff --git a/server/torr/torrent.go b/server/torr/torrent.go index 694602e..d28fa76 100644 --- a/server/torr/torrent.go +++ b/server/torr/torrent.go @@ -18,9 +18,10 @@ import ( ) type Torrent struct { - Title string - Poster string - Data string + Title string + Category string + Poster string + Data string *torrent.TorrentSpec Stat state.TorrentStat @@ -284,6 +285,7 @@ func (t *Torrent) Status() *state.TorrentStatus { st.Stat = t.Stat st.StatString = t.Stat.String() st.Title = t.Title + st.Category = t.Category st.Poster = t.Poster st.Data = t.Data st.Timestamp = t.Timestamp diff --git a/server/web/api/play.go b/server/web/api/play.go index 5a573dc..dae7298 100644 --- a/server/web/api/play.go +++ b/server/web/api/play.go @@ -55,7 +55,7 @@ func play(c *gin.Context) { } if tor.Stat == state.TorrentInDB { - tor, err = torr.AddTorrent(spec, tor.Title, tor.Poster, tor.Data) + tor, err = torr.AddTorrent(spec, tor.Title, tor.Poster, tor.Data, tor.Category) if err != nil { c.AbortWithError(http.StatusInternalServerError, err) return diff --git a/server/web/api/stream.go b/server/web/api/stream.go index c5b46eb..ca5aed6 100644 --- a/server/web/api/stream.go +++ b/server/web/api/stream.go @@ -96,7 +96,7 @@ func stream(c *gin.Context) { data = tor.Data } if tor == nil || tor.Stat == state.TorrentInDB { - tor, err = torr.AddTorrent(spec, title, poster, data) + tor, err = torr.AddTorrent(spec, title, poster, data, tor.Category) if err != nil { c.AbortWithError(http.StatusInternalServerError, err) return @@ -170,6 +170,7 @@ func streamNoAuth(c *gin.Context) { title := c.Query("title") poster := c.Query("poster") data := "" + category := c.Query("category") if link == "" { c.AbortWithError(http.StatusBadRequest, errors.New("link should not be empty")) @@ -194,9 +195,10 @@ func streamNoAuth(c *gin.Context) { title = tor.Title poster = tor.Poster data = tor.Data + category = tor.Category if tor.Stat == state.TorrentInDB { - tor, err = torr.AddTorrent(spec, title, poster, data) + tor, err = torr.AddTorrent(spec, title, poster, data, category) if err != nil { c.AbortWithError(http.StatusInternalServerError, err) return diff --git a/server/web/api/torrents.go b/server/web/api/torrents.go index d94a28a..1559329 100644 --- a/server/web/api/torrents.go +++ b/server/web/api/torrents.go @@ -21,6 +21,7 @@ type torrReqJS struct { Link string `json:"link,omitempty"` Hash string `json:"hash,omitempty"` Title string `json:"title,omitempty"` + Category string `json:"category,omitempty"` Poster string `json:"poster,omitempty"` Data string `json:"data,omitempty"` SaveToDB bool `json:"save_to_db,omitempty"` @@ -90,7 +91,10 @@ func addTorrent(req torrReqJS, c *gin.Context) { return } - tor, err := torr.AddTorrent(torrSpec, req.Title, req.Poster, req.Data) + tor, err := torr.AddTorrent(torrSpec, req.Title, req.Poster, req.Data, req.Category) + + log.TLogln("Final torrent category: ", tor.Category) + if err != nil { log.TLogln("error add torrent:", err) c.AbortWithError(http.StatusInternalServerError, err) diff --git a/server/web/api/upload.go b/server/web/api/upload.go index e0352ca..1a1efa3 100644 --- a/server/web/api/upload.go +++ b/server/web/api/upload.go @@ -20,6 +20,7 @@ import ( // @Param file formData file true "Torrent file to insert" // @Param save formData string false "Save to DB" // @Param title formData string false "Torrent title" +// @Param category formData string false "Torrent category" // @Param poster formData string false "Torrent poster" // @Param data formData string false "Torrent data" // @@ -41,6 +42,10 @@ func torrentUpload(c *gin.Context) { if len(form.Value["title"]) > 0 { title = form.Value["title"][0] } + category := "" + if len(form.Value["category"]) > 0 { + category = form.Value["category"][0] + } poster := "" if len(form.Value["poster"]) > 0 { poster = form.Value["poster"][0] @@ -66,7 +71,7 @@ func torrentUpload(c *gin.Context) { continue } - tor, err = torr.AddTorrent(spec, title, poster, data) + tor, err = torr.AddTorrent(spec, title, poster, data, category) if err != nil { log.TLogln("error upload torrent:", err) continue diff --git a/server/web/pages/template/html.go b/server/web/pages/template/html.go index 3ecfb73..a4b615b 100644 --- a/server/web/pages/template/html.go +++ b/server/web/pages/template/html.go @@ -118,20 +118,20 @@ var Mstile150x150png []byte //go:embed pages/site.webmanifest var Sitewebmanifest []byte -//go:embed pages/static/js/2.56a11991.chunk.js -var Staticjs256a11991chunkjs []byte +//go:embed pages/static/js/2.41a752aa.chunk.js +var Staticjs241a752aachunkjs []byte -//go:embed pages/static/js/2.56a11991.chunk.js.LICENSE.txt -var Staticjs256a11991chunkjsLICENSEtxt []byte +//go:embed pages/static/js/2.41a752aa.chunk.js.LICENSE.txt +var Staticjs241a752aachunkjsLICENSEtxt []byte -//go:embed pages/static/js/2.56a11991.chunk.js.map -var Staticjs256a11991chunkjsmap []byte +//go:embed pages/static/js/2.41a752aa.chunk.js.map +var Staticjs241a752aachunkjsmap []byte -//go:embed pages/static/js/main.5883b760.chunk.js -var Staticjsmain5883b760chunkjs []byte +//go:embed pages/static/js/main.b1d76117.chunk.js +var Staticjsmainb1d76117chunkjs []byte -//go:embed pages/static/js/main.5883b760.chunk.js.map -var Staticjsmain5883b760chunkjsmap []byte +//go:embed pages/static/js/main.b1d76117.chunk.js.map +var Staticjsmainb1d76117chunkjsmap []byte //go:embed pages/static/js/runtime-main.f542387e.js var Staticjsruntimemainf542387ejs []byte diff --git a/server/web/pages/template/pages/asset-manifest.json b/server/web/pages/template/pages/asset-manifest.json index b4d22d4..dae95cc 100644 --- a/server/web/pages/template/pages/asset-manifest.json +++ b/server/web/pages/template/pages/asset-manifest.json @@ -1,17 +1,17 @@ { "files": { - "main.js": "/static/js/main.5883b760.chunk.js", - "main.js.map": "/static/js/main.5883b760.chunk.js.map", + "main.js": "/static/js/main.b1d76117.chunk.js", + "main.js.map": "/static/js/main.b1d76117.chunk.js.map", "runtime-main.js": "/static/js/runtime-main.f542387e.js", "runtime-main.js.map": "/static/js/runtime-main.f542387e.js.map", - "static/js/2.56a11991.chunk.js": "/static/js/2.56a11991.chunk.js", - "static/js/2.56a11991.chunk.js.map": "/static/js/2.56a11991.chunk.js.map", + "static/js/2.41a752aa.chunk.js": "/static/js/2.41a752aa.chunk.js", + "static/js/2.41a752aa.chunk.js.map": "/static/js/2.41a752aa.chunk.js.map", "index.html": "/index.html", - "static/js/2.56a11991.chunk.js.LICENSE.txt": "/static/js/2.56a11991.chunk.js.LICENSE.txt" + "static/js/2.41a752aa.chunk.js.LICENSE.txt": "/static/js/2.41a752aa.chunk.js.LICENSE.txt" }, "entrypoints": [ "static/js/runtime-main.f542387e.js", - "static/js/2.56a11991.chunk.js", - "static/js/main.5883b760.chunk.js" + "static/js/2.41a752aa.chunk.js", + "static/js/main.b1d76117.chunk.js" ] } \ No newline at end of file diff --git a/server/web/pages/template/pages/index.html b/server/web/pages/template/pages/index.html index 7e057d9..77289f0 100644 --- a/server/web/pages/template/pages/index.html +++ b/server/web/pages/template/pages/index.html @@ -1 +1 @@ -TorrServer MatriX
\ No newline at end of file +TorrServer MatriX
\ No newline at end of file diff --git a/server/web/pages/template/route.go b/server/web/pages/template/route.go index 1f77d16..ac40164 100644 --- a/server/web/pages/template/route.go +++ b/server/web/pages/template/route.go @@ -118,7 +118,7 @@ func RouteWebPages(route *gin.RouterGroup) { }) route.GET("/browserconfig.xml", func(c *gin.Context) { - c.Data(200, "application/xml; charset=utf-8", Browserconfigxml) + c.Data(200, "text/xml; charset=utf-8", Browserconfigxml) }) route.GET("/dlnaicon-120.png", func(c *gin.Context) { @@ -161,28 +161,28 @@ func RouteWebPages(route *gin.RouterGroup) { c.Data(200, "application/manifest+json", Sitewebmanifest) }) - route.GET("/static/js/2.56a11991.chunk.js", func(c *gin.Context) { - c.Data(200, "application/javascript; charset=utf-8", Staticjs256a11991chunkjs) + route.GET("/static/js/2.41a752aa.chunk.js", func(c *gin.Context) { + c.Data(200, "text/javascript; charset=utf-8", Staticjs241a752aachunkjs) }) - route.GET("/static/js/2.56a11991.chunk.js.LICENSE.txt", func(c *gin.Context) { - c.Data(200, "text/plain; charset=utf-8", Staticjs256a11991chunkjsLICENSEtxt) + route.GET("/static/js/2.41a752aa.chunk.js.LICENSE.txt", func(c *gin.Context) { + c.Data(200, "text/plain; charset=utf-8", Staticjs241a752aachunkjsLICENSEtxt) }) - route.GET("/static/js/2.56a11991.chunk.js.map", func(c *gin.Context) { - c.Data(200, "application/json", Staticjs256a11991chunkjsmap) + route.GET("/static/js/2.41a752aa.chunk.js.map", func(c *gin.Context) { + c.Data(200, "application/json", Staticjs241a752aachunkjsmap) }) - route.GET("/static/js/main.5883b760.chunk.js", func(c *gin.Context) { - c.Data(200, "application/javascript; charset=utf-8", Staticjsmain5883b760chunkjs) + route.GET("/static/js/main.b1d76117.chunk.js", func(c *gin.Context) { + c.Data(200, "text/javascript; charset=utf-8", Staticjsmainb1d76117chunkjs) }) - route.GET("/static/js/main.5883b760.chunk.js.map", func(c *gin.Context) { - c.Data(200, "application/json", Staticjsmain5883b760chunkjsmap) + route.GET("/static/js/main.b1d76117.chunk.js.map", func(c *gin.Context) { + c.Data(200, "application/json", Staticjsmainb1d76117chunkjsmap) }) route.GET("/static/js/runtime-main.f542387e.js", func(c *gin.Context) { - c.Data(200, "application/javascript; charset=utf-8", Staticjsruntimemainf542387ejs) + c.Data(200, "text/javascript; charset=utf-8", Staticjsruntimemainf542387ejs) }) route.GET("/static/js/runtime-main.f542387e.js.map", func(c *gin.Context) { diff --git a/web/src/components/Add/AddDialog.jsx b/web/src/components/Add/AddDialog.jsx index 2469e2b..a589bef 100644 --- a/web/src/components/Add/AddDialog.jsx +++ b/web/src/components/Add/AddDialog.jsx @@ -31,6 +31,7 @@ export default function AddDialog({ const isEditMode = !!originalHash const [torrentSource, setTorrentSource] = useState(originalHash || '') const [title, setTitle] = useState(originalTitle || '') + const [category, setCategory] = useState('Unknown') const [originalTorrentTitle, setOriginalTorrentTitle] = useState('') const [parsedTitle, setParsedTitle] = useState('') const [posterUrl, setPosterUrl] = useState(originalPoster || '') @@ -207,6 +208,7 @@ export default function AddDialog({ hash: originalHash, title: title || originalName, poster: posterUrl, + category, }) .finally(handleClose) } else if (selectedFile) { @@ -220,7 +222,14 @@ export default function AddDialog({ } else { // link save axios - .post(torrentsHost(), { action: 'add', link: torrentSource, title, poster: posterUrl, save_to_db: true }) + .post(torrentsHost(), { + action: 'add', + link: torrentSource, + title, + category, + poster: posterUrl, + save_to_db: true, + }) .catch(handleClose) } } @@ -243,6 +252,7 @@ export default function AddDialog({ setTitle(value) + const handleCategoryChange = ({ target: { value } }) => setCategory(value) const handlePosterUrlChange = ({ target: { value } }) => { setPosterUrl(value) checkImageURL(value).then(setIsPosterUrlCorrect) @@ -101,6 +113,26 @@ export default function RightSideComponent({ ), }} /> + + + Torrent category + + ) : ( + diff --git a/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx b/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx index cf567f3..14151dc 100644 --- a/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx @@ -6,6 +6,7 @@ import { Widgets as WidgetsIcon, PhotoSizeSelectSmall as PhotoSizeSelectSmallIcon, Build as BuildIcon, + Category as CategoryIcon, } from '@material-ui/icons' import { getPeerString, humanizeSize, humanizeSpeed } from 'utils/Utils' import { useTranslation } from 'react-i18next' @@ -126,3 +127,18 @@ export const SizeWidget = ({ data }) => { /> ) } + +export const CategoryWidget = ({ data }) => { + const { t } = useTranslation() + const { iconBGColor, valueBGColor } = useGetWidgetColors('category') + + return ( + + ) +} diff --git a/web/src/components/DialogTorrentDetailsContent/widgets/useGetWidgetColors.jsx b/web/src/components/DialogTorrentDetailsContent/widgets/useGetWidgetColors.jsx index f9305f9..8ddb850 100644 --- a/web/src/components/DialogTorrentDetailsContent/widgets/useGetWidgetColors.jsx +++ b/web/src/components/DialogTorrentDetailsContent/widgets/useGetWidgetColors.jsx @@ -13,6 +13,7 @@ const colors = { piecesLength: { iconBGColor: '#0982c8', valueBGColor: '#098cd7' }, status: { iconBGColor: '#aea25b', valueBGColor: '#b4aa6e' }, size: { iconBGColor: '#9b01ad', valueBGColor: '#ac03bf' }, + category: { iconBGColor: '#914820', valueBGColor: '#c9632c' }, }, dark: { downloadSpeed: { iconBGColor: '#0c6600', valueBGColor: '#0d7000' }, @@ -22,6 +23,7 @@ const colors = { piecesLength: { iconBGColor: '#07659c', valueBGColor: '#0872af' }, status: { iconBGColor: '#938948', valueBGColor: '#9f9450' }, size: { iconBGColor: '#81008f', valueBGColor: '#9102a1' }, + category: { iconBGColor: '#914820', valueBGColor: '#c9632c' }, }, } diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx index 44a00e7..f955d60 100644 --- a/web/src/components/TorrentCard/index.jsx +++ b/web/src/components/TorrentCard/index.jsx @@ -44,7 +44,16 @@ const Torrent = ({ torrent }) => { const openDeleteTorrentAlert = () => setIsDeleteTorrentOpened(true) const closeDeleteTorrentAlert = () => setIsDeleteTorrentOpened(false) - const { title, name, poster, torrent_size: torrentSize, download_speed: downloadSpeed, hash, stat } = torrent + const { + title, + name, + category, + poster, + torrent_size: torrentSize, + download_speed: downloadSpeed, + hash, + stat, + } = torrent const dropTorrent = () => axios.post(torrentsHost(), { action: 'drop', hash }) const deleteTorrent = () => axios.post(torrentsHost(), { action: 'rem', hash }) @@ -107,9 +116,15 @@ const Torrent = ({ torrent }) => { -
-
{t('Name')}
-
{parsedTitle}
+
+
+
{t('Name')}
+
{parsedTitle}
+
+
+
{t('Category')}
+
{category}
+
diff --git a/web/src/components/TorrentCard/style.js b/web/src/components/TorrentCard/style.js index 1348bbf..65dd804 100644 --- a/web/src/components/TorrentCard/style.js +++ b/web/src/components/TorrentCard/style.js @@ -110,6 +110,15 @@ export const TorrentCardDescription = styled.div` gap: 3px; } + .description-wrapper { + display: flex; + flex-direction: row; + } + + .description-wrapper > * { + flex: 1; + } + .description-title-wrapper { display: flex; flex-direction: column; @@ -128,6 +137,12 @@ export const TorrentCardDescription = styled.div` } } + .description-category-wrapper { + display: flex; + flex-direction: column; + align-items: end; + } + .description-status-wrapper { display: inline-block; height: 8px;