From 466e1111ddea0c554deec2af41462fd295f70aeb Mon Sep 17 00:00:00 2001 From: Timon Ringwald Date: Sat, 8 Oct 2022 12:46:42 +0200 Subject: [PATCH] ParsedFile improved --- go.mod | 2 +- go.sum | 4 ++-- parsed_file.go | 30 +++++++++++++++++++++++++++--- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index ec73ce1..787b956 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module git.milar.in/nyaanime/model go 1.18 -require git.milar.in/milarin/anilist v1.4.1 +require git.milar.in/milarin/anilist v1.5.0 diff --git a/go.sum b/go.sum index bcaab5b..641e597 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -git.milar.in/milarin/anilist v1.4.1 h1:XxpKZ3CZiwKf7tUW2z+OMktWt/fLKMd8xAGPr+eodQE= -git.milar.in/milarin/anilist v1.4.1/go.mod h1:8PTHXFMA45JpfRFIpcdrKwDHue8fbT/wwV1BuHFn6c0= +git.milar.in/milarin/anilist v1.5.0 h1:fSiAXY/topNk4ISEp2QtcG9HHKLJfMc8w05iqc+Paf0= +git.milar.in/milarin/anilist v1.5.0/go.mod h1:8PTHXFMA45JpfRFIpcdrKwDHue8fbT/wwV1BuHFn6c0= diff --git a/parsed_file.go b/parsed_file.go index bb95213..8f66cb9 100644 --- a/parsed_file.go +++ b/parsed_file.go @@ -1,7 +1,31 @@ package model +import "git.milar.in/milarin/anilist" + type ParsedFile struct { - FileName string - Episode int - Parser *Parser + // parsed data + Anime *anilist.Media + OriginalAnimeTitle string + Episode int + Languages []string + Subtitles []string + Resolution Resolution + + // meta data + File string + Parser *Parser +} + +var _ PropertyHolder = &ParsedFile{} + +func (f *ParsedFile) GetLanguages() []string { + return f.Languages +} + +func (f *ParsedFile) GetSubtitles() []string { + return f.Subtitles +} + +func (f *ParsedFile) GetResolution() Resolution { + return f.Resolution }