mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-30 03:36:37 +08:00
b0fe40142a
* Rebrand MMTL to MeBox across codebase and assets Rename the project display name, Go module path, environment variable prefix (MEBOX_*), Docker image references, and UI branding from MMTL/mmtl to MeBox/mebox. Replace logo assets with the new MeBox icon and keep legacy SQLite migration support for existing mmtl.db deployments. Co-authored-by: truewhile <truewhile@users.noreply.github.com> * Fix logo icons: use cube-only crop without truncated text Previous icon generation cropped too much of the source image, including partial MeBox wordmark text that was cut off in square icon containers. Regenerate logo-64/192/512, favicon, and SVG from cube-only region. Co-authored-by: truewhile <truewhile@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: truewhile <truewhile@users.noreply.github.com>
39 lines
1.2 KiB
Go
39 lines
1.2 KiB
Go
package service
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/truewhile/MeBox/internal/model"
|
|
)
|
|
|
|
func TestApplyLocalMetadataPreservesPathHintAsPending(t *testing.T) {
|
|
media := &model.Media{Title: "原始标题", ScrapeStatus: "pending"}
|
|
applyLocalMetadata(media, &LocalMetadata{
|
|
Title: "路径标题",
|
|
Year: 2026,
|
|
TMDbID: 12345,
|
|
PathHint: true,
|
|
})
|
|
|
|
if media.Title != "路径标题" || media.Year != 2026 || media.TMDbID != 12345 {
|
|
t.Fatalf("path hint metadata was not applied: %+v", media)
|
|
}
|
|
if media.ScrapeStatus != "pending" {
|
|
t.Fatalf("path hints alone must stay enrichable, got scrape_status=%q", media.ScrapeStatus)
|
|
}
|
|
}
|
|
|
|
func TestApplyLocalMetadataMarksNFOAndDescriptiveMetadataMatched(t *testing.T) {
|
|
nfoMedia := &model.Media{ScrapeStatus: "pending"}
|
|
applyLocalMetadata(nfoMedia, &LocalMetadata{HasNFO: true})
|
|
if nfoMedia.ScrapeStatus != "matched" {
|
|
t.Fatalf("NFO metadata should mark matched, got %q", nfoMedia.ScrapeStatus)
|
|
}
|
|
|
|
descriptiveMedia := &model.Media{ScrapeStatus: "pending"}
|
|
applyLocalMetadata(descriptiveMedia, &LocalMetadata{Overview: "剧情简介"})
|
|
if descriptiveMedia.ScrapeStatus != "matched" {
|
|
t.Fatalf("descriptive metadata should mark matched, got %q", descriptiveMedia.ScrapeStatus)
|
|
}
|
|
}
|