display

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package display 提供 CLI 纯结果投影与过滤,按领域分文件(movie.go、magnet.go、named.go)。

类型与函数使用领域前缀避免含糊命名。包不接收 io.Writer、不含空列表文案、不编码 JSON、 不创建 Cobra command、不调用 SDK;只依赖 stdlib 与 internal/common/scalar。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterMoviesWithMagnets

func FilterMoviesWithMagnets(items []map[string]any) []map[string]any

FilterMoviesWithMagnets 丢弃 magnets_count == 0 的行;缺失该字段的行保留。

func MovieDurationMinutes

func MovieDurationMinutes(item map[string]any) (int64, bool)

MovieDurationMinutes 返回上游影片正片时长;单位为分钟,非正或无效值视为缺失。

Types

type MagnetRow

type MagnetRow struct {
	Name      string
	Size      string
	Flags     []string
	CreatedAt string
	Hash      string
}

MagnetRow 是磁力单行的结构化投影。

func ProjectMagnet

func ProjectMagnet(item map[string]any) MagnetRow

ProjectMagnet 将磁力记录投影为 MagnetRow,保持名称降级、日期截断与 hash 语义。

func ProjectMagnets

func ProjectMagnets(items []map[string]any) []MagnetRow

ProjectMagnets 将磁力记录列表投影为 MagnetRow 列表。

func (MagnetRow) HashLine

func (r MagnetRow) HashLine() string

HashLine 返回 ` magnet:?xt=urn:btih:{hash}` 行。

func (MagnetRow) Line

func (r MagnetRow) Line() string

Line 返回磁力行文本 `name\tsize\tflags\tdate`(无标记时为 `-`,不含尾随换行)。

type MovieRow

type MovieRow struct {
	Number      string
	ID          string
	Title       string
	ReleaseDate string
}

MovieRow 是影片列表单行的结构化投影。

func ProjectMovie

func ProjectMovie(item map[string]any) MovieRow

ProjectMovie 将影片记录投影为 MovieRow;保留 float64 ID 截断展示约定。

func ProjectMovies

func ProjectMovies(items []map[string]any) []MovieRow

ProjectMovies 将影片记录列表投影为 MovieRow 列表,保持输入顺序。

func (MovieRow) Line

func (r MovieRow) Line() string

Line 返回影片行文本 `number\tid\ttitle[\trelease_date]`(不含尾随换行)。

type NamedRow

type NamedRow struct {
	ID       string
	Name     string
	Count    any
	HasCount bool
}

NamedRow 是命名实体列表单行的结构化投影。

func ProjectNamed

func ProjectNamed(item map[string]any) NamedRow

ProjectNamed 将命名实体记录投影为 NamedRow;name_zht 优先,其次 name。

func ProjectNamedAll

func ProjectNamedAll(items []map[string]any) []NamedRow

ProjectNamedAll 将命名实体记录列表投影为 NamedRow 列表。

func (NamedRow) Line

func (r NamedRow) Line() string

Line 返回命名实体行文本 `id\tname[\tcount]`(不含尾随换行)。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL