AnimeEpFilepathPattern improved
This commit is contained in:
parent
8ed3e407ee
commit
9ef2eb198d
@ -4,14 +4,21 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"git.milar.in/milarin/anilist"
|
||||||
"git.milar.in/nyaanime/model"
|
"git.milar.in/nyaanime/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type AnimePathPatternData struct {
|
||||||
|
Anime *anilist.Media
|
||||||
|
Episode int
|
||||||
|
Ext string
|
||||||
|
}
|
||||||
|
|
||||||
func GetAnimeEpFilepath(animeEp model.AnimeEpisode, ext string) string {
|
func GetAnimeEpFilepath(animeEp model.AnimeEpisode, ext string) string {
|
||||||
ext = strings.TrimPrefix(ext, ".")
|
ext = strings.TrimPrefix(ext, ".")
|
||||||
|
|
||||||
tmplData := AnimePathPatternData{
|
tmplData := AnimePathPatternData{
|
||||||
Title: animeEp.Anime.Title,
|
Anime: animeEp.Anime,
|
||||||
Episode: animeEp.Episode,
|
Episode: animeEp.Episode,
|
||||||
Ext: ext,
|
Ext: ext,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user