refactor
This commit is contained in:
parent
678d618ffa
commit
01fbf22e90
6
main.go
6
main.go
@ -49,10 +49,10 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
func process(torrentFile string) *MediaTorrent {
|
||||
func process(torrentFile string) *SceneVideoTorrent {
|
||||
var (
|
||||
mt *MetaTorrent = new(MetaTorrent)
|
||||
vt *MediaTorrent = new(MediaTorrent)
|
||||
mt *MetaTorrent = new(MetaTorrent)
|
||||
vt *SceneVideoTorrent = new(SceneVideoTorrent)
|
||||
)
|
||||
f, _ := os.OpenFile(torrentFile, os.O_RDONLY, 755)
|
||||
mt.ReadFile(f)
|
||||
|
8
type.go
8
type.go
@ -33,19 +33,15 @@ type Torrent struct {
|
||||
Size int64
|
||||
}
|
||||
|
||||
type MediaTorrent struct {
|
||||
type SceneVideoTorrent struct {
|
||||
Torrent
|
||||
Scene.Scene
|
||||
}
|
||||
|
||||
type EpisodeTorrent []MediaTorrent
|
||||
type EpisodeTorrent []SceneVideoTorrent
|
||||
|
||||
type SeriesTorrent []EpisodeTorrent
|
||||
|
||||
type SeriesInterface interface {
|
||||
Title() string
|
||||
}
|
||||
|
||||
func NewTorrent(mt MetaTorrent) (T Torrent) {
|
||||
if mt.Info.Length == 0 {
|
||||
for i, path := range mt.Info.Files {
|
||||
|
Loading…
Reference in New Issue
Block a user