initial commit

This commit is contained in:
Timon Ringwald 2022-08-03 19:58:31 +02:00
commit d3b1e83c32
8 changed files with 61 additions and 0 deletions

3
file_parser.go Normal file
View File

@ -0,0 +1,3 @@
package model
type FileParserFunc func(str string) (file *ParsedFile, ok bool)

5
go.mod Normal file
View File

@ -0,0 +1,5 @@
module git.tordarus.net/anime-manager/model
go 1.18
require git.tordarus.net/Tordarus/anilist v1.4.0

2
go.sum Normal file
View File

@ -0,0 +1,2 @@
git.tordarus.net/Tordarus/anilist v1.4.0 h1:vmdieiWlLFKmNgYnvFnET71psvmK4oOmYDjDCq1O7y4=
git.tordarus.net/Tordarus/anilist v1.4.0/go.mod h1:JkOLl/sN3a1mI3JDVls/oqYi83jrrjH8c86vwrBPXEY=

10
parsed_file.go Normal file
View File

@ -0,0 +1,10 @@
package model
import "git.tordarus.net/Tordarus/anilist"
type ParsedFile struct {
FileName string
Anime *anilist.Media
Episode int
Parser *Parser
}

10
parsed_torrent.go Normal file
View File

@ -0,0 +1,10 @@
package model
import "git.tordarus.net/Tordarus/anilist"
type ParsedTorrent struct {
Torrent *Torrent
Anime *anilist.Media
Episode int
Parser *Parser
}

12
parser.go Normal file
View File

@ -0,0 +1,12 @@
package model
type Parser struct {
Identity string
TorrentParser TorrentParserFunc
FileParser FileParserFunc
}
func (p Parser) String() string {
return p.Identity
}

16
torrent.go Normal file
View File

@ -0,0 +1,16 @@
package model
import "time"
type Torrent struct {
ID TorrentID `json:"id"`
Title string `json:"title"`
Link string `json:"link"`
Time time.Time `json:"time"`
Seeders int `json:"seeders"`
Leechers int `json:"leechers"`
Downloads int `json:"downloads"`
Trusted bool `json:"trusted"`
}
type TorrentID string

3
torrent_parser.go Normal file
View File

@ -0,0 +1,3 @@
package model
type TorrentParserFunc func(torrent *Torrent) (parsedTorrent *ParsedTorrent, ok bool)