model/parsed_torrent.go

34 lines
633 B
Go
Raw Normal View History

2022-08-03 19:58:31 +02:00
package model
2022-08-15 14:23:39 +02:00
import (
"fmt"
"strings"
"git.milar.in/milarin/anilist"
)
2022-08-04 00:23:02 +02:00
2022-08-03 19:58:31 +02:00
type ParsedTorrent struct {
2022-08-15 11:35:49 +02:00
// parsed data
Anime *anilist.Media
OriginalAnimeTitle string
Episode int
Languages []string
Subtitles []string
Resolution Resolution
2022-08-15 11:35:49 +02:00
// meta data
Torrent *Torrent
Parser *Parser
2022-08-03 19:58:31 +02:00
}
2022-08-15 14:23:39 +02:00
func (t ParsedTorrent) String() string {
2022-08-21 14:38:44 +02:00
return fmt.Sprintf("title: %s | episode: %d | resolution: %s | languages: %s | subtitles: %s | %s",
2022-08-15 14:23:39 +02:00
t.Anime.Title.Native,
t.Episode,
t.Resolution,
strings.Join(t.Languages, ", "),
strings.Join(t.Subtitles, ", "),
2022-08-21 14:38:44 +02:00
t.Torrent,
2022-08-15 14:23:39 +02:00
)
}