Skip to content

Commit

Permalink
refactor: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
xxxsen committed Jul 9, 2024
1 parent 9776e44 commit 00af174
Show file tree
Hide file tree
Showing 35 changed files with 99 additions and 98 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_data*
__debug_bin*
.vscode
models/
models/
yamdc
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ FROM golang:1.21
RUN apt update && apt install libdlib-dev libblas-dev libatlas-base-dev liblapack-dev libjpeg62-turbo-dev gfortran -y
WORKDIR /build
COPY . ./
RUN CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -a -tags netgo -ldflags '-w' -o av-capture ./
RUN CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -a -tags netgo -ldflags '-w' -o yamdc ./

FROM alpine:3.12

COPY --from=0 /build/av-capture /bin/
COPY --from=0 /build/yamdc /bin/

RUN apk add --no-cache ffmpeg

ENTRYPOINT [ "/bin/av-capture" ]
ENTRYPOINT [ "/bin/yamdc" ]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
av-capture
yamdc
===

由于原先的MovieDataCapture作者把工具闭源了, 只能自己写一个了。
Expand All @@ -12,9 +12,9 @@ av-capture
```yaml
version: "3.1"
services:
av-capture:
image: xxxsen/av-capture:latest
container_name: av-capture
yamdc:
image: xxxsen/yamdc:latest
container_name: yamdc
user: "1000:1000" #指定uid/gid, 根据需要修改
volumes:
- /data/scrape/scandir:/scandir
Expand Down
12 changes: 6 additions & 6 deletions capture/capture.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
package capture

import (
"av-capture/model"
"av-capture/nfo"
"av-capture/number"
"av-capture/processor"
"av-capture/store"
"av-capture/utils"
"context"
"errors"
"fmt"
Expand All @@ -16,6 +10,12 @@ import (
"strconv"
"strings"
"time"
"yamdc/model"
"yamdc/nfo"
"yamdc/number"
"yamdc/processor"
"yamdc/store"
"yamdc/utils"

"github.com/xxxsen/common/logutil"
"github.com/xxxsen/common/trace"
Expand Down
4 changes: 2 additions & 2 deletions capture/config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package capture

import (
"av-capture/processor"
"av-capture/searcher"
"yamdc/processor"
"yamdc/searcher"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module av-capture
module yamdc

go 1.21

Expand Down
2 changes: 1 addition & 1 deletion image/image.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package image

import (
"av-capture/face"
"bytes"
"fmt"
"image"
Expand All @@ -10,6 +9,7 @@ import (
"image/jpeg"
_ "image/png"
"math"
"yamdc/face"

_ "golang.org/x/image/bmp"
"golang.org/x/image/draw"
Expand Down
2 changes: 1 addition & 1 deletion image/watermark.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package image

import (
"av-capture/image/resource"
"bytes"
"fmt"
"image"
"image/draw"
"yamdc/image/resource"
)

type Watermark int
Expand Down
20 changes: 10 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package main

import (
"av-capture/capture"
"av-capture/config"
"av-capture/face"
"av-capture/processor"
"av-capture/processor/handler"
"av-capture/searcher"
"av-capture/store"
"av-capture/translater"
"context"
"flag"
"fmt"
"log"
"path/filepath"
"yamdc/capture"
"yamdc/config"
"yamdc/face"
"yamdc/processor"
"yamdc/processor/handler"
"yamdc/searcher"
"yamdc/store"
"yamdc/translater"

"github.com/xxxsen/common/logger"
"github.com/xxxsen/common/logutil"
"go.uber.org/zap"

"av-capture/searcher/plugin"
_ "av-capture/searcher/plugin/airav"
"yamdc/searcher/plugin"
_ "yamdc/searcher/plugin/airav"
)

var conf = flag.String("config", "./config.json", "config file")
Expand Down
2 changes: 1 addition & 1 deletion model/model.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package model

import "av-capture/number"
import "yamdc/number"

type AvMeta struct {
Number string `json:"number"` //番号
Expand Down
4 changes: 2 additions & 2 deletions processor/default.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package processor

import (
"av-capture/model"
"av-capture/processor/handler"
"context"
"yamdc/model"
"yamdc/processor/handler"
)

var DefaultProcessor IProcessor = &defaultProcessor{}
Expand Down
2 changes: 1 addition & 1 deletion processor/group.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package processor

import (
"av-capture/model"
"context"
"yamdc/model"

"github.com/xxxsen/common/logutil"
"go.uber.org/zap"
Expand Down
4 changes: 2 additions & 2 deletions processor/handler/duration_fixer.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package handler

import (
"av-capture/ffmpeg"
"av-capture/model"
"context"
"yamdc/ffmpeg"
"yamdc/model"

"github.com/xxxsen/common/logutil"
"go.uber.org/zap"
Expand Down
2 changes: 1 addition & 1 deletion processor/handler/duration_fixer_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package handler

import (
"av-capture/model"
"context"
"os"
"os/exec"
"path/filepath"
"testing"
"yamdc/model"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion processor/handler/handler.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package handler

import (
"av-capture/model"
"context"
"fmt"
"sort"
"yamdc/model"
)

type IHandler interface {
Expand Down
8 changes: 4 additions & 4 deletions processor/handler/image_transcode_handler.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package handler

import (
"av-capture/ffmpeg"
"av-capture/image"
"av-capture/model"
"av-capture/store"
"context"
"fmt"
"strings"
"yamdc/ffmpeg"
"yamdc/image"
"yamdc/model"
"yamdc/store"

"github.com/xxxsen/common/logutil"
"go.uber.org/zap"
Expand Down
4 changes: 2 additions & 2 deletions processor/handler/plot_translate_handler.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package handler

import (
"av-capture/model"
"av-capture/translater"
"context"
"fmt"
"yamdc/model"
"yamdc/translater"
)

type plotTranslaterHandler struct {
Expand Down
6 changes: 3 additions & 3 deletions processor/handler/poster_crop_handler.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package handler

import (
"av-capture/image"
"av-capture/model"
"av-capture/store"
"context"
"fmt"
"yamdc/image"
"yamdc/model"
"yamdc/store"

"github.com/xxxsen/common/logutil"
"go.uber.org/zap"
Expand Down
6 changes: 3 additions & 3 deletions processor/handler/tag_padder.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package handler

import (
"av-capture/constant"
"av-capture/model"
"av-capture/utils"
"context"
"yamdc/constant"
"yamdc/model"
"yamdc/utils"
)

type tagPadder struct{}
Expand Down
6 changes: 3 additions & 3 deletions processor/handler/tag_padder_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package handler

import (
"av-capture/constant"
"av-capture/model"
"av-capture/number"
"context"
"testing"
"yamdc/constant"
"yamdc/model"
"yamdc/number"

"github.com/stretchr/testify/assert"
)
Expand Down
6 changes: 3 additions & 3 deletions processor/handler/watermark_handler.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package handler

import (
"av-capture/image"
"av-capture/model"
"av-capture/store"
"context"
"fmt"
"yamdc/image"
"yamdc/model"
"yamdc/store"

"github.com/xxxsen/common/logutil"
)
Expand Down
2 changes: 1 addition & 1 deletion processor/processor.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package processor

import (
"av-capture/model"
"context"
"yamdc/model"
)

type IProcessor interface {
Expand Down
2 changes: 1 addition & 1 deletion searcher/decoder/xpath_decoder.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package decoder

import (
"av-capture/model"
"bytes"
"strings"
"yamdc/model"

"github.com/antchfx/htmlquery"
"golang.org/x/net/html"
Expand Down
12 changes: 6 additions & 6 deletions searcher/default.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package searcher

import (
"av-capture/model"
"av-capture/number"
"av-capture/searcher/plugin"
"av-capture/searcher/utils"
"av-capture/store"
"av-capture/useragent"
"context"
"crypto/md5"
"encoding/hex"
"fmt"
"net/http"
"strings"
"yamdc/model"
"yamdc/number"
"yamdc/searcher/plugin"
"yamdc/searcher/utils"
"yamdc/store"
"yamdc/useragent"

"github.com/imroc/req/v3"
"github.com/xxxsen/common/logutil"
Expand Down
4 changes: 2 additions & 2 deletions searcher/group.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package searcher

import (
"av-capture/model"
"av-capture/number"
"context"
"yamdc/model"
"yamdc/number"

"github.com/xxxsen/common/logutil"
"go.uber.org/zap"
Expand Down
8 changes: 4 additions & 4 deletions searcher/plugin/airav/airav.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package airav

import (
"av-capture/model"
"av-capture/number"
"av-capture/searcher/plugin"
"av-capture/searcher/utils"
"encoding/json"
"fmt"
"net/http"
"strings"
"yamdc/model"
"yamdc/number"
"yamdc/searcher/plugin"
"yamdc/searcher/utils"

"github.com/xxxsen/common/logutil"
"go.uber.org/zap"
Expand Down
Loading

0 comments on commit 00af174

Please sign in to comment.