From 87208e95e7acc8fcfd846c7b471c2f6156f4de0a Mon Sep 17 00:00:00 2001 From: Timon Ringwald Date: Mon, 22 Aug 2022 11:35:41 +0200 Subject: [PATCH] PropertyHolder implemented --- parsed_torrent.go | 14 ++++++++++++++ property_holder.go | 7 +++++++ 2 files changed, 21 insertions(+) create mode 100644 property_holder.go diff --git a/parsed_torrent.go b/parsed_torrent.go index bad5e02..6966a0b 100644 --- a/parsed_torrent.go +++ b/parsed_torrent.go @@ -21,6 +21,8 @@ type ParsedTorrent struct { Parser *Parser } +var _ PropertyHolder = &ParsedTorrent{} + func (t ParsedTorrent) String() string { return fmt.Sprintf("title: %s | episode: %d | resolution: %s | languages: %s | subtitles: %s | %s", t.Anime.Title.Native, @@ -31,3 +33,15 @@ func (t ParsedTorrent) String() string { 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 +} diff --git a/property_holder.go b/property_holder.go new file mode 100644 index 0000000..9d83713 --- /dev/null +++ b/property_holder.go @@ -0,0 +1,7 @@ +package model + +type PropertyHolder interface { + GetLanguages() []string + GetSubtitles() []string + GetResolution() Resolution +}