PropertyHolder implemented

This commit is contained in:
Timon Ringwald 2022-08-22 11:35:41 +02:00
parent 9959e68157
commit 87208e95e7
2 changed files with 21 additions and 0 deletions

View File

@ -21,6 +21,8 @@ type ParsedTorrent struct {
Parser *Parser Parser *Parser
} }
var _ PropertyHolder = &ParsedTorrent{}
func (t ParsedTorrent) String() string { func (t ParsedTorrent) String() string {
return fmt.Sprintf("title: %s | episode: %d | resolution: %s | languages: %s | subtitles: %s | %s", return fmt.Sprintf("title: %s | episode: %d | resolution: %s | languages: %s | subtitles: %s | %s",
t.Anime.Title.Native, t.Anime.Title.Native,
@ -31,3 +33,15 @@ func (t ParsedTorrent) String() string {
t.Torrent.StringWithoutTitle(), t.Torrent.StringWithoutTitle(),
) )
} }
func (t *ParsedTorrent) GetLanguages() []string {
return t.Languages
}
func (t *ParsedTorrent) GetSubtitles() []string {
return t.Subtitles
}
func (t *ParsedTorrent) GetResolution() Resolution {
return t.Resolution
}

7
property_holder.go Normal file
View File

@ -0,0 +1,7 @@
package model
type PropertyHolder interface {
GetLanguages() []string
GetSubtitles() []string
GetResolution() Resolution
}