Documentation
¶
Index ¶
- Constants
- Variables
- func BuildFilterPerlReg(vbs []string) string
- func BuildFilterRegs(vbs []string) []string
- func CaptureEpisNum(text string) (string, error)
- func CreateSubject(n string, ext *Extra) (int, error)
- func CreateSubjectViaFeed(feed, name string, ext *Extra) (int, error)
- func FilterWithRegs(s string, contains, exclusions []string) bool
- func FindLastSeason(p string) (int, error)
- func GetSeason(s *Subject)
- func InitTvNfo(p, t string) error
- func JellyfinMetaDataHelper(dp, name string, exited chan struct{})
- func RmFolder(s *Subject) error
- func Scan()
- func StartManagement()
- type BgmiTyp
- type Extra
- type Pip
- type ResourceTyp
- type SubjC
- type Subject
- func (s *Subject) FetchInfo() error
- func (s *Subject) GetPart()
- func (s *Subject) GetSeasonAndPart() string
- func (subj *Subject) Loadfileds(tips map[string]string) error
- func (s *Subject) QbtCateg() string
- func (s *Subject) QbtTag() string
- func (s *Subject) RmRes() error
- func (s *Subject) RssDLSynced() (bool, error)
- func (s *Subject) RssPath() string
- type SubjectManager
Constants ¶
View Source
const ( QbtTag_prefix = "anicat@subj-" QbtTag = QbtTag_prefix + "%d" // identity for each resource )
qbt tag generation template
View Source
const ( CHSSubStationReg = "(?i)简体|簡體|简中|簡中|chs" CHTSubStationReg = "(?i)繁体|繁體|正體中文|正体中文|繁中|cht" )
View Source
const ( CreateViaStr createType = iota CreateViaFeed )
View Source
const (
CoverFN = "folder.jpg" // adapt infuse
)
View Source
const (
FolderSuffix = "@anicat"
)
file-related
Variables ¶
View Source
var ( Delete chan *Pip Create chan *Pip )
View Source
var HOME = CFG.Env.SubjPath
View Source
var Manager = SubjectManager{ // contains filtered or unexported fields }
Functions ¶
func BuildFilterPerlReg ¶
func BuildFilterRegs ¶
func CaptureEpisNum ¶
func CreateSubjectViaFeed ¶
CreateSubjectViaFeed use a specified rss-feed url as the resource to create a subject, if arg `name` is not empty,then will use specified name to fetch info, otherwise parse the feed for link or title to fetch it. eg:
`add --feed <url>` we fetch bgmTV link first,if it doesn't exist,then get title `add --feed <url> --name <specified-name>` use specified name only
func FilterWithRegs ¶
func FindLastSeason ¶
func JellyfinMetaDataHelper ¶
func JellyfinMetaDataHelper(dp, name string, exited chan struct{})
func StartManagement ¶
func StartManagement()
Types ¶
type Extra ¶
type ResourceTyp ¶
type ResourceTyp int
resource type
const ( RSS ResourceTyp = iota Torrent )
func (ResourceTyp) String ¶
func (t ResourceTyp) String() string
type Subject ¶
type Subject struct {
SubjId int `json:"subjId"`
FolderName string `json:"folderName"` // source from tmdb
Name string `json:"name"`
OriginName string `json:"originName"`
Path string `json:"path"`
Finished bool `json:"finished"`
Episode int `json:"episode"`
ResourceTyp ResourceTyp `json:"resourceTyp"`
ResourceUrl string `json:"resourceUrl"`
Typ BgmiTyp `json:"typ"`
FolderTime string `json:"folderTime"` // source from tmdb
StartTime string `json:"startTime"`
EndTime string `json:"endTime"`
Alias string `json:"alias"`
Season string `json:"season"`
Part string `json:"part"` // eg: pt1、pt2
// used while `ResourceTyp` is `Torrent`
TorrentHash string `json:"torrentHash"`
// manager use ctx cancel func to Exit goroutine running the current subject.
// when delete a subject manager,should run the cancel func and if a goroutine is running
// for this subject it will Exit.
// Context is hold by subject-running goroutine
// while subject-running goroutine Exit actively func should be called
Exit context.CancelFunc `json:"-"`
// before detector-goroutine push to subject,Check if this channel is closed.
// before exit Exited channel should be closed
Exited chan struct{} `json:"-"`
// While detector-goroutine detected that the resource downloader of the subject is completed
// it will send downLoad message to subject-running goroutine
// received and push to terminal
PushChan chan qbt.Torrent `json:"-"`
// The anime series of this project has already ended and all episodes have been downloaded.
// while init,if this flag is true then there is no need to start a goroutine to run it
// exit actively flag should be set to true
Terminate bool `json:"terminate"`
// a Set store all pushed renamed episodes,avoid duplicate push.
// content will like be `xxx S01E01,xxx S01E05...`
Pushed map[string]string `json:"pushed"`
RssTorrents map[string]struct{} `json:"rssTorrents"`
}
Subject as a basic object of each bangumi program will load it from OS file and manage them it will be refreshed to OS file after some of the fields have updating
func (*Subject) GetSeasonAndPart ¶
func (*Subject) QbtTag ¶
QbtTag The tag used when adding a torrent with qbt can be used to monitor the downloader status of resources related to this subject file.
func (*Subject) RssDLSynced ¶
RssDLSynced called only when the subject epis is fin
type SubjectManager ¶
type SubjectManager struct {
// contains filtered or unexported fields
}
func (*SubjectManager) Add ¶
func (m *SubjectManager) Add(s *Subject)
func (*SubjectManager) Clear ¶
func (m *SubjectManager) Clear()
func (*SubjectManager) Get ¶
func (m *SubjectManager) Get(sid int) *Subject
func (*SubjectManager) List ¶
func (m *SubjectManager) List() (ls []Subject)
func (*SubjectManager) Remove ¶
func (m *SubjectManager) Remove(sid int)
func (*SubjectManager) Sync ¶
func (m *SubjectManager) Sync()
Click to show internal directories.
Click to hide internal directories.