mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 11:36:36 +08:00
chore: 移除源码注释与测试名中的第三方项目引用
将 cloud/external_search/filemanager/subscription_planner 注释及若干测试 函数名中的外部项目名替换为中性表述,不改变任何逻辑与行为。
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// external-storage subsystem to expose remote files as playable media via
|
||||
// HTTP 302 redirects.
|
||||
//
|
||||
// The design mirrors how Alist / MoviePilot offload playback: instead of the
|
||||
// The design offloads playback to the cloud provider: instead of the
|
||||
// host downloading and re-streaming bytes, a provider resolves a file to a
|
||||
// short-lived direct download URL and the player is 302-redirected straight to
|
||||
// the cloud CDN. The host only performs a tiny redirect, freeing its CPU and
|
||||
|
||||
@@ -37,7 +37,7 @@ type ExternalMediaResult struct {
|
||||
}
|
||||
|
||||
// SearchExternalMedia fans out one normalized search intent to TMDb, Douban
|
||||
// and Bangumi. This mirrors MoviePilot's separation of "metadata discovery"
|
||||
// and Bangumi. This keeps a clean separation of "metadata discovery"
|
||||
// from later tracker searching/downloading, but keeps our Go service small.
|
||||
func SearchExternalMedia(ctx context.Context, query string, year int, mediaType string, tmdb *TMDbProvider, douban *DoubanProvider, bangumi *BangumiProvider) []ExternalMediaResult {
|
||||
query = strings.TrimSpace(query)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package service — server-side file browser and safe local file operations.
|
||||
//
|
||||
// FileManagerService exposes a strict, allow-listed view of the server's
|
||||
// filesystem. The design follows MoviePilot's StorageChain boundary: callers
|
||||
// filesystem. The design follows a StorageChain boundary: callers
|
||||
// work with file-item-like records, while this service owns path validation,
|
||||
// local storage operations, and mutation safety.
|
||||
package service
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/ShukeBta/MediaStationGo/internal/repository"
|
||||
)
|
||||
|
||||
func TestClassifyMediaCategoryMatchesMoviePilotStyleRules(t *testing.T) {
|
||||
func TestClassifyMediaCategoryMatchesSmartRules(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
input mediaClassifyInput
|
||||
|
||||
@@ -133,7 +133,7 @@ func TestOrganizeDirectoryHonorsConfiguredNamingFormats(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestOrganizeDirectoryHonorsMoviePilotStyleNamingFormat(t *testing.T) {
|
||||
func TestOrganizeDirectoryHonorsTemplateNamingFormat(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
dest := filepath.Join(root, "media")
|
||||
repos := newOrganizerTestRepo(t)
|
||||
@@ -156,7 +156,7 @@ func TestOrganizeDirectoryHonorsMoviePilotStyleNamingFormat(t *testing.T) {
|
||||
|
||||
want := filepath.Join(dest, "电视剧", "Verify Show (2026)", "Season 1", "Verify Show - S01E02 - 第 2 集.mkv")
|
||||
if _, err := os.Stat(want); err != nil {
|
||||
t.Fatalf("MoviePilot-style naming format not honored, want %q: %v", want, err)
|
||||
t.Fatalf("template naming format not honored, want %q: %v", want, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ func (o *OrganizerService) organizeSourceFile(ctx context.Context, src, sourceRo
|
||||
if category := strings.TrimSpace(mediaCategoryOverride); category != "" {
|
||||
layout.Category = sanitizeFilename(category)
|
||||
} else if category := o.smartClassifySourceFile(ctx, src, sourceRoot, layout.MediaType, title, parsedTitle, metadataMatch); category != "" {
|
||||
// MoviePilot 的分类策略以识别后的元数据为主,下载/源目录只作为
|
||||
// 智能分类以识别后的元数据为主,下载/源目录只作为
|
||||
// 兜底提示。这里即使源目录已有二级分类,也允许 TMDb/Bangumi/NFO
|
||||
// 识别结果修正到真正的分类,避免错误目录导致错误入库。
|
||||
layout.Category = category
|
||||
|
||||
@@ -122,7 +122,7 @@ func TestOrganizeMediaUsesEpisodeNFOSeason(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestOrganizeMediaAddsMoviePilotStyleTypeRootForGenericMediaRoot(t *testing.T) {
|
||||
func TestOrganizeMediaAddsTypeRootForGenericMediaRoot(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
mediaRoot := filepath.Join(root, "media")
|
||||
sourceDir := filepath.Join(root, "downloads", "国产剧")
|
||||
|
||||
@@ -141,7 +141,7 @@ func selectPreparedSubscriptionCandidates(candidates []siteSearchCandidate, sub
|
||||
|
||||
mediaType := normalizeMediaType(sub.MediaType, sub.Name+" "+sub.Filter, "")
|
||||
if !isSubscriptionSeriesType(mediaType) {
|
||||
// 对齐 MoviePilot:非洗版订阅成功下载一次即满足,媒体库/下载中已存在则不再重复下载。
|
||||
// 非洗版订阅成功下载一次即满足,媒体库/下载中已存在则不再重复下载。
|
||||
if (sub == nil || !sub.WashEnabled) && local.LocalMediaCount > 0 {
|
||||
return nil
|
||||
}
|
||||
@@ -253,7 +253,7 @@ func stableDownloadURLKey(raw string) string {
|
||||
return base
|
||||
}
|
||||
|
||||
// defaultExcludeWords 是参考 MoviePilot 默认过滤的「垃圾版本」排除清单,对所有订阅生效,
|
||||
// defaultExcludeWords 是默认过滤的「垃圾版本」排除清单,对所有订阅生效,
|
||||
// 与用户自定义排除词合并。拉丁词在 containsAnyExcludeToken 里按词边界匹配以避免子串误伤。
|
||||
const defaultExcludeWords = "cam,ts,tc,telesync,telecine,hdcam,hdts,枪版,抢先,抢鲜,预告,trailer,sample"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user