Discover Packages
github.com/sunerpy/pt-tools
internal
media
epgroup
package
Version:
v1.2.0
Opens a new window with list of versions in this module.
Published: Nov 30, 2026
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
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.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package epgroup 按 TMDB 的剧集组换算季与集。种子标题与文件名有时按另一种排法写集号(动画的绝对集号、另一种分季、DVD 的分季),
追剧选了这部剧的一个剧集组时,订阅对种子与整理入库都先把写的(第几组,组里第几集)换成 TMDB 默认排法的(季,集),
再照默认的季集处理。两边用这里同一套规则,换算的结果一致。
规则:
组按剧集组里的顺序数,从 1 起;只有特别篇(都是第 0 季的集)的组不算。组里的集也按顺序数,从 1 起。
只写了集、没写季的(例如绝对集号「- 25」)按第 1 组算;文件名里没写季时按种子标题写的那一组(见 CoordOf)。
写的组或集剧集组里没有时不换算:多半是按 TMDB 默认的季集写的,调用方照默认的季集处理并写明(Convert 的 ok 为假)。
Contiguous 报告升序的集号是不是连着的。
Season 是 refs 里第 season 季的集号(升序)。
TitleSeason 是种子标题写的组(给文件名里没写季的文件用):写了季时是这一季,只写了集时是 1,都没写时是 0。
type Coord struct {
Season, SeasonEnd int
Episode, EpisodeEnd int
}
Coord 是按剧集组写的季与集:SeasonEnd 大于 Season 时是几组的合集(不看集),Episode 为 0 时是一整组。
CoordOf 是 md 里写的季集。只写了集的(季是 0)按 season 那一组算:文件名里没写季时传种子标题写的组(见 TitleSeason),
种子标题本身传 0(按第 1 组)。季与集都没写时第二个返回值为假(没得换算)。
String 是给人看的写法:「第 2 组第 13 集」「第 2 组第 13–14 集」「第 2 组」「第 1–3 组」。
Map 是一个剧集组的换算表。
New 按剧集组的详情建换算表(tmdb.Client.EpisodeGroup 已把组与组里的集按顺序排好)。g 为 nil 时返回 nil。
Convert 把按剧集组写的季集换成 TMDB 默认排法的季集,按剧集组里的顺序、去掉重复。写的组或集剧集组里都有时 ok 为真;
有一个没有(组号、集号超出,或那一组是空的)时 ok 为假:这个写法不是按这个剧集组排的,调用方照 TMDB 默认的季集处理。
type Ref struct {
Season int
Episode int
}
Ref 是 TMDB 默认排法里的一集。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.