From 8c928565950a1b1d11bd02ae8e016a73ec743141 Mon Sep 17 00:00:00 2001 From: LIAUD Corentin Date: Wed, 22 Nov 2023 14:08:10 +0100 Subject: [PATCH 01/20] Add category associated to each torrent --- server/cmd/main.go | 2 +- server/go.sum | 21 +----------- server/settings/torrent.go | 7 ++-- server/torr/apihelper.go | 13 ++++++- server/torr/dbwrapper.go | 1 + server/torr/state/state.go | 1 + server/torr/torrent.go | 8 +++-- server/web/api/play.go | 2 +- server/web/api/stream.go | 6 ++-- server/web/api/torrents.go | 6 +++- server/web/api/upload.go | 7 +++- server/web/pages/template/html.go | 20 +++++------ .../pages/template/pages/asset-manifest.json | 14 ++++---- server/web/pages/template/pages/index.html | 2 +- server/web/pages/template/route.go | 24 ++++++------- web/src/components/Add/AddDialog.jsx | 13 ++++++- web/src/components/Add/RightSideComponent.jsx | 34 ++++++++++++++++++- .../DialogTorrentDetailsContent/index.jsx | 4 ++- .../widgets/index.jsx | 16 +++++++++ .../widgets/useGetWidgetColors.jsx | 2 ++ web/src/components/TorrentCard/index.jsx | 23 ++++++++++--- web/src/components/TorrentCard/style.js | 15 ++++++++ 22 files changed, 171 insertions(+), 70 deletions(-) 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; From a7417a221a6aa80966345a8141e29a749bc7fbbf Mon Sep 17 00:00:00 2001 From: LIAUD Corentin Date: Sun, 24 Mar 2024 16:10:49 +0100 Subject: [PATCH 02/20] Final work to add torrents categories --- .gitignore | 2 + server/torr/apihelper.go | 4 +- server/torr/dbwrapper.go | 1 + server/web/api/torrents.go | 2 +- server/web/pages/template/html.go | 20 ++++----- .../pages/template/pages/asset-manifest.json | 14 +++---- server/web/pages/template/pages/index.html | 2 +- server/web/pages/template/route.go | 34 +++++++-------- web/src/components/Add/AddDialog.jsx | 4 +- web/src/components/Add/RightSideComponent.jsx | 41 ++++++++++--------- web/src/components/TorrentCard/index.jsx | 9 +++- 11 files changed, 73 insertions(+), 60 deletions(-) diff --git a/.gitignore b/.gitignore index a806eca..07196f0 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,5 @@ server/config.db server/web/pages/template/route.go server/server.pem server/server.key +settings.json +viewed.json \ No newline at end of file diff --git a/server/torr/apihelper.go b/server/torr/apihelper.go index 60a9e33..178bed9 100644 --- a/server/torr/apihelper.go +++ b/server/torr/apihelper.go @@ -114,7 +114,7 @@ func GetTorrent(hashHex string) *Torrent { return tor } -func SetTorrent(hashHex, title, poster, data string) *Torrent { +func SetTorrent(hashHex, title, poster, category string, data string) *Torrent { hash := metainfo.NewHashFromHex(hashHex) torr := bts.GetTorrent(hash) torrDb := GetTorrentDB(hash) @@ -133,12 +133,14 @@ func SetTorrent(hashHex, title, poster, data string) *Torrent { } torr.Title = title torr.Poster = poster + torr.Category = category torr.Data = data } if torrDb != nil { torrDb.Title = title torrDb.Poster = poster + torrDb.Category = category torrDb.Data = data AddTorrentDB(torrDb) } diff --git a/server/torr/dbwrapper.go b/server/torr/dbwrapper.go index 2c01db4..663a580 100644 --- a/server/torr/dbwrapper.go +++ b/server/torr/dbwrapper.go @@ -75,6 +75,7 @@ func ListTorrentsDB() map[metainfo.Hash]*Torrent { torr.Poster = db.Poster torr.Timestamp = db.Timestamp torr.Size = db.Size + torr.Category = db.Category torr.Data = db.Data torr.Stat = state.TorrentInDB ret[torr.TorrentSpec.InfoHash] = torr diff --git a/server/web/api/torrents.go b/server/web/api/torrents.go index 40811e7..c5b18b8 100644 --- a/server/web/api/torrents.go +++ b/server/web/api/torrents.go @@ -153,7 +153,7 @@ func setTorrent(req torrReqJS, c *gin.Context) { c.AbortWithError(http.StatusBadRequest, errors.New("hash is empty")) return } - torr.SetTorrent(req.Hash, req.Title, req.Poster, req.Data) + torr.SetTorrent(req.Hash, req.Title, req.Poster, req.Category, req.Data) c.Status(200) } diff --git a/server/web/pages/template/html.go b/server/web/pages/template/html.go index 13672a6..e4da0f1 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.916c2545.chunk.js -var Staticjs2916c2545chunkjs []byte +//go:embed pages/static/js/2.00261e25.chunk.js +var Staticjs200261e25chunkjs []byte -//go:embed pages/static/js/2.916c2545.chunk.js.LICENSE.txt -var Staticjs2916c2545chunkjsLICENSEtxt []byte +//go:embed pages/static/js/2.00261e25.chunk.js.LICENSE.txt +var Staticjs200261e25chunkjsLICENSEtxt []byte -//go:embed pages/static/js/2.916c2545.chunk.js.map -var Staticjs2916c2545chunkjsmap []byte +//go:embed pages/static/js/2.00261e25.chunk.js.map +var Staticjs200261e25chunkjsmap []byte -//go:embed pages/static/js/main.55f380e1.chunk.js -var Staticjsmain55f380e1chunkjs []byte +//go:embed pages/static/js/main.4f4f0915.chunk.js +var Staticjsmain4f4f0915chunkjs []byte -//go:embed pages/static/js/main.55f380e1.chunk.js.map -var Staticjsmain55f380e1chunkjsmap []byte +//go:embed pages/static/js/main.4f4f0915.chunk.js.map +var Staticjsmain4f4f0915chunkjsmap []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 c6b5e05..55f3c9e 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.55f380e1.chunk.js", - "main.js.map": "/static/js/main.55f380e1.chunk.js.map", + "main.js": "/static/js/main.4f4f0915.chunk.js", + "main.js.map": "/static/js/main.4f4f0915.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.916c2545.chunk.js": "/static/js/2.916c2545.chunk.js", - "static/js/2.916c2545.chunk.js.map": "/static/js/2.916c2545.chunk.js.map", + "static/js/2.00261e25.chunk.js": "/static/js/2.00261e25.chunk.js", + "static/js/2.00261e25.chunk.js.map": "/static/js/2.00261e25.chunk.js.map", "index.html": "/index.html", - "static/js/2.916c2545.chunk.js.LICENSE.txt": "/static/js/2.916c2545.chunk.js.LICENSE.txt" + "static/js/2.00261e25.chunk.js.LICENSE.txt": "/static/js/2.00261e25.chunk.js.LICENSE.txt" }, "entrypoints": [ "static/js/runtime-main.f542387e.js", - "static/js/2.916c2545.chunk.js", - "static/js/main.55f380e1.chunk.js" + "static/js/2.00261e25.chunk.js", + "static/js/main.4f4f0915.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 b489fb1..a3db807 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 3800b6f..22be5f4 100644 --- a/server/web/pages/template/route.go +++ b/server/web/pages/template/route.go @@ -207,7 +207,7 @@ func RouteWebPages(route gin.IRouter) { etag := fmt.Sprintf("%x", md5.Sum(Browserconfigxml)) c.Header("Cache-Control", "public, max-age=31536000") c.Header("ETag", etag) - 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) { @@ -280,46 +280,46 @@ func RouteWebPages(route gin.IRouter) { c.Data(200, "application/manifest+json", Sitewebmanifest) }) - route.GET("/static/js/2.916c2545.chunk.js", func(c *gin.Context) { - etag := fmt.Sprintf("%x", md5.Sum(Staticjs2916c2545chunkjs)) + route.GET("/static/js/2.00261e25.chunk.js", func(c *gin.Context) { + etag := fmt.Sprintf("%x", md5.Sum(Staticjs200261e25chunkjs)) c.Header("Cache-Control", "public, max-age=31536000") c.Header("ETag", etag) - c.Data(200, "application/javascript; charset=utf-8", Staticjs2916c2545chunkjs) + c.Data(200, "text/javascript; charset=utf-8", Staticjs200261e25chunkjs) }) - route.GET("/static/js/2.916c2545.chunk.js.LICENSE.txt", func(c *gin.Context) { - etag := fmt.Sprintf("%x", md5.Sum(Staticjs2916c2545chunkjsLICENSEtxt)) + route.GET("/static/js/2.00261e25.chunk.js.LICENSE.txt", func(c *gin.Context) { + etag := fmt.Sprintf("%x", md5.Sum(Staticjs200261e25chunkjsLICENSEtxt)) c.Header("Cache-Control", "public, max-age=31536000") c.Header("ETag", etag) - c.Data(200, "text/plain; charset=utf-8", Staticjs2916c2545chunkjsLICENSEtxt) + c.Data(200, "text/plain; charset=utf-8", Staticjs200261e25chunkjsLICENSEtxt) }) - route.GET("/static/js/2.916c2545.chunk.js.map", func(c *gin.Context) { - etag := fmt.Sprintf("%x", md5.Sum(Staticjs2916c2545chunkjsmap)) + route.GET("/static/js/2.00261e25.chunk.js.map", func(c *gin.Context) { + etag := fmt.Sprintf("%x", md5.Sum(Staticjs200261e25chunkjsmap)) c.Header("Cache-Control", "public, max-age=31536000") c.Header("ETag", etag) - c.Data(200, "application/json", Staticjs2916c2545chunkjsmap) + c.Data(200, "application/json", Staticjs200261e25chunkjsmap) }) - route.GET("/static/js/main.55f380e1.chunk.js", func(c *gin.Context) { - etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain55f380e1chunkjs)) + route.GET("/static/js/main.4f4f0915.chunk.js", func(c *gin.Context) { + etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain4f4f0915chunkjs)) c.Header("Cache-Control", "public, max-age=31536000") c.Header("ETag", etag) - c.Data(200, "application/javascript; charset=utf-8", Staticjsmain55f380e1chunkjs) + c.Data(200, "text/javascript; charset=utf-8", Staticjsmain4f4f0915chunkjs) }) - route.GET("/static/js/main.55f380e1.chunk.js.map", func(c *gin.Context) { - etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain55f380e1chunkjsmap)) + route.GET("/static/js/main.4f4f0915.chunk.js.map", func(c *gin.Context) { + etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain4f4f0915chunkjsmap)) c.Header("Cache-Control", "public, max-age=31536000") c.Header("ETag", etag) - c.Data(200, "application/json", Staticjsmain55f380e1chunkjsmap) + c.Data(200, "application/json", Staticjsmain4f4f0915chunkjsmap) }) route.GET("/static/js/runtime-main.f542387e.js", func(c *gin.Context) { etag := fmt.Sprintf("%x", md5.Sum(Staticjsruntimemainf542387ejs)) c.Header("Cache-Control", "public, max-age=31536000") c.Header("ETag", etag) - 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 a589bef..ffa3123 100644 --- a/web/src/components/Add/AddDialog.jsx +++ b/web/src/components/Add/AddDialog.jsx @@ -26,12 +26,13 @@ export default function AddDialog({ title: originalTitle, name: originalName, poster: originalPoster, + category: originalCategory, }) { const { t } = useTranslation() const isEditMode = !!originalHash const [torrentSource, setTorrentSource] = useState(originalHash || '') const [title, setTitle] = useState(originalTitle || '') - const [category, setCategory] = useState('Unknown') + const [category, setCategory] = useState(originalCategory || '') const [originalTorrentTitle, setOriginalTorrentTitle] = useState('') const [parsedTitle, setParsedTitle] = useState('') const [posterUrl, setPosterUrl] = useState(originalPoster || '') @@ -248,7 +249,6 @@ export default function AddDialog({ setTorrentSource={setTorrentSource} /> )} - @@ -113,26 +115,6 @@ export default function RightSideComponent({ ), }} /> - - - Torrent category - - ) : ( + + Torrent category + + + {isPosterUrlCorrect ? poster : } diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx index f955d60..c812bee 100644 --- a/web/src/components/TorrentCard/index.jsx +++ b/web/src/components/TorrentCard/index.jsx @@ -185,7 +185,14 @@ const Torrent = ({ torrent }) => { {isEditDialogOpen && ( - + )} ) From 6ade9223a68389f5bfc5e339d8f206d2490d1378 Mon Sep 17 00:00:00 2001 From: LIAUD Corentin Date: Sun, 24 Mar 2024 17:00:36 +0100 Subject: [PATCH 03/20] Adds Sidebar icons to filter --- web/src/components/Add/RightSideComponent.jsx | 7 +++---- web/src/components/App/Sidebar.jsx | 19 ++++++++++++++++++- web/src/components/App/index.jsx | 10 +++++++++- web/src/components/FilterByCategory.jsx | 19 +++++++++++++++++++ web/src/components/TorrentList/index.jsx | 8 +++++--- web/src/components/categories.jsx | 13 +++++++++++++ 6 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 web/src/components/FilterByCategory.jsx create mode 100644 web/src/components/categories.jsx diff --git a/web/src/components/Add/RightSideComponent.jsx b/web/src/components/Add/RightSideComponent.jsx index 94accea..4f403f1 100644 --- a/web/src/components/Add/RightSideComponent.jsx +++ b/web/src/components/Add/RightSideComponent.jsx @@ -12,6 +12,7 @@ import { useTheme, } from '@material-ui/core' import { HighlightOff as HighlightOffIcon } from '@material-ui/icons' +import { TORRENT_CATEGORIES } from 'components/categories' import { ClearPosterButton, @@ -69,8 +70,6 @@ export default function RightSideComponent({ setIsUserInteractedWithPoster(true) } - const torrentCategories = ['Movies', 'Series', 'Music', 'Other', 'Unknown'] - return ( @@ -151,8 +150,8 @@ export default function RightSideComponent({ fullWidth defaultValue='Unknown' > - {torrentCategories.map(category => ( - {category} + {TORRENT_CATEGORIES.map(category => ( + {category.name} ))} diff --git a/web/src/components/App/Sidebar.jsx b/web/src/components/App/Sidebar.jsx index 9158381..7550b1f 100644 --- a/web/src/components/App/Sidebar.jsx +++ b/web/src/components/App/Sidebar.jsx @@ -11,10 +11,13 @@ import RemoveAll from 'components/RemoveAll' import AboutDialog from 'components/About' import CloseServer from 'components/CloseServer' import { memo } from 'react' +import CheckIcon from '@material-ui/icons/Check' +import { TORRENT_CATEGORIES } from 'components/categories' +import FilterByCategory from 'components/FilterByCategory' import { AppSidebarStyle } from './style' -const Sidebar = ({ isDrawerOpen, setIsDonationDialogOpen, isOffline, isLoading }) => { +const Sidebar = ({ isDrawerOpen, setIsDonationDialogOpen, isOffline, isLoading, setGlobalFilterCategory }) => { const { t } = useTranslation() return ( @@ -27,6 +30,20 @@ const Sidebar = ({ isDrawerOpen, setIsDonationDialogOpen, isOffline, isLoading } + + } setGlobalFilterCategory={setGlobalFilterCategory} /> + {TORRENT_CATEGORIES.map(category => ( + + ))} + + + + diff --git a/web/src/components/App/index.jsx b/web/src/components/App/index.jsx index 75ec1ca..c7658ae 100644 --- a/web/src/components/App/index.jsx +++ b/web/src/components/App/index.jsx @@ -43,6 +43,7 @@ export default function App() { const [isDarkMode, currentThemeMode, updateThemeMode, muiTheme] = useMaterialUITheme() const [currentLang, changeLang] = useChangeLanguage() const [isOffline, setIsOffline] = useState(false) + const [globalCategoryFilter, setGlobalFilterCategory] = useState('All') const { data: torrents, isLoading } = useQuery('torrents', getTorrents, { retry: 1, refetchInterval: 1000, @@ -126,9 +127,16 @@ export default function App() { isLoading={isLoading} isDrawerOpen={isDrawerOpen} setIsDonationDialogOpen={setIsDonationDialogOpen} + setGlobalFilterCategory={setGlobalFilterCategory} /> - + { + setGlobalFilterCategory(categoryName) + } + + return ( + <> + + {icon} + + + + + ) +} diff --git a/web/src/components/TorrentList/index.jsx b/web/src/components/TorrentList/index.jsx index 47fb714..e0362dc 100644 --- a/web/src/components/TorrentList/index.jsx +++ b/web/src/components/TorrentList/index.jsx @@ -5,7 +5,7 @@ import { TorrentListWrapper, CenteredGrid } from 'components/App/style' import NoServerConnection from './NoServerConnection' import AddFirstTorrent from './AddFirstTorrent' -export default function TorrentList({ isOffline, isLoading, sortABC, torrents }) { +export default function TorrentList({ isOffline, isLoading, sortABC, torrents, sortCategory }) { if (isLoading || isOffline || !torrents.length) { return ( @@ -20,9 +20,11 @@ export default function TorrentList({ isOffline, isLoading, sortABC, torrents }) ) } + const filteredTorrents = torrents.filter(torrent => sortCategory === 'All' || torrent.category === sortCategory) + return sortABC ? ( - {torrents + {filteredTorrents .sort((a, b) => a.title > b.title) .map(torrent => ( @@ -30,7 +32,7 @@ export default function TorrentList({ isOffline, isLoading, sortABC, torrents }) ) : ( - {torrents.map(torrent => ( + {filteredTorrents.map(torrent => ( ))} diff --git a/web/src/components/categories.jsx b/web/src/components/categories.jsx new file mode 100644 index 0000000..7fbcac5 --- /dev/null +++ b/web/src/components/categories.jsx @@ -0,0 +1,13 @@ +import MovieCreationIcon from '@material-ui/icons/MovieCreation' +import LiveTvIcon from '@material-ui/icons/LiveTv' +import MusicNoteIcon from '@material-ui/icons/MusicNote' +import MoreHorizIcon from '@material-ui/icons/MoreHoriz' +import HelpIcon from '@material-ui/icons/Help' + +export const TORRENT_CATEGORIES = [ + { name: 'Movies', icon: }, + { name: 'Series', icon: }, + { name: 'Music', icon: }, + { name: 'Other', icon: }, + { name: 'Unknown', icon: }, +] From de8137bfbf419219755c61f51ff89c5a82df1a8a Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sat, 6 Apr 2024 05:14:27 +0300 Subject: [PATCH 04/20] update web for categories --- server/torr/apihelper.go | 5 +++-- web/src/components/Add/RightSideComponent.jsx | 10 +++++----- web/src/components/TorrentCard/index.jsx | 13 +++++------- web/src/components/TorrentCard/style.js | 20 ++++++++----------- web/src/components/categories.jsx | 4 ++-- web/src/locales/bg/translation.json | 9 +++++++++ web/src/locales/en/translation.json | 8 ++++++++ web/src/locales/ru/translation.json | 8 ++++++++ web/src/locales/ua/translation.json | 9 +++++++++ web/src/locales/zh/translation.json | 9 +++++++++ 10 files changed, 66 insertions(+), 29 deletions(-) diff --git a/server/torr/apihelper.go b/server/torr/apihelper.go index 178bed9..83dcffe 100644 --- a/server/torr/apihelper.go +++ b/server/torr/apihelper.go @@ -61,8 +61,8 @@ func AddTorrent(spec *torrent.TorrentSpec, title, poster string, data string, ca if torr.Category == "" { if torDB != nil { torr.Category = torDB.Category - } else { - torr.Category = "Unknown" + // } else { + // torr.Category = "None" } } @@ -72,6 +72,7 @@ func AddTorrent(spec *torrent.TorrentSpec, title, poster string, data string, ca torr.Poster = torDB.Poster } } + if torr.Data == "" { torr.Data = data if torr.Data == "" && torDB != nil { diff --git a/web/src/components/Add/RightSideComponent.jsx b/web/src/components/Add/RightSideComponent.jsx index 4f403f1..8a81f14 100644 --- a/web/src/components/Add/RightSideComponent.jsx +++ b/web/src/components/Add/RightSideComponent.jsx @@ -3,9 +3,9 @@ import { rgba } from 'polished' import { NoImageIcon } from 'icons' import { FormControl, + FormHelperText, IconButton, InputAdornment, - InputLabel, MenuItem, Select, TextField, @@ -136,19 +136,19 @@ export default function RightSideComponent({ variant='outlined' fullWidth /> - - Torrent category + + {t('AddDialog.CategoryHelperText')} + From d5699699db9c6e5361154afb856d28f02e66165e Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sat, 6 Apr 2024 12:39:03 +0300 Subject: [PATCH 07/20] WiP: localized categories FIXME --- web/src/components/Add/RightSideComponent.jsx | 6 +++--- web/src/components/App/Sidebar.jsx | 13 ++++++++++--- web/src/components/App/index.jsx | 2 +- web/src/components/FilterByCategory.jsx | 15 ++++++++++----- web/src/components/TorrentCard/index.jsx | 8 +++++++- web/src/components/TorrentList/index.jsx | 4 +++- web/src/components/categories.jsx | 10 ++++------ web/src/locales/bg/translation.json | 13 ++++++------- web/src/locales/en/translation.json | 12 ++++++------ web/src/locales/ru/translation.json | 12 ++++++------ web/src/locales/ua/translation.json | 13 ++++++------- web/src/locales/zh/translation.json | 13 ++++++------- 12 files changed, 68 insertions(+), 53 deletions(-) diff --git a/web/src/components/Add/RightSideComponent.jsx b/web/src/components/Add/RightSideComponent.jsx index 378ab52..d84f1bd 100644 --- a/web/src/components/Add/RightSideComponent.jsx +++ b/web/src/components/Add/RightSideComponent.jsx @@ -148,11 +148,11 @@ export default function RightSideComponent({ onChange={handleCategoryChange} variant='outlined' fullWidth - defaultValue='Other' + defaultValue='other' > {TORRENT_CATEGORIES.map(category => ( - - {category.name} + + {t(category.name)} ))} diff --git a/web/src/components/App/Sidebar.jsx b/web/src/components/App/Sidebar.jsx index 7550b1f..06d3cef 100644 --- a/web/src/components/App/Sidebar.jsx +++ b/web/src/components/App/Sidebar.jsx @@ -31,11 +31,18 @@ const Sidebar = ({ isDrawerOpen, setIsDonationDialogOpen, isOffline, isLoading, - } setGlobalFilterCategory={setGlobalFilterCategory} /> + } + setGlobalFilterCategory={setGlobalFilterCategory} + /> {TORRENT_CATEGORIES.map(category => ( diff --git a/web/src/components/App/index.jsx b/web/src/components/App/index.jsx index c7658ae..4593203 100644 --- a/web/src/components/App/index.jsx +++ b/web/src/components/App/index.jsx @@ -43,7 +43,7 @@ export default function App() { const [isDarkMode, currentThemeMode, updateThemeMode, muiTheme] = useMaterialUITheme() const [currentLang, changeLang] = useChangeLanguage() const [isOffline, setIsOffline] = useState(false) - const [globalCategoryFilter, setGlobalFilterCategory] = useState('All') + const [globalCategoryFilter, setGlobalFilterCategory] = useState('all') const { data: torrents, isLoading } = useQuery('torrents', getTorrents, { retry: 1, refetchInterval: 1000, diff --git a/web/src/components/FilterByCategory.jsx b/web/src/components/FilterByCategory.jsx index 2735cc3..64afd10 100644 --- a/web/src/components/FilterByCategory.jsx +++ b/web/src/components/FilterByCategory.jsx @@ -1,18 +1,23 @@ import ListItem from '@material-ui/core/ListItem' import ListItemIcon from '@material-ui/core/ListItemIcon' import ListItemText from '@material-ui/core/ListItemText' +import { useTranslation } from 'react-i18next' -export default function FilterByCategory({ categoryName, setGlobalFilterCategory, icon }) { +export default function FilterByCategory({ categoryKey, categoryName, setGlobalFilterCategory, icon }) { const onClick = () => { - setGlobalFilterCategory(categoryName) + setGlobalFilterCategory(categoryKey) + if (process.env.NODE_ENV !== 'production') { + // eslint-disable-next-line no-console + console.log('FilterByCategory categoryKey: %s categoryName: %s', categoryKey, categoryName) + } } + const { t } = useTranslation() return ( <> - + {icon} - - + ) diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx index da2c338..3fdb31a 100644 --- a/web/src/components/TorrentCard/index.jsx +++ b/web/src/components/TorrentCard/index.jsx @@ -19,6 +19,7 @@ import AddDialog from 'components/Add/AddDialog' import { StyledDialog } from 'style/CustomMaterialUiStyles' import useOnStandaloneAppOutsideClick from 'utils/useOnStandaloneAppOutsideClick' import { GETTING_INFO, IN_DB, CLOSED, PRELOAD, WORKING } from 'torrentStates' +import { TORRENT_CATEGORIES } from 'components/categories' import { StatusIndicators, @@ -81,6 +82,9 @@ const Torrent = ({ torrent }) => { const fullPlaylistLink = `${playlistTorrHost()}/${encodeURIComponent(parsedTitle || 'file')}.m3u?link=${hash}&m3u` const detailedInfoDialogRef = useOnStandaloneAppOutsideClick(closeDetailedInfo) + // FIXME + const catIndex = TORRENT_CATEGORIES.findIndex(e => e.key === category) + const catArray = TORRENT_CATEGORIES.find(e => e.key === category) return ( <> @@ -119,7 +123,9 @@ const Torrent = ({ torrent }) => {
{t('Name')} -
{category}
+
+ {catIndex >= 0 ? t(catArray.name) : ''/* {category} */} +
{parsedTitle}
diff --git a/web/src/components/TorrentList/index.jsx b/web/src/components/TorrentList/index.jsx index e0362dc..4ccd090 100644 --- a/web/src/components/TorrentList/index.jsx +++ b/web/src/components/TorrentList/index.jsx @@ -1,11 +1,13 @@ import TorrentCard from 'components/TorrentCard' import CircularProgress from '@material-ui/core/CircularProgress' import { TorrentListWrapper, CenteredGrid } from 'components/App/style' +// import { useTranslation } from 'react-i18next' import NoServerConnection from './NoServerConnection' import AddFirstTorrent from './AddFirstTorrent' export default function TorrentList({ isOffline, isLoading, sortABC, torrents, sortCategory }) { + // const { t } = useTranslation() if (isLoading || isOffline || !torrents.length) { return ( @@ -20,7 +22,7 @@ export default function TorrentList({ isOffline, isLoading, sortABC, torrents, s ) } - const filteredTorrents = torrents.filter(torrent => sortCategory === 'All' || torrent.category === sortCategory) + const filteredTorrents = torrents.filter(torrent => sortCategory === 'all' || torrent.category === sortCategory) return sortABC ? ( diff --git a/web/src/components/categories.jsx b/web/src/components/categories.jsx index 91eacd0..f9a1556 100644 --- a/web/src/components/categories.jsx +++ b/web/src/components/categories.jsx @@ -2,12 +2,10 @@ import MovieCreationIcon from '@material-ui/icons/MovieCreation' import LiveTvIcon from '@material-ui/icons/LiveTv' import MusicNoteIcon from '@material-ui/icons/MusicNote' import MoreHorizIcon from '@material-ui/icons/MoreHoriz' -// import HelpIcon from '@material-ui/icons/Help' export const TORRENT_CATEGORIES = [ - { name: 'Movies', icon: }, - { name: 'Series', icon: }, - { name: 'Music', icon: }, - { name: 'Other', icon: }, - // { name: 'None', icon: }, // TODO: unset category with this option + { key: 'movies', name: 'Movies', icon: }, + { key: 'series', name: 'Series', icon: }, + { key: 'music', name: 'Music', icon: }, + { key: 'other', name: 'Other', icon: }, ] diff --git a/web/src/locales/bg/translation.json b/web/src/locales/bg/translation.json index bf6c3af..4a51584 100644 --- a/web/src/locales/bg/translation.json +++ b/web/src/locales/bg/translation.json @@ -22,6 +22,7 @@ }, "AddFromLink": "Добавете торент", "AddNewTorrent": "Добавете нов торент", + "All": "Всичко", "ApiDocs": "Документация на API", "B": "B", "bps": "bps", @@ -30,13 +31,6 @@ "Cache": "Кеш", "Cancel": "Отказ", "Category": "Категория", - "CategoryLabel": { - "Movies": "Филми", - "Series": "Серия", - "Music": "Музика", - "Other": "Други", - "None": "Нито един" - }, "Clear": "Изчисти", "Close": "Затвори", "CloseServer?": "Искате ли да изключите сървъра?", @@ -75,12 +69,16 @@ "Links": "Връзки", "MB": "MB", "Mbps": "Mbps", + "Movies": "Филми", + "Music": "Музика", "Name": "Име", "NasReleases": "NAS Releases", + "None": "Нито един", "NoTorrentsAdded": "Няма добавени торенти", "Offline": "Извън линия", "OK": "OK", "OpenLink": "Отвори линк", + "Other": "Други", "Peers": "Пиъри·Сийдъри", "PiecesCount": "Брой парчета", "PiecesLength": "Дължина на парчетата", @@ -107,6 +105,7 @@ "Sec": "сек", "Seconds": "Секунди", "SelectSeason": "Избери сезон", + "Series": "Серия", "SettingsDialog": { "AddRetrackers": "Добавяне на ретракери", "AdditionalSettings": "Допълнителни настройки", diff --git a/web/src/locales/en/translation.json b/web/src/locales/en/translation.json index 14f6fb8..a072dcb 100644 --- a/web/src/locales/en/translation.json +++ b/web/src/locales/en/translation.json @@ -22,6 +22,7 @@ }, "AddFromLink": "Add Torrent", "AddNewTorrent": "Add new torrent", + "All": "All", "ApiDocs": "API Docs", "B": "B", "bps": "bps", @@ -30,12 +31,6 @@ "Cache": "Cache", "Cancel": "Cancel", "Category": "Category", - "CategoryLabel": { - "Movies": "Movies", - "Series": "Series", - "Music": "Music", - "Other": "Other" - }, "Clear": "Clear", "Close": "Close", "CloseServer?": "Do you want to turn off server?", @@ -74,12 +69,16 @@ "Links": "Links", "MB": "MB", "Mbps": "Mbps", + "Movies": "Movies", + "Music": "Music", "Name": "Name", "NasReleases": "NAS Releases", + "None": "None", "NoTorrentsAdded": "No torrents added", "Offline": "Offline", "OK": "OK", "OpenLink": "Open link", + "Other": "Other", "Peers": "Peers·Seeds", "PiecesCount": "Pieces count", "PiecesLength": "Pieces length", @@ -106,6 +105,7 @@ "Sec": "s", "Seconds": "Seconds", "SelectSeason": "Select Season", + "Series": "Series", "SettingsDialog": { "AddRetrackers": "Add retrackers", "AdditionalSettings": "Additional Settings", diff --git a/web/src/locales/ru/translation.json b/web/src/locales/ru/translation.json index 0d55544..f0cb999 100644 --- a/web/src/locales/ru/translation.json +++ b/web/src/locales/ru/translation.json @@ -22,6 +22,7 @@ }, "AddFromLink": "Добавить", "AddNewTorrent": "Добавить новый торрент", + "All": "Все", "ApiDocs": "Документация API", "B": "Б", "bps": "бит/c", @@ -30,12 +31,6 @@ "Cache": "Кеш", "Cancel": "Отмена", "Category": "Категория", - "CategoryLabel": { - "Movies": "Фильмы", - "Series": "Сериалы", - "Music": "Музыка", - "Other": "Другое" - }, "Clear": "Очистить", "Close": "Закрыть", "CloseServer?": "Хотите выключить сервер?", @@ -74,12 +69,16 @@ "Links": "Ссылки", "MB": "МБ", "Mbps": "Мбит/c", + "Movies": "Фильмы", + "Music": "Музыка", "Name": "Название", "NasReleases": "Релизы для NAS", + "None": "Нет", "NoTorrentsAdded": "Нет торрентов", "Offline": "Сервер недоступен", "OK": "OK", "OpenLink": "Открыть", + "Other": "Другое", "Peers": "Пиры·Сиды", "PiecesCount": "Кол-во блоков", "PiecesLength": "Размер блока", @@ -106,6 +105,7 @@ "Sec": "c", "Seconds": "Секунды", "SelectSeason": "Выбор сезона", + "Series": "Сериалы", "SettingsDialog": { "AddRetrackers": "Добавлять", "AdditionalSettings": "Расширенные настройки", diff --git a/web/src/locales/ua/translation.json b/web/src/locales/ua/translation.json index b40dec1..99c4de5 100644 --- a/web/src/locales/ua/translation.json +++ b/web/src/locales/ua/translation.json @@ -22,6 +22,7 @@ }, "AddFromLink": "Додати торент", "AddNewTorrent": "Додати новий торент", + "All": "Усе", "ApiDocs": "Документація API", "B": "Б", "bps": "біт/c", @@ -30,13 +31,6 @@ "Cache": "Кеш", "Cancel": "Скасувати", "Category": "Категорія", - "CategoryLabel": { - "Movies": "Фільми", - "Series": "Серія", - "Music": "Музика", - "Other": "Інший", - "None": "Жодного" - }, "Clear": "Очистити", "Close": "Закрити", "CloseServer?": "Хочете вимкнути сервер?", @@ -75,12 +69,16 @@ "Links": "Посилання", "MB": "МБ", "Mbps": "Мбіт/c", + "Movies": "Фільми", + "Music": "Музика", "Name": "Назва", "NasReleases": "Релізи для NAS", + "None": "Жодного", "NoTorrentsAdded": "Немає торентів", "Offline": "Сервер не доступний", "OK": "OK", "OpenLink": "Відкрити", + "Other": "Інший", "Peers": "Піри·Сіди", "PiecesCount": "К-сть блоків", "PiecesLength": "Розмір блоку", @@ -107,6 +105,7 @@ "Sec": "c", "Seconds": "Секунди", "SelectSeason": "Вибір сезону", + "Series": "Серія", "SettingsDialog": { "AddRetrackers": "Додавати", "AdditionalSettings": "Додаткові налаштування", diff --git a/web/src/locales/zh/translation.json b/web/src/locales/zh/translation.json index cd43454..1ad5e8f 100644 --- a/web/src/locales/zh/translation.json +++ b/web/src/locales/zh/translation.json @@ -22,6 +22,7 @@ }, "AddFromLink": "添加种子", "AddNewTorrent": "添加新种子", + "All": "全部", "ApiDocs": "API 文档", "B": "B", "bps": "bps", @@ -30,13 +31,6 @@ "Cache": "缓存", "Cancel": "取消", "Category": "类别", - "CategoryLabel": { - "Movies": "电影", - "Series": "系列", - "Music": "音乐", - "Other": "其他", - "None": "没有任何" - }, "Clear": "清除", "Close": "关闭", "CloseServer?": "你想关闭服务器吗?", @@ -75,12 +69,16 @@ "Links": "链接", "MB": "MB", "Mbps": "Mbps", + "Movies": "电影", + "Music": "音乐", "Name": "名称", "NasReleases": "NAS 版本", + "None": "没有任何", "NoTorrentsAdded": "没有添加种子", "Offline": "离线", "OK": "确定", "OpenLink": "打开链接", + "Other": "其他", "Peers": "Peers·Seeds", "PiecesCount": "块数量", "PiecesLength": "块长度", @@ -107,6 +105,7 @@ "Sec": "秒", "Seconds": "秒", "SelectSeason": "选择季", + "Series": "系列", "SettingsDialog": { "AddRetrackers": "添加retrackers", "AdditionalSettings": "附加设置", From e5a27399411d20d61f3a45edfa154aca32620e19 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sat, 6 Apr 2024 13:39:09 +0300 Subject: [PATCH 08/20] cosmetics --- web/src/components/TorrentCard/index.jsx | 2 +- web/src/components/TorrentCard/style.js | 14 ++++++++------ web/src/locales/bg/translation.json | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx index 3fdb31a..d1117d1 100644 --- a/web/src/components/TorrentCard/index.jsx +++ b/web/src/components/TorrentCard/index.jsx @@ -124,7 +124,7 @@ const Torrent = ({ torrent }) => {
{t('Name')}
- {catIndex >= 0 ? t(catArray.name) : ''/* {category} */} + {catIndex >= 0 ? t(catArray.name) : '' /* {category} */}
{parsedTitle}
diff --git a/web/src/components/TorrentCard/style.js b/web/src/components/TorrentCard/style.js index 49706a1..8f3b791 100644 --- a/web/src/components/TorrentCard/style.js +++ b/web/src/components/TorrentCard/style.js @@ -116,12 +116,19 @@ export const TorrentCardDescription = styled.div` flex-direction: column; } - .description-section-name { + .description-title-wrapper > .description-section-name { display: flex; flex-wrap: nowrap; justify-content: space-between; self-align: end; + } + .description-category-wrapper { + display: inline-flex; + color: ${sidebarBGColor}; + } + + .description-section-name { text-transform: uppercase; font-size: 10px; font-weight: 600; @@ -134,11 +141,6 @@ export const TorrentCardDescription = styled.div` } } - .description-category-wrapper { - display: inline-flex; - color: ${sidebarBGColor}; - } - .description-status-wrapper { display: inline-block; height: 8px; diff --git a/web/src/locales/bg/translation.json b/web/src/locales/bg/translation.json index 4a51584..1b1d6dd 100644 --- a/web/src/locales/bg/translation.json +++ b/web/src/locales/bg/translation.json @@ -79,7 +79,7 @@ "OK": "OK", "OpenLink": "Отвори линк", "Other": "Други", - "Peers": "Пиъри·Сийдъри", + "Peers": "Пиъри·Сийди", "PiecesCount": "Брой парчета", "PiecesLength": "Дължина на парчетата", "Playlist": "Плейлист", From c8e02deefd113d16af2ccdb2acadc18573219764 Mon Sep 17 00:00:00 2001 From: LIAUD Corentin Date: Sat, 6 Apr 2024 13:28:21 +0200 Subject: [PATCH 09/20] Bug fix + UI improvment - Fixes Bug when loading torrent category from cache - UI: Do not display category if not provided --- server/torr/apihelper.go | 1 + server/torr/dbwrapper.go | 1 + .../widgets/index.jsx | 22 +++++++++++-------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/server/torr/apihelper.go b/server/torr/apihelper.go index 83dcffe..76e4ca6 100644 --- a/server/torr/apihelper.go +++ b/server/torr/apihelper.go @@ -108,6 +108,7 @@ func GetTorrent(hashHex string) *Torrent { tr.Data = tor.Data tr.Size = tor.Size tr.Timestamp = tor.Timestamp + tr.Category = tor.Category tr.GotInfo() } }() diff --git a/server/torr/dbwrapper.go b/server/torr/dbwrapper.go index 663a580..60e525f 100644 --- a/server/torr/dbwrapper.go +++ b/server/torr/dbwrapper.go @@ -55,6 +55,7 @@ func GetTorrentDB(hash metainfo.Hash) *Torrent { torr.Size = db.Size torr.Data = db.Data torr.Stat = state.TorrentInDB + torr.Category = db.Category return torr } } diff --git a/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx b/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx index e50629a..637d340 100644 --- a/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx @@ -132,13 +132,17 @@ export const CategoryWidget = ({ data }) => { const { t } = useTranslation() const { iconBGColor, valueBGColor } = useGetWidgetColors('category') - return ( - - ) + if (data) { + return ( + + ) + } + + return null } From 3439a06ce2df6a2878eaa99b02567a48a2c0f950 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sat, 6 Apr 2024 15:11:39 +0300 Subject: [PATCH 10/20] use translated main categories in details --- .../DialogTorrentDetailsContent/widgets/index.jsx | 6 +++++- web/src/components/FilterByCategory.jsx | 6 +++--- web/src/components/TorrentCard/index.jsx | 6 ++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx b/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx index 637d340..9502623 100644 --- a/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx @@ -11,6 +11,7 @@ import { import { getPeerString, humanizeSize, humanizeSpeed } from 'utils/Utils' import { useTranslation } from 'react-i18next' import { GETTING_INFO, IN_DB, CLOSED, PRELOAD, WORKING } from 'torrentStates' +import { TORRENT_CATEGORIES } from 'components/categories' import StatisticsField from '../StatisticsField' import useGetWidgetColors from './useGetWidgetColors' @@ -131,12 +132,15 @@ export const SizeWidget = ({ data }) => { export const CategoryWidget = ({ data }) => { const { t } = useTranslation() const { iconBGColor, valueBGColor } = useGetWidgetColors('category') + // main categories + const catIndex = TORRENT_CATEGORIES.findIndex(e => e.key === data) + const catArray = TORRENT_CATEGORIES.find(e => e.key === data) if (data) { return ( = 0 ? t(catArray.name) : data} iconBg={iconBGColor} valueBg={valueBGColor} icon={CategoryIcon} diff --git a/web/src/components/FilterByCategory.jsx b/web/src/components/FilterByCategory.jsx index 64afd10..8c817e8 100644 --- a/web/src/components/FilterByCategory.jsx +++ b/web/src/components/FilterByCategory.jsx @@ -6,10 +6,10 @@ import { useTranslation } from 'react-i18next' export default function FilterByCategory({ categoryKey, categoryName, setGlobalFilterCategory, icon }) { const onClick = () => { setGlobalFilterCategory(categoryKey) - if (process.env.NODE_ENV !== 'production') { + // if (process.env.NODE_ENV !== 'production') { // eslint-disable-next-line no-console - console.log('FilterByCategory categoryKey: %s categoryName: %s', categoryKey, categoryName) - } + // console.log('FilterByCategory categoryKey: %s categoryName: %s', categoryKey, categoryName) + // } } const { t } = useTranslation() diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx index d1117d1..125290a 100644 --- a/web/src/components/TorrentCard/index.jsx +++ b/web/src/components/TorrentCard/index.jsx @@ -82,7 +82,7 @@ const Torrent = ({ torrent }) => { const fullPlaylistLink = `${playlistTorrHost()}/${encodeURIComponent(parsedTitle || 'file')}.m3u?link=${hash}&m3u` const detailedInfoDialogRef = useOnStandaloneAppOutsideClick(closeDetailedInfo) - // FIXME + // main categories const catIndex = TORRENT_CATEGORIES.findIndex(e => e.key === category) const catArray = TORRENT_CATEGORIES.find(e => e.key === category) @@ -123,9 +123,7 @@ const Torrent = ({ torrent }) => {
{t('Name')} -
- {catIndex >= 0 ? t(catArray.name) : '' /* {category} */} -
+
{catIndex >= 0 ? t(catArray.name) : category}
{parsedTitle}
From 2ac365fa2394270417b9294d9156dea275ed5129 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sat, 6 Apr 2024 15:17:29 +0300 Subject: [PATCH 11/20] prettier suggests --- web/src/components/FilterByCategory.jsx | 4 ---- web/src/components/TorrentCard/index.jsx | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/web/src/components/FilterByCategory.jsx b/web/src/components/FilterByCategory.jsx index 8c817e8..d18905b 100644 --- a/web/src/components/FilterByCategory.jsx +++ b/web/src/components/FilterByCategory.jsx @@ -6,10 +6,6 @@ import { useTranslation } from 'react-i18next' export default function FilterByCategory({ categoryKey, categoryName, setGlobalFilterCategory, icon }) { const onClick = () => { setGlobalFilterCategory(categoryKey) - // if (process.env.NODE_ENV !== 'production') { - // eslint-disable-next-line no-console - // console.log('FilterByCategory categoryKey: %s categoryName: %s', categoryKey, categoryName) - // } } const { t } = useTranslation() diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx index 125290a..afc3c0b 100644 --- a/web/src/components/TorrentCard/index.jsx +++ b/web/src/components/TorrentCard/index.jsx @@ -123,7 +123,7 @@ const Torrent = ({ torrent }) => {
{t('Name')} -
{catIndex >= 0 ? t(catArray.name) : category}
+
{catIndex >= 0 ? t(catArray.name) : category}
{parsedTitle}
From 770e38a5691ac25612eb5dfa18ce9ab47f9b2e3c Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sat, 6 Apr 2024 15:45:56 +0300 Subject: [PATCH 12/20] Update translation.json --- web/src/locales/bg/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/locales/bg/translation.json b/web/src/locales/bg/translation.json index 1b1d6dd..e8455ba 100644 --- a/web/src/locales/bg/translation.json +++ b/web/src/locales/bg/translation.json @@ -46,7 +46,7 @@ "button": "Подробности за кеша", "header": "Подробности за кеша" }, - "Details": "Подробности", + "Details": "Подробно", "Donate?": "Искате ли да дарите?", "Donate": "Дарение", "DownloadPlaylist": "Изтегляне на плейлист", From fd83838e2089645f81b0fc9e58a64dc90bbfd596 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sat, 6 Apr 2024 15:47:55 +0300 Subject: [PATCH 13/20] Update translation.json --- web/src/locales/bg/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/locales/bg/translation.json b/web/src/locales/bg/translation.json index e8455ba..0d20514 100644 --- a/web/src/locales/bg/translation.json +++ b/web/src/locales/bg/translation.json @@ -46,7 +46,7 @@ "button": "Подробности за кеша", "header": "Подробности за кеша" }, - "Details": "Подробно", + "Details": "Детайли", "Donate?": "Искате ли да дарите?", "Donate": "Дарение", "DownloadPlaylist": "Изтегляне на плейлист", From c8f272acabfd8bc1a4ee12558aec91e65cc001b8 Mon Sep 17 00:00:00 2001 From: LIAUD Corentin Date: Sat, 6 Apr 2024 21:55:01 +0200 Subject: [PATCH 14/20] feat: add possibility to remove torrent category --- README.md | 21 ++++++++++++++++++- web/src/components/Add/RightSideComponent.jsx | 18 ++++++++++++++-- web/src/components/App/Sidebar.jsx | 8 +++++++ web/src/locales/bg/translation.json | 1 + web/src/locales/en/translation.json | 1 + web/src/locales/ru/translation.json | 1 + web/src/locales/ua/translation.json | 1 + web/src/locales/zh/translation.json | 1 + 8 files changed, 49 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cb9f942..ff675ed 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,25 @@ https://github.com/vladlenas Synology NAS packages repo source: https://grigi.lt +### Development + +#### Go server + +To run the Go server locally, just run + +```bash +cd server +go run ./cmd +``` + +#### Web development + +To run the web server locally, just run + +```bash +yarn start +``` + ### Build #### Server @@ -262,7 +281,7 @@ local:127.0.0.1 - [FaintGhost](https://github.com/FaintGhost) Zhang Yaowei for Simplified Chinese web translation - [Anton111111](https://github.com/Anton111111) Anton Potekhin for sleep on Windows fixes - [lieranderl](https://github.com/lieranderl) Evgeni for adding SSL support code -- [cocool97](https://github.com/cocool97) for openapi API documentation +- [cocool97](https://github.com/cocool97) for openapi API documentation and torrent categories - [shadeov](https://github.com/shadeov) for README improvements - [butaford](https://github.com/butaford) Pavel for make docker file and scripts - [filimonic](https://github.com/filimonic) Alexey D. Filimonov diff --git a/web/src/components/Add/RightSideComponent.jsx b/web/src/components/Add/RightSideComponent.jsx index d84f1bd..5fbd66e 100644 --- a/web/src/components/Add/RightSideComponent.jsx +++ b/web/src/components/Add/RightSideComponent.jsx @@ -11,7 +11,7 @@ import { TextField, useTheme, } from '@material-ui/core' -import { HighlightOff as HighlightOffIcon } from '@material-ui/icons' +import { HighlightOff as HighlightOffIcon, Clear } from '@material-ui/icons' import { TORRENT_CATEGORIES } from 'components/categories' import { @@ -148,7 +148,21 @@ export default function RightSideComponent({ onChange={handleCategoryChange} variant='outlined' fullWidth - defaultValue='other' + defaultValue='' + IconComponent={ + category.length > 1 + ? () => ( + { + setCategory(""); + }} + > + + + ) + : undefined + } > {TORRENT_CATEGORIES.map(category => ( diff --git a/web/src/components/App/Sidebar.jsx b/web/src/components/App/Sidebar.jsx index 06d3cef..4654c70 100644 --- a/web/src/components/App/Sidebar.jsx +++ b/web/src/components/App/Sidebar.jsx @@ -12,6 +12,7 @@ import AboutDialog from 'components/About' import CloseServer from 'components/CloseServer' import { memo } from 'react' import CheckIcon from '@material-ui/icons/Check' +import ClearIcon from '@material-ui/icons/Clear' import { TORRENT_CATEGORIES } from 'components/categories' import FilterByCategory from 'components/FilterByCategory' @@ -47,6 +48,13 @@ const Sidebar = ({ isDrawerOpen, setIsDonationDialogOpen, isOffline, isLoading, setGlobalFilterCategory={setGlobalFilterCategory} /> ))} + } + setGlobalFilterCategory={setGlobalFilterCategory} + />
diff --git a/web/src/locales/bg/translation.json b/web/src/locales/bg/translation.json index 0d20514..7ae1415 100644 --- a/web/src/locales/bg/translation.json +++ b/web/src/locales/bg/translation.json @@ -188,6 +188,7 @@ "TorrentStatus": "Статус на торента", "TorrentWorking": "Активен", "TurnOff": "Изключване", + "Uncategorized": "Некатегоризиран", "UploadFile": "Качи файл", "UploadSpeed": "Скорост на качване", "Viewed": "Гледан" diff --git a/web/src/locales/en/translation.json b/web/src/locales/en/translation.json index a072dcb..82af228 100644 --- a/web/src/locales/en/translation.json +++ b/web/src/locales/en/translation.json @@ -188,6 +188,7 @@ "TorrentStatus": "Torrent Status", "TorrentWorking": "Active", "TurnOff": "Turn Off", + "Uncategorized": "Uncategorized", "UploadFile": "Upload File", "UploadSpeed": "Upload speed", "Viewed": "Viewed" diff --git a/web/src/locales/ru/translation.json b/web/src/locales/ru/translation.json index f0cb999..83e016e 100644 --- a/web/src/locales/ru/translation.json +++ b/web/src/locales/ru/translation.json @@ -188,6 +188,7 @@ "TorrentStatus": "Состояние торрента", "TorrentWorking": "Активен", "TurnOff": "Выключить", + "Uncategorized": "Без категории", "UploadFile": "Загрузить файл", "UploadSpeed": "Скорость отдачи", "Viewed": "Просм." diff --git a/web/src/locales/ua/translation.json b/web/src/locales/ua/translation.json index 99c4de5..ce5c0f2 100644 --- a/web/src/locales/ua/translation.json +++ b/web/src/locales/ua/translation.json @@ -188,6 +188,7 @@ "TorrentStatus": "Статус торенту", "TorrentWorking": "Активний", "TurnOff": "Виключити", + "Uncategorized": "Без категорії", "UploadFile": "Завантажити файл", "UploadSpeed": "Швидкість відвантаження", "Viewed": "Перегл." diff --git a/web/src/locales/zh/translation.json b/web/src/locales/zh/translation.json index 1ad5e8f..86221f5 100644 --- a/web/src/locales/zh/translation.json +++ b/web/src/locales/zh/translation.json @@ -188,6 +188,7 @@ "TorrentStatus": "种子状态", "TorrentWorking": "活跃", "TurnOff": "关闭", + "Uncategorized": "未分类", "UploadFile": "上传文件", "UploadSpeed": "上传速度", "Viewed": "查看" From bf1af8d0a02527926d62a630590bb765a9655ad6 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sun, 7 Apr 2024 04:59:33 +0300 Subject: [PATCH 15/20] some layout improvements --- README.md | 2 ++ web/src/components/Add/LeftSideComponent.jsx | 1 + web/src/components/Add/RightSideComponent.jsx | 14 +++++++++----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ff675ed..dfd0807 100644 --- a/README.md +++ b/README.md @@ -186,6 +186,8 @@ To run the web server locally, just run yarn start ``` +More info at https://github.com/YouROK/TorrServer/tree/master/web#readme + ### Build #### Server diff --git a/web/src/components/Add/LeftSideComponent.jsx b/web/src/components/Add/LeftSideComponent.jsx index 8f4289c..ef42317 100644 --- a/web/src/components/Add/LeftSideComponent.jsx +++ b/web/src/components/Add/LeftSideComponent.jsx @@ -56,6 +56,7 @@ export default function LeftSideComponent({ margin='dense' label={t('AddDialog.TorrentSourceLink')} helperText={t('AddDialog.TorrentSourceOptions')} + style={{ marginTop: '1em' }} type='text' fullWidth variant='outlined' diff --git a/web/src/components/Add/RightSideComponent.jsx b/web/src/components/Add/RightSideComponent.jsx index 5fbd66e..1f68b5e 100644 --- a/web/src/components/Add/RightSideComponent.jsx +++ b/web/src/components/Add/RightSideComponent.jsx @@ -79,6 +79,7 @@ export default function RightSideComponent({ value={originalTorrentTitle} margin='dense' label={t('AddDialog.OriginalTorrentTitle')} + style={{ marginTop: '1em' }} type='text' variant='outlined' fullWidth @@ -100,7 +101,8 @@ export default function RightSideComponent({ endAdornment: ( { setTitle('') setIsCustomTitleEnabled(!isCustomTitleEnabled) @@ -108,7 +110,7 @@ export default function RightSideComponent({ setIsUserInteractedWithPoster(false) }} > - + ), @@ -121,6 +123,7 @@ export default function RightSideComponent({ value={title} margin='dense' label={t('AddDialog.TitleBlank')} + style={{ marginTop: '1em' }} type='text' variant='outlined' fullWidth @@ -154,11 +157,12 @@ export default function RightSideComponent({ ? () => ( { - setCategory(""); + style={{ padding: '1px', marginLeft: '6px', marginRight: '8px' }} + onClick={() => { + setCategory('') }} > - + ) : undefined From 139874bd46c4aaeb2b11466be8d37b1603695adf Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sun, 7 Apr 2024 05:22:30 +0300 Subject: [PATCH 16/20] change movie and tv keys as of TMDB types --- web/src/components/categories.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/categories.jsx b/web/src/components/categories.jsx index f9a1556..a0df4c4 100644 --- a/web/src/components/categories.jsx +++ b/web/src/components/categories.jsx @@ -4,8 +4,8 @@ import MusicNoteIcon from '@material-ui/icons/MusicNote' import MoreHorizIcon from '@material-ui/icons/MoreHoriz' export const TORRENT_CATEGORIES = [ - { key: 'movies', name: 'Movies', icon: }, - { key: 'series', name: 'Series', icon: }, + { key: 'movie', name: 'Movies', icon: }, + { key: 'tv', name: 'Series', icon: }, { key: 'music', name: 'Music', icon: }, { key: 'other', name: 'Other', icon: }, ] From 4ad4137ddd962cb00cdcd344f792a5ab41b11df3 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sun, 7 Apr 2024 06:24:15 +0300 Subject: [PATCH 17/20] show user categories in select on edit --- web/src/components/Add/RightSideComponent.jsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/web/src/components/Add/RightSideComponent.jsx b/web/src/components/Add/RightSideComponent.jsx index 1f68b5e..121d5f2 100644 --- a/web/src/components/Add/RightSideComponent.jsx +++ b/web/src/components/Add/RightSideComponent.jsx @@ -11,7 +11,7 @@ import { TextField, useTheme, } from '@material-ui/core' -import { HighlightOff as HighlightOffIcon, Clear } from '@material-ui/icons' +import { HighlightOff as HighlightOffIcon } from '@material-ui/icons' import { TORRENT_CATEGORIES } from 'components/categories' import { @@ -69,6 +69,9 @@ export default function RightSideComponent({ checkImageURL(url).then(setIsPosterUrlCorrect) setIsUserInteractedWithPoster(true) } + // main categories + const catIndex = TORRENT_CATEGORIES.findIndex(e => e.key === category) + // const catArray = TORRENT_CATEGORIES.find(e => e.key === category) return ( @@ -168,6 +171,14 @@ export default function RightSideComponent({ : undefined } > + {category.length > 1 && catIndex < 0 ? ( + + {t(category)} + + ) : ( + '' + )} + {TORRENT_CATEGORIES.map(category => ( {t(category.name)} From 6359aee692018c281cd3fd12d56a4eea7d538217 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sun, 7 Apr 2024 06:53:04 +0300 Subject: [PATCH 18/20] cosmetics --- web/src/components/Add/RightSideComponent.jsx | 2 +- .../components/DialogTorrentDetailsContent/widgets/index.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/Add/RightSideComponent.jsx b/web/src/components/Add/RightSideComponent.jsx index 121d5f2..11a97ad 100644 --- a/web/src/components/Add/RightSideComponent.jsx +++ b/web/src/components/Add/RightSideComponent.jsx @@ -173,7 +173,7 @@ export default function RightSideComponent({ > {category.length > 1 && catIndex < 0 ? ( - {t(category)} + {category} ) : ( '' diff --git a/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx b/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx index 9502623..76d554e 100644 --- a/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx @@ -140,7 +140,7 @@ export const CategoryWidget = ({ data }) => { return ( = 0 ? t(catArray.name) : data} + value={catIndex >= 0 ? t(catArray.name) : data.length > 1 ? data.charAt(0).toUpperCase() + data.slice(1) : data} iconBg={iconBGColor} valueBg={valueBGColor} icon={CategoryIcon} From 954a2eeb338e0415f4d2e4ffbef9ef9984e743fc Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sun, 7 Apr 2024 16:01:25 +0300 Subject: [PATCH 19/20] use categories as card title heading --- web/src/components/TorrentCard/index.jsx | 3 +-- web/src/components/TorrentCard/style.js | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx index afc3c0b..0697ed3 100644 --- a/web/src/components/TorrentCard/index.jsx +++ b/web/src/components/TorrentCard/index.jsx @@ -122,8 +122,7 @@ const Torrent = ({ torrent }) => {
- {t('Name')} -
{catIndex >= 0 ? t(catArray.name) : category}
+ {category ? (catIndex >= 0 ? t(catArray.name) : category) : t('Name')}
{parsedTitle}
diff --git a/web/src/components/TorrentCard/style.js b/web/src/components/TorrentCard/style.js index 8f3b791..c6ff613 100644 --- a/web/src/components/TorrentCard/style.js +++ b/web/src/components/TorrentCard/style.js @@ -94,7 +94,6 @@ export const TorrentCardButtons = styled.div` export const TorrentCardDescription = styled.div` ${({ theme: { - app: { sidebarBGColor }, torrentCard: { cardSecondaryColor, accentCardColor }, }, }) => css` @@ -116,17 +115,17 @@ export const TorrentCardDescription = styled.div` flex-direction: column; } - .description-title-wrapper > .description-section-name { - display: flex; - flex-wrap: nowrap; - justify-content: space-between; - self-align: end; - } + // .description-title-wrapper > .description-section-name { + // display: flex; + // flex-wrap: nowrap; + // justify-content: space-between; + // self-align: end; + // } - .description-category-wrapper { - display: inline-flex; - color: ${sidebarBGColor}; - } + // .description-category-wrapper { + // display: inline-flex; + // color: #1a1a1a; + // } .description-section-name { text-transform: uppercase; From 1c54f1734543b33f9addde7269bccaefc31f44b2 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Mon, 8 Apr 2024 00:05:52 +0300 Subject: [PATCH 20/20] modules update --- server/go.mod | 36 +++++++++--------- server/go.sum | 102 +++++++++++++++++++++++++------------------------- 2 files changed, 70 insertions(+), 68 deletions(-) diff --git a/server/go.mod b/server/go.mod index 4f719e8..620b4d2 100644 --- a/server/go.mod +++ b/server/go.mod @@ -8,12 +8,12 @@ require ( github.com/agnivade/levenshtein v1.1.1 github.com/alexflint/go-arg v1.4.3 github.com/anacrolix/dms v1.6.0 - github.com/anacrolix/log v0.15.0 + github.com/anacrolix/log v0.15.2 github.com/anacrolix/missinggo/v2 v2.7.3 - github.com/anacrolix/publicip v0.3.0 + github.com/anacrolix/publicip v0.3.1 github.com/anacrolix/torrent v1.54.1 - github.com/gin-contrib/cors v1.5.0 - github.com/gin-contrib/location v0.0.2 + github.com/gin-contrib/cors v1.7.1 + github.com/gin-contrib/location v1.0.0 github.com/gin-gonic/gin v1.9.1 github.com/kljensen/snowball v0.9.0 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c @@ -22,7 +22,7 @@ require ( github.com/swaggo/gin-swagger v1.6.0 github.com/swaggo/swag v1.16.3 go.etcd.io/bbolt v1.3.9 - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 golang.org/x/image v0.15.0 golang.org/x/time v0.5.0 gopkg.in/vansante/go-ffprobe.v2 v2.1.1 @@ -30,7 +30,7 @@ require ( require ( github.com/KyleBanks/depth v1.2.1 // indirect - github.com/RoaringBitmap/roaring v1.9.0 // indirect + github.com/RoaringBitmap/roaring v1.9.1 // indirect github.com/alecthomas/atomic v0.1.0-alpha2 // indirect github.com/alexflint/go-scalar v1.2.0 // indirect github.com/anacrolix/chansync v0.4.0 // indirect @@ -47,7 +47,7 @@ require ( github.com/benbjohnson/immutable v0.4.3 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect - github.com/bytedance/sonic v1.11.1 // indirect + github.com/bytedance/sonic v1.11.3 // indirect github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect github.com/chenzhuoyu/iasm v0.9.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -56,13 +56,13 @@ require ( github.com/frankban/quicktest v1.14.6 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/jsonreference v0.20.4 // indirect - github.com/go-openapi/spec v0.20.14 // indirect - github.com/go-openapi/swag v0.22.9 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/spec v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.18.0 // indirect + github.com/go-playground/validator/v10 v10.19.0 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.6.0 // indirect @@ -76,18 +76,18 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mschoch/smat v0.2.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/rs/dnscache v0.0.0-20230804202142-fc85eb664529 // indirect github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect golang.org/x/arch v0.7.0 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.20.0 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/server/go.sum b/server/go.sum index c9f5bf8..aa8187d 100644 --- a/server/go.sum +++ b/server/go.sum @@ -2,20 +2,23 @@ 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= github.com/RoaringBitmap/roaring v0.4.7/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w= github.com/RoaringBitmap/roaring v0.4.17/go.mod h1:D3qVegWTmfCaX4Bl5CrBE9hfrSrrXIr8KVNvRsDi1NI= github.com/RoaringBitmap/roaring v0.4.23/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo= -github.com/RoaringBitmap/roaring v1.9.0 h1:lwKhr90/j0jVXJyh5X+vQN1VVn77rQFfYnh6RDRGCcE= -github.com/RoaringBitmap/roaring v1.9.0/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90= +github.com/RoaringBitmap/roaring v1.9.1 h1:LXcSqGGGMKm+KAzUyWn7ZeREqoOkoMX+KwLOK1thc4I= +github.com/RoaringBitmap/roaring v1.9.1/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= 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= @@ -34,6 +37,7 @@ 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= @@ -44,8 +48,8 @@ github.com/anacrolix/log v0.3.0/go.mod h1:lWvLTqzAnCWPJA08T2HCstZi0L1y2Wyvm3FJgw github.com/anacrolix/log v0.6.0/go.mod h1:lWvLTqzAnCWPJA08T2HCstZi0L1y2Wyvm3FJgwU9jwU= github.com/anacrolix/log v0.13.1/go.mod h1:D4+CvN8SnruK6zIFS/xPoRJmtvtnxs+CSfDQ+BFxZ68= github.com/anacrolix/log v0.14.2/go.mod h1:1OmJESOtxQGNMlUO5rcv96Vpp9mfMqXXbe2RdinFLdY= -github.com/anacrolix/log v0.15.0 h1:QIhbW5NDUL6P1Aml+ZfdaXJ+QFAnrO0K1EpFYs/nh9M= -github.com/anacrolix/log v0.15.0/go.mod h1:m0poRtlr41mriZlXBQ9SOVZ8yZBkLjOkDhd5Li5pITA= +github.com/anacrolix/log v0.15.2 h1:LTSf5Wm6Q4GNWPFMBP7NPYV6UBVZzZLKckL+/Lj72Oo= +github.com/anacrolix/log v0.15.2/go.mod h1:m0poRtlr41mriZlXBQ9SOVZ8yZBkLjOkDhd5Li5pITA= github.com/anacrolix/missinggo v1.1.0/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo= github.com/anacrolix/missinggo v1.1.2-0.20190815015349-b888af804467/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo= github.com/anacrolix/missinggo v1.2.1/go.mod h1:J5cMhif8jPmFoC3+Uvob3OXXNIhOUikzMt+uUjeM21Y= @@ -59,8 +63,8 @@ github.com/anacrolix/missinggo/v2 v2.7.3 h1:Ee//CmZBMadeNiYB/hHo9ly2PFOEZ4Fhsbnu github.com/anacrolix/missinggo/v2 v2.7.3/go.mod h1:mIEtp9pgaXqt8VQ3NQxFOod/eQ1H0D1XsZzKUQfwtac= github.com/anacrolix/multiless v0.3.1-0.20221221005021-2d12701f83f7 h1:lOtCD+LzoD1g7bowhYJNR++uV+FyY5bTZXKwnPex9S8= github.com/anacrolix/multiless v0.3.1-0.20221221005021-2d12701f83f7/go.mod h1:zJv1JF9AqdZiHwxqPgjuOZDGWER6nyE48WBCi/OOrMM= -github.com/anacrolix/publicip v0.3.0 h1:QK+lvqNzZDznqWMe5lbnjdXsKb7Mvhqy6osV3J+HwPY= -github.com/anacrolix/publicip v0.3.0/go.mod h1:tF1kAG96Ao3t9Q8zyfA7Lso1wOEfHHEcZQTRI+PMm4k= +github.com/anacrolix/publicip v0.3.1 h1:a8tXUS4L6dG3mBFp4ZhvzmEztEEPThJDLTaF2KOAz0g= +github.com/anacrolix/publicip v0.3.1/go.mod h1:tF1kAG96Ao3t9Q8zyfA7Lso1wOEfHHEcZQTRI+PMm4k= github.com/anacrolix/stm v0.2.0/go.mod h1:zoVQRvSiGjGoTmbM0vSLIiaKjWtNPeTvXUSdJQA4hsg= github.com/anacrolix/stm v0.5.0 h1:9df1KBpttF0TzLgDq51Z+TEabZKMythqgx89f1FQJt8= github.com/anacrolix/stm v0.5.0/go.mod h1:MOwrSy+jCm8Y7HYfMAwPj7qWVu7XoVvjOiYwJmpeB/M= @@ -75,6 +79,7 @@ github.com/anacrolix/upnp v0.1.4/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= @@ -91,8 +96,8 @@ github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 h1:GKTyiRCL6zVf5wWaq github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8/go.mod h1:spo1JLcs67NmW1aVLEgtA8Yy1elc+X8y5SRW1sFW4Og= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= -github.com/bytedance/sonic v1.11.1 h1:JC0+6c9FoWYYxakaoa+c5QTtJeiSZNeByOBhXtAFSn4= -github.com/bytedance/sonic v1.11.1/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= +github.com/bytedance/sonic v1.11.3 h1:jRN+yEjakWh8aK5FzrciUHG8OFXK+4/KrAX/ysEtHAA= +github.com/bytedance/sonic v1.11.3/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= @@ -106,6 +111,7 @@ 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= @@ -118,18 +124,18 @@ 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.5.0 h1:DgGKV7DDoOn36DFkNtbHrjoRiT5ExCe+PC9/xp7aKvk= -github.com/gin-contrib/cors v1.5.0/go.mod h1:TvU7MAZ3EwrPLI2ztzTt3tqgvBCq+wn8WpZmfADjupI= +github.com/gin-contrib/cors v1.7.1 h1:s9SIppU/rk8enVvkzwiC2VK3UZ/0NNGsWfUKvV55rqs= +github.com/gin-contrib/cors v1.7.1/go.mod h1:n/Zj7B4xyrgk/cX1WCX2dkzFfaNm/xJb6oIUk7WTtps= 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/location v1.0.0 h1:j/7yjXfMl3Q9wGFhaCeqgss9ozz1euOSVc4T27PfT4E= +github.com/gin-contrib/location v1.0.0/go.mod h1:J5T7bQQOj/uhs37QL+zER84+U3+xj2ofrjt1VZ3FGR0= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= @@ -142,24 +148,21 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= -github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= -github.com/go-openapi/spec v0.20.14 h1:7CBlRnw+mtjFGlPDRZmAMnq35cRzI91xj03HVyUi/Do= -github.com/go-openapi/spec v0.20.14/go.mod h1:8EOhTpBoFiask8rrgwbLC3zmJfz4zsCUueRuPM6GNkw= -github.com/go-openapi/swag v0.22.9 h1:XX2DssF+mQKM2DHsbgZK74y/zj4mo9I99+89xUmuZCE= -github.com/go-openapi/swag v0.22.9/go.mod h1:3/OXnFfnMAwBD099SwYRk7GD3xOrr1iL7d/XNLXVVwE= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= +github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.18.0 h1:BvolUXjp4zuvkZ5YN5t7ebzbhlUtPsPm2S9NAZ5nl9U= -github.com/go-playground/validator/v10 v10.18.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/go-playground/validator/v10 v10.19.0 h1:ol+5Fu+cSq9JD7SoSqe04GMI92cbn0+wvQ3bZ8b/AU4= +github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= @@ -172,7 +175,6 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -199,6 +201,7 @@ 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= @@ -225,16 +228,16 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 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.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -254,8 +257,8 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -265,6 +268,7 @@ 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= @@ -301,6 +305,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -309,8 +314,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 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.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= github.com/swaggo/gin-swagger v1.6.0 h1:y8sxvQ3E20/RCyrXeFfg60r6H0Z+SwpTjMYsMm+zy8M= @@ -324,8 +330,6 @@ github.com/tsynik/torrent v1.2.16 h1:jEXIkdPKIOerO+8b/12wTvEoLnjGFcHX7dMitTmrWH0 github.com/tsynik/torrent v1.2.16/go.mod h1:c/K0Twt8E0qXJj02tl5FmjhGXSl0XzbFYrzkXTGqU+w= 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= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= @@ -344,12 +348,12 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20220428152302-39d4317da171/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8= golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -359,7 +363,7 @@ 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.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= 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= @@ -376,8 +380,8 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220524220425-1d687d428aca/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -388,8 +392,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -400,7 +404,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -413,8 +416,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -437,8 +440,8 @@ golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -473,7 +476,6 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=