Now saves title of torrent
Possibly need to move thetitle to an intermediate media struct Need to create an interface to use so that new torrent structs can be implemented outside of library
This commit is contained in:
parent
bf03aa8942
commit
3107df1045
35
type.go
35
type.go
@ -48,8 +48,7 @@ type Torrent struct {
|
||||
|
||||
type TorrentVideo struct {
|
||||
*Torrent
|
||||
Episode string
|
||||
Season string
|
||||
Title string
|
||||
Release string
|
||||
Source Src
|
||||
Format Fmt
|
||||
@ -60,6 +59,12 @@ type TorrentVideo struct {
|
||||
P720 bool
|
||||
}
|
||||
|
||||
type TorrentEpisode struct {
|
||||
*TorrentVideo
|
||||
Episode string
|
||||
Season string
|
||||
}
|
||||
|
||||
func NewTorrent(mt MetaTorrent) (T *Torrent) {
|
||||
T = new(Torrent)
|
||||
if mt.Info.Length == 0 {
|
||||
@ -130,17 +135,21 @@ func (T *TorrentVideo) Process() error {
|
||||
case "DVD":
|
||||
T.Source = DVD
|
||||
}
|
||||
}
|
||||
switch {
|
||||
case re[0].MatchString(str):
|
||||
tag = true
|
||||
match := re[0].FindStringSubmatch(str)
|
||||
T.Season = match[1]
|
||||
T.Episode = match[2]
|
||||
case re[1].MatchString(str):
|
||||
match := re[1].FindStringSubmatch(str)
|
||||
T.Release = match[1]
|
||||
T.Creator = match[2]
|
||||
if re[1].MatchString(str) {
|
||||
match := re[1].FindStringSubmatch(str)
|
||||
T.Release = match[1]
|
||||
T.Creator = match[2]
|
||||
}
|
||||
|
||||
} else {
|
||||
if re[0].MatchString(str) {
|
||||
tag = true
|
||||
match := re[0].FindStringSubmatch(str)
|
||||
T.Season = match[1]
|
||||
T.Episode = match[2]
|
||||
} else {
|
||||
T.Title += str
|
||||
}
|
||||
}
|
||||
fmt.Println(re[1])
|
||||
fmt.Printf("tag: %t\n", re[1].MatchString(str))
|
||||
|
Loading…
Reference in New Issue
Block a user