]> git.lizzy.rs Git - go-anidb.git/blobdiff - misc/episoderange.go
misc: Add FormatLog method to Episode/EpisodeList/EpisodeRange
[go-anidb.git] / misc / episoderange.go
index d78bc0223f8fdff3a56ede80a6906cdfd8f8b35a..fbc5cd35d6e98977568370f11ce69582ea6be0bb 100644 (file)
@@ -28,6 +28,10 @@ func (er *EpisodeRange) Format(width int) string {
        return fmt.Sprintf("%s-%s", er.Start.Format(width), er.End.Format(width))
 }
 
+func (er *EpisodeRange) FormatLog(max int) string {
+       return er.Format(scale(max))
+}
+
 func (er *EpisodeRange) scale() int {
        if er == nil {
                return 1