- Add shinning UI

- Revamp deployment process
- Fix Alldebrid file node bug
This commit is contained in:
Mukhtar Akere
2025-01-13 20:18:59 +01:00
parent 7cb41a0e8b
commit ea73572557
45 changed files with 1414 additions and 829 deletions

View File

@@ -2,9 +2,9 @@ package shared
import (
"fmt"
"goBlack/common"
"goBlack/pkg/debrid"
"goBlack/pkg/downloaders"
"github.com/sirrobot01/debrid-blackhole/common"
"github.com/sirrobot01/debrid-blackhole/pkg/debrid"
"github.com/sirrobot01/debrid-blackhole/pkg/downloaders"
"os"
"path/filepath"
"sync"
@@ -57,7 +57,6 @@ func (q *QBit) ProcessSymlink(debridTorrent *debrid.Torrent) (string, error) {
if len(files) == 0 {
return "", fmt.Errorf("no video files found")
}
q.logger.Printf("Checking %d files...", len(files))
rCloneBase := debridTorrent.Debrid.GetMountPath()
torrentPath, err := q.getTorrentPath(rCloneBase, debridTorrent) // /MyTVShow/

View File

@@ -2,9 +2,9 @@ package shared
import (
"cmp"
"goBlack/common"
"goBlack/pkg/arr"
"goBlack/pkg/debrid"
"github.com/sirrobot01/debrid-blackhole/common"
"github.com/sirrobot01/debrid-blackhole/pkg/arr"
"github.com/sirrobot01/debrid-blackhole/pkg/debrid"
"log"
"os"
)

View File

@@ -1,6 +1,6 @@
package shared
import "goBlack/pkg/debrid"
import "github.com/sirrobot01/debrid-blackhole/pkg/debrid"
type BuildInfo struct {
Libtorrent string `json:"libtorrent"`
@@ -217,6 +217,7 @@ type Torrent struct {
Uploaded int64 `json:"uploaded,omitempty"`
UploadedSession int64 `json:"uploaded_session,omitempty"`
Upspeed int `json:"upspeed,omitempty"`
Source string `json:"source,omitempty"`
}
func (t *Torrent) IsReady() bool {

View File

@@ -5,9 +5,9 @@ import (
"context"
"fmt"
"github.com/google/uuid"
"goBlack/common"
"goBlack/pkg/arr"
"goBlack/pkg/debrid"
"github.com/sirrobot01/debrid-blackhole/common"
"github.com/sirrobot01/debrid-blackhole/pkg/arr"
"github.com/sirrobot01/debrid-blackhole/pkg/debrid"
"io"
"mime/multipart"
"os"
@@ -46,7 +46,7 @@ func (q *QBit) AddTorrent(ctx context.Context, fileHeader *multipart.FileHeader,
}
func (q *QBit) Process(ctx context.Context, magnet *common.Magnet, category string) error {
torrent := q.CreateTorrentFromMagnet(magnet, category)
torrent := q.CreateTorrentFromMagnet(magnet, category, "auto")
a, ok := ctx.Value("arr").(*arr.Arr)
if !ok {
return fmt.Errorf("arr not found in context")
@@ -68,13 +68,14 @@ func (q *QBit) Process(ctx context.Context, magnet *common.Magnet, category stri
return nil
}
func (q *QBit) CreateTorrentFromMagnet(magnet *common.Magnet, category string) *Torrent {
func (q *QBit) CreateTorrentFromMagnet(magnet *common.Magnet, category, source string) *Torrent {
torrent := &Torrent{
ID: uuid.NewString(),
Hash: strings.ToLower(magnet.InfoHash),
Name: magnet.Name,
Size: magnet.Size,
Category: category,
Source: source,
State: "downloading",
MagnetUri: magnet.Link,

View File

@@ -1,8 +1,8 @@
package shared
import (
"goBlack/common"
"goBlack/pkg/debrid"
"github.com/sirrobot01/debrid-blackhole/common"
"github.com/sirrobot01/debrid-blackhole/pkg/debrid"
"path/filepath"
"sync"
"time"