Too lazy
This commit is contained in:
parent
01fbf22e90
commit
2faca86315
7
main.go
7
main.go
@ -23,6 +23,7 @@ func main() {
|
||||
args struct {
|
||||
RES string `arg:"help:Resolution preference [480/720/1080]"`
|
||||
RELEASE []string `arg:"-r,help:Release group preference order."`
|
||||
TAGS []string `arg:"-t, help:Tags to prefer -t internal would choose an internal over another"`
|
||||
Series []string `arg:"required,positional,help:TV series to download"`
|
||||
NEW bool `arg:"-n,help:Only modify new torrents"`
|
||||
PATH string `arg:"-P,help:Path to torrent files"`
|
||||
@ -30,7 +31,7 @@ func main() {
|
||||
)
|
||||
|
||||
arg.MustParse(&args)
|
||||
if len(args.PATH < 1) {
|
||||
if len(args.PATH) < 1 {
|
||||
args.PATH, _ = os.Getwd()
|
||||
}
|
||||
unselectedDir = filepath.Clean(args.PATH + "/unselected/")
|
||||
@ -56,9 +57,9 @@ func process(torrentFile string) *SceneVideoTorrent {
|
||||
)
|
||||
f, _ := os.OpenFile(torrentFile, os.O_RDONLY, 755)
|
||||
mt.ReadFile(f)
|
||||
fmt.Printf("%+v\n", mt)
|
||||
//fmt.Printf("%+v\n", mt)
|
||||
vt.Torrent = NewTorrent(*mt)
|
||||
vt.Parse(vt.Name)
|
||||
fmt.Printf("%+v\n", *vt)
|
||||
fmt.Printf("%v\n", *vt)
|
||||
return vt
|
||||
}
|
||||
|
14
type.go
14
type.go
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/lordwelch/SceneParse"
|
||||
@ -38,7 +39,10 @@ type SceneVideoTorrent struct {
|
||||
Scene.Scene
|
||||
}
|
||||
|
||||
type EpisodeTorrent []SceneVideoTorrent
|
||||
type EpisodeTorrent struct {
|
||||
Episode []SceneVideoTorrent
|
||||
Release string
|
||||
}
|
||||
|
||||
type SeriesTorrent []EpisodeTorrent
|
||||
|
||||
@ -66,6 +70,10 @@ func (Mt *MetaTorrent) ReadFile(r io.Reader) error {
|
||||
return bencode.NewDecoder(r).Decode(Mt)
|
||||
}
|
||||
|
||||
func (s SeriesTorrent) Title() string {
|
||||
return s[0][0].Title
|
||||
func (Vt SceneVideoTorrent) String() string {
|
||||
return fmt.Sprint("Original: ", Vt.Original, "\nName: ", Vt.Name, "\nEpisode: ", Vt.Season, Vt.Episode, "\nTags: ", Vt.Tags)
|
||||
}
|
||||
|
||||
func (s SeriesTorrent) Title() string {
|
||||
return s[0].Episode[0].Title
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user