epgroup

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 4 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 epgroup 按 TMDB 的剧集组换算季与集。种子标题与文件名有时按另一种排法写集号(动画的绝对集号、另一种分季、DVD 的分季), 追剧选了这部剧的一个剧集组时,订阅对种子与整理入库都先把写的(第几组,组里第几集)换成 TMDB 默认排法的(季,集), 再照默认的季集处理。两边用这里同一套规则,换算的结果一致。

规则:

  • 组按剧集组里的顺序数,从 1 起;只有特别篇(都是第 0 季的集)的组不算。组里的集也按顺序数,从 1 起。
  • 只写了集、没写季的(例如绝对集号「- 25」)按第 1 组算;文件名里没写季时按种子标题写的那一组(见 CoordOf)。
  • 写的组或集剧集组里没有时不换算:多半是按 TMDB 默认的季集写的,调用方照默认的季集处理并写明(Convert 的 ok 为假)。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contiguous

func Contiguous(eps []int) bool

Contiguous 报告升序的集号是不是连着的。

func Season

func Season(refs []Ref, season int) []int

Season 是 refs 里第 season 季的集号(升序)。

func TitleSeason

func TitleSeason(md meta.Meta) int

TitleSeason 是种子标题写的组(给文件名里没写季的文件用):写了季时是这一季,只写了集时是 1,都没写时是 0。

Types

type Coord

type Coord struct {
	Season, SeasonEnd   int
	Episode, EpisodeEnd int
}

Coord 是按剧集组写的季与集:SeasonEnd 大于 Season 时是几组的合集(不看集),Episode 为 0 时是一整组。

func CoordOf

func CoordOf(md meta.Meta, season int) (Coord, bool)

CoordOf 是 md 里写的季集。只写了集的(季是 0)按 season 那一组算:文件名里没写季时传种子标题写的组(见 TitleSeason), 种子标题本身传 0(按第 1 组)。季与集都没写时第二个返回值为假(没得换算)。

func (Coord) String

func (c Coord) String() string

String 是给人看的写法:「第 2 组第 13 集」「第 2 组第 13–14 集」「第 2 组」「第 1–3 组」。

type Map

type Map struct {
	ID   string
	Name string
	Type int
	// contains filtered or unexported fields
}

Map 是一个剧集组的换算表。

func New

func New(g *tmdb.EpisodeGroup) *Map

New 按剧集组的详情建换算表(tmdb.Client.EpisodeGroup 已把组与组里的集按顺序排好)。g 为 nil 时返回 nil。

func (*Map) Convert

func (m *Map) Convert(c Coord) (refs []Ref, ok bool)

Convert 把按剧集组写的季集换成 TMDB 默认排法的季集,按剧集组里的顺序、去掉重复。写的组或集剧集组里都有时 ok 为真; 有一个没有(组号、集号超出,或那一组是空的)时 ok 为假:这个写法不是按这个剧集组排的,调用方照 TMDB 默认的季集处理。

func (*Map) Label

func (m *Map) Label() string

Label 是写进说明的名字:剧集组「名字」。

func (*Map) Parts

func (m *Map) Parts() int

Parts 是有几组(只有特别篇的组不算)。

type Ref

type Ref struct {
	Season  int
	Episode int
}

Ref 是 TMDB 默认排法里的一集。

Jump to

Keyboard shortcuts

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